From d29c72492019e52d7d5720ea43044adccae953b4 Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Tue, 16 Jul 2024 15:42:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=81=94=E7=B3=BB=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/router/alarmManagement.ts | 20 ++ .../energyAlarm/editConfigureEnergyAlarm.vue | 6 +- .../equipmentAlarm/editConfigureDeviceAlarm.vue | 5 +- .../alarmSettings/notificationManagement/index.vue | 166 +++------- .../notificationManagement/linkPeople/config.ts | 22 ++ .../notificationManagement/linkPeople/index.vue | 347 +++++++++++++++++---- .../view/alarmManagement/equipmentAlarm/index.vue | 28 ++ .../view/alarmManagement/equipmentAlarm/look.vue | 283 +++++++++++++++++ .../equipmentAlarm/notificationManagementMock.json | 108 +++++++ .../view/alarmManagement/equipmentAlarm/status.vue | 39 +++ .../alarmManagement/equipmentAlarm/ts/config.ts | 164 ++++++++++ 11 files changed, 997 insertions(+), 191 deletions(-) create mode 100644 hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/config.ts create mode 100644 hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue create mode 100644 hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue create mode 100644 hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/notificationManagementMock.json create mode 100644 hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue create mode 100644 hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts diff --git a/hx-ai-intelligent/src/router/alarmManagement.ts b/hx-ai-intelligent/src/router/alarmManagement.ts index 6b8a490..dd930f3 100644 --- a/hx-ai-intelligent/src/router/alarmManagement.ts +++ b/hx-ai-intelligent/src/router/alarmManagement.ts @@ -26,6 +26,26 @@ const alarmManagement = { ], }, { + path: 'equipmentAlarm ', + name: 'EquipmentAlarm', + meta: { title: '设备告警', hideChildren: true, icon: 'gaojingguanli' }, + component: Base, + redirect: { name: 'equipmentAlarmIndex' }, + children: [ + { + path: 'index', + name: 'equipmentAlarmIndex', + // component: () => import('/nerv-lib/saas/view/menuManage/index.vue'), + component: () => import('/@/view/alarmManagement/equipmentAlarm/index.vue'), + meta: { + title: '设备告警', + keepAlive: true, + // backApi: [], + }, + }, + ], + }, + { path: 'alarmSettings', name: 'AlarmSettings', meta: { title: '告警设置', hideChildren: true, icon: 'gaojingguanli' }, diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue index 2043200..eb35977 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue @@ -229,7 +229,7 @@ .post(device.queryDevicePage, { pageNum: 1, pageSize: 999, - energyType: selectedOptions[0].cnValue, + energyType: selectedOptions[0].dicKey, orgId: orgId.value, }) .then((res) => { @@ -241,7 +241,7 @@ .post(group.queryDeviceGroupTree, { pageNum: 1, pageSize: 999, - energyType: selectedOptions[0].cnValue, + energyType: selectedOptions[0].dicKey, orgId: orgId.value, }) .then((res) => { @@ -502,7 +502,7 @@ .grey-background.ant-switch .ant-switch-handle { background-color: grey !important; } - /deep/ .ant-form-item-label { + :deep(.ant-form-item-label) { z-index: 20; text-align: right; width: 23%; 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 39920f9..2ccca11 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue @@ -146,7 +146,7 @@ + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue new file mode 100644 index 0000000..59d78bf --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue @@ -0,0 +1,28 @@ + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue new file mode 100644 index 0000000..62e9a31 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue @@ -0,0 +1,283 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/notificationManagementMock.json b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/notificationManagementMock.json new file mode 100644 index 0000000..6f442ed --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/notificationManagementMock.json @@ -0,0 +1,108 @@ +{ + "listData":[ + { + "id": "d4", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo1", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "1", + "isUse":true + } , { + "id": "d5", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo2", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "0", + "isUse":true + } + ] + +} \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue new file mode 100644 index 0000000..d6cb122 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue @@ -0,0 +1,39 @@ + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts new file mode 100644 index 0000000..8adc472 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts @@ -0,0 +1,164 @@ +import { dateUtil } from '/nerv-lib/util/date-util'; +import data from '../notificationManagementMock.json'; +import { http } from '/nerv-lib/util'; +import { ref } from 'vue'; +const tableKeyMap = [ + { + title: '序号', + dataIndex: 'address', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '告警编号', + dataIndex: 'id', + }, + { + title: '告警描述', + dataIndex: 'deviceCode', + }, + { + title: '优先级', + dataIndex: 'deviceName', + }, + { + title: '状态', + dataIndex: 'position', + }, + { + title: '错误码', + dataIndex: 'position', + textEllipsis: true, + }, + { + title: '设备信息', + dataIndex: 'position', + }, + { + title: '更新时间', + dataIndex: 'enableRules', + }, + { + title: '重复次数', + dataIndex: 'enableRules', + }, +]; +const mockData = ref(data.listData); +export const notificationtableConfig = (look: any, status: any) => { + return { + title: '告警记录', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [{}], + columns: tableKeyMap, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '详情', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + console.log(look.value); + look.value.toggle(data); + }, + }, + { + label: '状态', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + status.value.toggle(data); + }, + }, + ], + }, + + formConfig: { + schemas: [ + { + field: 'name', + label: '告警类型', + component: 'NsSelect', + componentProps: { + placeholder: '请选择告警优先级', + options: [ + { + label: '紧急', + value: '1', + }, + { + label: '重要', + value: '2', + }, + { + label: '一般', + value: '3', + }, + ], + }, + }, + { + field: 'provider', + label: '状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { + label: '待处理', + value: '1', + }, + { + label: '处理中', + value: '2', + }, + { + label: '已完成', + value: '3', + }, + { + label: '超时', + value: '4', + }, + { + label: '关闭', + value: '5', + }, + ], + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'provider', + label: '错误码', + component: 'NsInputApi', + componentProps: { + placeholder: '请输入告警错误码', + }, + }, + { + field: 'createTime', + label: '生产日期', + component: 'NsRangePicker', + fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], + componentProps: { + valueFormat: 'YYYY-MM-DD', + placeholder: ['设备生产开始日期', '设备生产结束日期'], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +};