diff --git a/hx-ai-intelligent/src/icon/gaojingguanli.svg b/hx-ai-intelligent/src/icon/gaojingguanli.svg new file mode 100644 index 0000000..23227d7 --- /dev/null +++ b/hx-ai-intelligent/src/icon/gaojingguanli.svg @@ -0,0 +1,12 @@ + + + + diff --git a/hx-ai-intelligent/src/router/alarmManagement.ts b/hx-ai-intelligent/src/router/alarmManagement.ts new file mode 100644 index 0000000..6b8a490 --- /dev/null +++ b/hx-ai-intelligent/src/router/alarmManagement.ts @@ -0,0 +1,50 @@ +const Base = () => import('/nerv-lib/saas/view/system/layout/content.vue'); +const alarmManagement = { + path: '/alarmManagement', + name: 'AlarmManagement', + meta: { title: '告警管理', icon: 'gaojingguanli', index: 4 }, + redirect: { name: 'alarmManagement' }, + children: [ + { + path: 'alarmOverview', + name: 'AlarmOverview', + meta: { title: '告警总览', hideChildren: true, icon: 'gaojingguanli' }, + component: Base, + redirect: { name: 'alarmOverviewIndex' }, + children: [ + { + path: 'index', + name: 'alarmOverviewIndex', + // component: () => import('/nerv-lib/saas/view/menuManage/index.vue'), + component: () => import('/@/view/alarmManagement/alarmOverview/index.vue'), + meta: { + title: '告警总览', + keepAlive: true, + // backApi: [], + }, + }, + ], + }, + { + path: 'alarmSettings', + name: 'AlarmSettings', + meta: { title: '告警设置', hideChildren: true, icon: 'gaojingguanli' }, + component: Base, + redirect: { name: 'alarmSettingsIndex' }, + children: [ + { + path: 'index', + name: 'alarmSettingsIndex', + // component: () => import('/nerv-lib/saas/view/menuManage/index.vue'), + component: () => import('/@/view/alarmManagement/alarmSettings/index.vue'), + meta: { + title: '告警设置', + keepAlive: true, + // backApi: [], + }, + }, + ], + }, + ], +}; +export default alarmManagement; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue new file mode 100644 index 0000000..31acf84 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue @@ -0,0 +1,101 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/components/energyAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/components/energyAlarm.vue new file mode 100644 index 0000000..837dc0a --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/components/energyAlarm.vue @@ -0,0 +1,170 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue new file mode 100644 index 0000000..cafe1f1 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue @@ -0,0 +1,224 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue new file mode 100644 index 0000000..b335638 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue @@ -0,0 +1,339 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue new file mode 100644 index 0000000..a8ab1e0 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue @@ -0,0 +1,255 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue new file mode 100644 index 0000000..3eac872 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue @@ -0,0 +1,97 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagementMock.json b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagementMock.json new file mode 100644 index 0000000..1a6c067 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagementMock.json @@ -0,0 +1,94 @@ +{ + "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, + "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, + "isUse":true + } + ] + +} \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/configureDeviceAlarms.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/configureDeviceAlarms.ts new file mode 100644 index 0000000..05d46c4 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/configureDeviceAlarms.ts @@ -0,0 +1,204 @@ +import { dateUtil } from '/nerv-lib/util/date-util'; +import data from '../notificationManagementMock.json'; +import { http } from '/nerv-lib/util'; +import { Modal } from 'ant-design-vue'; +import { ref } from 'vue'; +const tableKeyMap = [ + { + title: '序号', + dataIndex: 'address', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '规则id', + dataIndex: 'id', + }, + { + title: '设备信心', + dataIndex: 'deviceCode', + }, + { + title: '告警点位', + dataIndex: 'deviceName', + }, + { + title: '判断条件', + dataIndex: 'position', + }, + { + title: '取值类型', + dataIndex: 'position', + textEllipsis: true, + }, + { + title: '异常描述', + dataIndex: 'position', + }, + { + title: '启用通知', + dataIndex: 'isUse', + }, +]; +const mockData = ref(data.listData); +const doWnload = (url) => { + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = encodeURI(url); + //设置下载的文件名 + // a.download = fileName.value; + //触发a标签的点击事件,进行下载 + a.click(); +}; + +export const configureDeviceAlarms = (editEquipmentAlarm, elFormula, title) => { + return { + title: '告警规则', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [ + { + label: '新增', + name: 'RoleTypeAdd', + type: 'primary', + handle: () => { + editEquipmentAlarm.value.toggle(); + }, + }, + { + label: '导入', + name: 'groupImport', + type: 'primary', + extra: { + // api: props.postImportApi, // 导入接口名 + title: '设备信息', // 弹窗title + templateName: 'whiteListUser', // 所使用的文件名称 + indexName: '设备id', // 匹配类型字段 + message: [ + { label: '1、若必填项未填写,则不能进行导入操作' }, + { label: `2、当重复时,则更新数据。` }, + { label: '3、数据将从模版的第五行进行导入。' }, + { label: '4、文件导入勿超过5MB。' }, + ], + }, + }, + { + label: '导出', + name: 'groupExports', + type: 'primary', + handle: () => { + doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); + }, + }, + { + label: '批量删除', + type: 'primary', + name: 'userBatchDel', + dynamicDisabled: (data: any) => { + return data.list.length === 0; + }, + confirm: true, + isReload: true, + isClearCheck: true, + // api: origanizemanage.batchDel, + dynamicParams: { userIds: 'userId[]' }, + }, + ], + columns: tableKeyMap, + params: { + page: 0, + pageSize: 10, + }, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '编辑', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + editEquipmentAlarm.value.toggle(data); + }, + }, + { + label: '删除', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + confirm: true, + handle: () => { + // mockData.value.splice(0, 1); + }, + }, + ], + }, + formConfig: { + title: title, + schemas: [ + { + field: 'provider', + label: '告警优先级', + component: 'NsSelect', + componentProps: { + placeholder: '请选择告警优先级', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'payWay', + label: '启用状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择启用状态', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +}; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts new file mode 100644 index 0000000..51abef7 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts @@ -0,0 +1,205 @@ +import { dateUtil } from '/nerv-lib/util/date-util'; +import data from '../notificationManagementMock.json'; +import { http } from '/nerv-lib/util'; +import { Modal } from 'ant-design-vue'; +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: 'isUse', + }, +]; +const mockData = ref(data.listData); +const doWnload = (url) => { + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = encodeURI(url); + //设置下载的文件名 + // a.download = fileName.value; + //触发a标签的点击事件,进行下载 + a.click(); +}; + +export const equipmentAlarmTableConfig = ( + editEquipmentAlarm, + elFormula, + equipmentAlarm, + configureDeviceAlarms, +) => { + return { + title: '告警规则', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [ + { + label: '新增', + name: 'RoleTypeAdd', + type: 'primary', + handle: () => { + editEquipmentAlarm.value.toggle(); + }, + }, + { + label: '导入', + name: 'groupImport', + type: 'primary', + extra: { + // api: props.postImportApi, // 导入接口名 + title: '设备信息', // 弹窗title + templateName: 'whiteListUser', // 所使用的文件名称 + indexName: '设备id', // 匹配类型字段 + message: [ + { label: '1、若必填项未填写,则不能进行导入操作' }, + { label: `2、当重复时,则更新数据。` }, + { label: '3、数据将从模版的第五行进行导入。' }, + { label: '4、文件导入勿超过5MB。' }, + ], + }, + }, + { + label: '导出', + name: 'groupExports', + type: 'primary', + handle: () => { + doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); + }, + }, + ], + columns: tableKeyMap, + params: { + page: 0, + pageSize: 10, + }, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '编辑', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + editEquipmentAlarm.value.toggle(data); + }, + }, + { + label: '配置', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + equipmentAlarm.value = !equipmentAlarm.value; + configureDeviceAlarms.value.setconfigureDeviceAlarmsData(data); + }, + }, + { + label: '删除', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + confirm: true, + handle: () => { + // mockData.value.splice(0, 1); + }, + }, + ], + }, + + formConfig: { + schemas: [ + { + field: 'provider', + label: '告警优先级', + component: 'NsSelect', + componentProps: { + placeholder: '请选择告警优先级', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'payWay', + label: '启用状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择启用状态', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +}; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts new file mode 100644 index 0000000..6e2d34a --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.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: 'isUse', + }, +]; +const mockData = ref(data.listData); +export const notificationtableConfig = (el, elGroup, elFormula) => { + return { + title: '告警规则', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [{}], + columns: tableKeyMap, + params: { + page: 0, + pageSize: 10, + }, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '联系方式', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + console.log(data, '联系方式'); + }, + }, + // { + // label: '删除', + // name: 'FeedBackDetail', + // dynamicParams: ['uuid', 'appealType'], + // confirm: true, + // handle: () => { + // mockData.value.splice(0, 1); + // }, + // }, + ], + }, + + formConfig: { + schemas: [ + { + field: 'name', + label: '告警类型', + component: 'NsSelect', + componentProps: { + placeholder: '请选告警类型', + options: [ + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + { + field: 'provider', + label: '告警优先级', + component: 'NsSelect', + componentProps: { + placeholder: '请选择告警优先级', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'provider', + label: '告警标题', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警标题关键字', + }, + }, + { + field: 'payWay', + label: '启用状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择启用状态', + options: [ + { + label: '全部', + value: '', + }, + { + label: '启用', + value: '1', + }, + { + label: '关闭', + value: '0', + }, + ], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +}; diff --git a/lib/component/form/form/form.vue b/lib/component/form/form/form.vue index 4a407ac..ac5e173 100644 --- a/lib/component/form/form/form.vue +++ b/lib/component/form/form/form.vue @@ -8,7 +8,7 @@ ref="formElRef" :model="formModel">
- 查询 + {{ title ? title : '查询' }} + +