diff --git a/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts b/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts new file mode 100644 index 0000000..b3f80fd --- /dev/null +++ b/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts @@ -0,0 +1,4 @@ +export enum equipmentAlarmApi { + getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表 + getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表 +} diff --git a/hx-ai-intelligent/src/api/dict.ts b/hx-ai-intelligent/src/api/dict.ts new file mode 100644 index 0000000..3e5f685 --- /dev/null +++ b/hx-ai-intelligent/src/api/dict.ts @@ -0,0 +1,6 @@ +export enum dict { + dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', + updateDictionary = '/carbon-smart/client/dict/updateDictionary', + createDictionary = '/carbon-smart/client/dict/createDictionary', + delDictionary = '/carbon-smart/client/dict/delDictionary', +} diff --git a/hx-ai-intelligent/src/icon/status-0.svg b/hx-ai-intelligent/src/icon/status-0.svg deleted file mode 100644 index d05487a..0000000 --- a/hx-ai-intelligent/src/icon/status-0.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/status-1.svg b/hx-ai-intelligent/src/icon/status-1.svg index 7ded55c..d05487a 100644 --- a/hx-ai-intelligent/src/icon/status-1.svg +++ b/hx-ai-intelligent/src/icon/status-1.svg @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/status-2.svg b/hx-ai-intelligent/src/icon/status-2.svg index 5e24ea9..7ded55c 100644 --- a/hx-ai-intelligent/src/icon/status-2.svg +++ b/hx-ai-intelligent/src/icon/status-2.svg @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/status-3.svg b/hx-ai-intelligent/src/icon/status-3.svg index 3dcdc39..5e24ea9 100644 --- a/hx-ai-intelligent/src/icon/status-3.svg +++ b/hx-ai-intelligent/src/icon/status-3.svg @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/status-4.svg b/hx-ai-intelligent/src/icon/status-4.svg index 08e2ae4..3dcdc39 100644 --- a/hx-ai-intelligent/src/icon/status-4.svg +++ b/hx-ai-intelligent/src/icon/status-4.svg @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/status-5.svg b/hx-ai-intelligent/src/icon/status-5.svg new file mode 100644 index 0000000..08e2ae4 --- /dev/null +++ b/hx-ai-intelligent/src/icon/status-5.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/icon/zidian.svg b/hx-ai-intelligent/src/icon/zidian.svg new file mode 100644 index 0000000..8bdc9c9 --- /dev/null +++ b/hx-ai-intelligent/src/icon/zidian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hx-ai-intelligent/src/router/dict.ts b/hx-ai-intelligent/src/router/dict.ts new file mode 100644 index 0000000..c34035b --- /dev/null +++ b/hx-ai-intelligent/src/router/dict.ts @@ -0,0 +1,15 @@ +const dict = { + path: '/dict', + name: 'dict', + meta: { title: '字典', icon: 'zidian', index: 7, hideChildren: true }, + redirect: { name: 'dictIndex' }, + children: [ + { + path: 'index', + name: 'dictIndex', + meta: { title: '字典', hideChildren: true, icon: 'zidian' }, + component: () => import('/@/view/dict/index.vue'), + }, + ], +}; +export default dict; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue index a26556e..9e05fda 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue @@ -48,7 +48,6 @@ name: 'alarmOverviewIndex', // 与页面路由name一致缓存才可生效 }); - const info = ref({}); let chartInstance: echarts.ECharts | null = null; let chartInstanceOne: echarts.ECharts | null = null; let chartInstanceTow: echarts.ECharts | null = null; @@ -57,8 +56,11 @@ const echartPieTow = ref(null); const getGraphChart = () => { let dayData = []; + // 能源告警 let energyAlarm = []; + // 网关告警 let wgAlarm = []; + // 设备告警 let equipmentAlarm = []; let total = []; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue index 3aa322d..8527afb 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue @@ -26,7 +26,6 @@ import editConfigureEnergyAlarm from './editConfigureEnergyAlarm.vue'; import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; - import { device } from '/@/api/deviceManage'; import { dict } from '/@/api'; export default { @@ -229,29 +228,6 @@ formConfig: { title: value.errorCode, schemas: [ - // { - // field: 'deviceNode', - // label: '设备名称', - // component: 'nsSelectApi', - // componentProps: { - // api: device.queryDevicePage, - // allowClear: true, - // params: { - // orgId: orgId.value, - // pageNum: 1, - // pageSize: 99, - // }, - // placeholder: '请选择设备名称', - // resultField: 'data.records', - // labelField: 'deviceName', - // valueField: 'id', - // showSearch: true, - // filterOption: (input: string, option: any) => { - // return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; - // }, - // // autoAddLink: true, //默认添加联动 - // }, - // }, { field: 'deviceName', label: '设备信息/节点信息', diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue index 7187627..e1a334f 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue @@ -42,6 +42,7 @@ const orgId = ref(''); const result = JSON.parse(sessionStorage.getItem('ORGID')!); orgId.value = result; + // 改变状态 const clickSwitch = (data: any) => { NsModal.confirm({ title: '启用状态', diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue index 530006a..ca07bd3 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue @@ -213,6 +213,7 @@ http.post(device.queryDevicePoint, value).then((res) => { if (res.msg === 'success') { res.data.forEach((item: any) => { + //显示格式 devicePointData.value.push({ value: item.id, label: item.code + ' ( ' + item.unit + ' ) ', @@ -336,10 +337,13 @@ item.logic = item.logic.value; }); } + infoObject.value.valueType = infoObject.value.valueType.value; infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || []; delete infoObject.value.hxAlarmRuleLogicList; + // 回显 格式化 infoObject.value.deviceType = selectDevice; - infoObject.value.valueType = infoObject.value.valueType.value; + + //数据类型转换 infoObject.value.ruleType = infoObject.value.ruleType + ''; } }); @@ -450,6 +454,8 @@ abnormalDescription: null, deviceType: [], devicePoint: null, + valueType: null, + deviceId: null, enableRules: 0, alarmList: [{ logic: null, num: null, isDelete: 0 }], }; @@ -470,6 +476,7 @@ // 确保 index 在有效范围内 if (index < infoObject.value.alarmList.length && index >= 0) { const alarmItemToDelete = infoObject.value.alarmList[index]; + // 判断删除的 是否在数据库中 if (alarmItemToDelete?.id) { // 添加到 delAlarmList 中,并标记为已删除 delAlarmList.value.push({ ...alarmItemToDelete, isDelete: 1 }); diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue index 46f7807..2cce3b9 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue @@ -274,10 +274,12 @@ // 设备告警 编辑或添加成功 刷新列表 const editObject = () => { mainRefEquipmentAlarm.value?.nsTableRef.reload(); + mainRef.value?.nsTableRef.reload(); }; // 能源告警 编辑或添加成功 刷新列表 const editeEnergyAlarmInfo = () => { mainEnergyAlarmConfig.value?.nsTableRef.reload(); + mainRef.value?.nsTableRef.reload(); }; return { notificationConfig, diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue index 6f62923..0a42e22 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue @@ -133,7 +133,7 @@ pageSize: 10, showQuickJumper: true, showLessItems: true, - // showSizeChanger: true, + // showSizeChanger: true, //分页改变大小 showTotal: (total: number, range: any) => total && range ? `显示第${range[0]}到${range[1]}条记录,共 ${total} 条记录` : '', onChange: handleChangePage, @@ -145,6 +145,7 @@ dataSource.value.forEach((item) => { ids.push(item.userId); }); + // 传到子页面 linkPeoples.value.getData({ id: ids, data: dataSource.value }); }; //取消弹窗 @@ -194,14 +195,17 @@ }) .then((res) => { infoObject.value = res.data; + //处理通知方式 if (infoObject.value.notificationMethod) { infoObject.value.notificationMethod = infoObject.value.notificationMethod.split(','); } else { infoObject.value.notificationMethod = []; } + //处理通知人 dataSource.value = res.data.hxAlarmNotifyUserList; }); } else { + dataSource.value = []; infoObject.value = { enableNotifications: 0, notificationMethod: [], @@ -236,6 +240,7 @@ obj.notificationMethod = infoObject.value.notificationMethod.toString(); obj.id = infoObject.value.id; obj.enableNotifications = infoObject.value.enableNotifications; + //处理 选择人数据 dataSource.value.forEach((item) => { obj.hxAlarmNotifyUserList.push({ userId: item.userId, @@ -247,6 +252,7 @@ if (res.msg === 'success') { NsMessage.success('操作成功'); visible.value = false; + dataSource.value = []; emit('updNotification', null); } }); @@ -257,6 +263,7 @@ formRef.value.resetFields(); visible.value = false; visibleModel.value = false; + dataSource.value = []; }; defineExpose({ toggle, diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue index 06f9ab1..0bb28a2 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue @@ -69,15 +69,14 @@
{{ record.alarmTitle }}
+ {{ record.abnormalDescription }} + + + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue index 86c2212..9f5d6cd 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue @@ -13,10 +13,10 @@
- 告警编号:20230310001 + 告警编号:{{ infoObject.alarmCode }}
- 2024-03-10 15:08:10 + {{ infoObject.updateTime }}
@@ -26,14 +26,21 @@
- 紧急 - 新告警 - C003 -
用电量超标
当日用电量超出预设值
{{ + infoObject.priority ? infoObject.priority.label : '' + }} + {{ + infoObject.alarmLogState ? infoObject.alarmLogState.label : '' + }} + {{ infoObject.errorCode }} + +
{{ infoObject.alarmTitle }}
+ {{ infoObject.abnormalDescription }}
- 1栋10层低压柜 - 0 + {{ infoObject.deviceInfo }} + + {{ infoObject.alarmRepetitions }} +
@@ -51,16 +58,37 @@ let chartInstance: echarts.ECharts | null = null; const graphChart = ref(null); + const infoObject = ref({ + priority: null, + alarmCode: null, + alarmLogState: null, + errorCode: null, + alarmTitle: null, + abnormalDescription: null, + deviceInfo: null, + alarmRepetitions: null, + updateTime: null, + }); const visible = ref(false); const handleClose = () => { visible.value = false; + infoObject.value = { + priority: null, + alarmCode: null, + alarmLogState: null, + errorCode: null, + alarmTitle: null, + abnormalDescription: null, + deviceInfo: null, + alarmRepetitions: null, + updateTime: null, + }; }; const btnClick = () => { - console.log('btnClick'); handleClose(); }; const toggle = (data: any) => { - console.log(data, 'data'); + infoObject.value = data; visible.value = true; setTimeout(() => { getChatr(); diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue index dc4950b..5c4755a 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue @@ -39,21 +39,22 @@ - + +
xxxx
+ +
+ +