From e7642fe14c260071a64e1e3a8dfa455aed7cca26 Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 12 Aug 2024 15:33:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2=20=E6=A0=B9=E6=8D=AEui?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/api/planToAdd.ts | 6 +- hx-ai-intelligent/src/icon/del.svg | 6 + .../energyAlarm/configureEnergyAlarms.vue | 20 ++- .../energyAlarm/editConfigureEnergyAlarm.vue | 35 +++-- .../alarmSettings/energyAlarm/editeEnergyAlarm.vue | 29 +++- .../equipmentAlarm/configureDeviceAlarms.vue | 21 ++- .../equipmentAlarm/editConfigureDeviceAlarm.vue | 39 ++++-- .../equipmentAlarm/editeEquipmentAlarm.vue | 29 +++- .../view/alarmManagement/alarmSettings/index.vue | 12 +- .../alarmSettings/notificationManagement/index.vue | 71 +++++++--- .../alarmSettings/ts/energyAlarmConfig.ts | 12 ++ .../alarmSettings/ts/equipmentAlarmConfig.ts | 5 + .../ts/notificationManagementConfig.ts | 13 +- .../view/alarmManagement/energyAlarm/status.vue | 1 + .../view/alarmManagement/energyAlarm/ts/config.ts | 5 +- .../view/alarmManagement/equipmentAlarm/status.vue | 1 + .../alarmManagement/equipmentAlarm/ts/config.ts | 5 +- .../view/alarmManagement/gatewayAlarm/ts/config.ts | 7 + .../view/equipmentControl/electricDoor/index.vue | 4 +- .../src/view/equipmentControl/planToAdd/config.ts | 152 ++++++++++++++++++++ .../src/view/equipmentControl/planToAdd/index.vue | 153 ++------------------- 21 files changed, 408 insertions(+), 218 deletions(-) create mode 100644 hx-ai-intelligent/src/icon/del.svg create mode 100644 hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts diff --git a/hx-ai-intelligent/src/api/planToAdd.ts b/hx-ai-intelligent/src/api/planToAdd.ts index cf24f60..4841c52 100644 --- a/hx-ai-intelligent/src/api/planToAdd.ts +++ b/hx-ai-intelligent/src/api/planToAdd.ts @@ -1,5 +1,5 @@ export enum planToAddApi { - getActivatedPlanTree = '/carbon-smart/api/api/deviceCtrlPlan/getActivatedPlanTree', //计划树 - getActivatedPlanListByTree = '/carbon-smart/api/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表 - updPlan = '/carbon-smart/api/deviceCtrlPlan/updateActivatedPlan', //修改计划 + getActivatedPlanTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanTree', //计划树 + getActivatedPlanListByTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表 + updPlan = '/carbon-smart/deviceCtrlPlan/updateActivatedPlan', //修改计划 } diff --git a/hx-ai-intelligent/src/icon/del.svg b/hx-ai-intelligent/src/icon/del.svg new file mode 100644 index 0000000..c8c2fcf --- /dev/null +++ b/hx-ai-intelligent/src/icon/del.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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 c6d4042..966b7ca 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue @@ -167,6 +167,7 @@ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '规则id', @@ -179,6 +180,7 @@ { title: '对比类型', dataIndex: 'comparisonType', + width: 180, }, { title: '告警点位', @@ -196,11 +198,16 @@ { title: '启用状态', dataIndex: 'enableRules', + width: 120, }, ], // rowSelection: null, 选择按钮 + scroll: { x: 2500 }, columnActions: { title: '操作', + width: 200, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '编辑', @@ -318,24 +325,25 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } - + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; + } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } -../../../../api/alarmManagement/alarmSettings/energyAlarm 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 3d6275b..d48dde5 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue @@ -2,12 +2,28 @@ +
+ {{ infoObject?.id ? '编辑' : '新增' }} +
@@ -104,9 +120,7 @@
- +
-../../../../api/alarmManagement/alarmSettings/energyAlarm diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue index 9fc566c..2a2b37c 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue @@ -8,6 +8,22 @@ :cancel="handleClose" placement="right" @close="handleClose"> +
+ {{ infoObject?.id ? '编辑' : '新增' }} +
@@ -260,24 +276,26 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } - + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; + } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } :deep(.ant-form-item-label) { z-index: 20; @@ -285,4 +303,3 @@ width: 23%; } -../../../../api/alarmManagement/alarmSettings/energyAlarm 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 63b1284..9881856 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue @@ -145,6 +145,7 @@ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '规则id', @@ -157,6 +158,7 @@ { title: '告警点位', dataIndex: 'devicePointName', + width: 120, }, { title: '判断条件', @@ -165,6 +167,7 @@ { title: '取值类型', dataIndex: 'valueType', + width: 140, }, { title: '异常描述', @@ -173,11 +176,16 @@ { title: '启用状态', dataIndex: 'enableRules', + width: 120, }, ], // rowSelection: null, 选择按钮 + scroll: { x: 2500 }, columnActions: { title: '操作', + width: 200, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '编辑', @@ -304,24 +312,25 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } - + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; + } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } -../../../../api/alarmManagement/alarmSettings/deviceAlarms 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 59e66ea..82dfbfb 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue @@ -2,13 +2,29 @@ -
+
+
+ {{ infoObject?.id ? '编辑' : '新增' }} +
- +
-../../../../api/alarmManagement/alarmSettings/deviceAlarms diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue index 773f6ac..58a64fb 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue @@ -2,12 +2,28 @@ +
+ {{ infoObject?.id ? '编辑' : '新增' }} +
@@ -320,24 +336,27 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: alarmSettings !important; + } + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; } :deep(.ant-form-item-label) { z-index: 20; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue index 828fc03..bb82861 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue @@ -326,23 +326,25 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } - + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; + } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } 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 069ff52..8c4c7c8 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue @@ -2,13 +2,29 @@
+
+ 设置通知联系人 +
-
-
- 联系人名单 +
+
+ 联系人名单 +
+
+ 选择联系人 +
- -
-
- 选择联系人
- total && range ? `显示第${range[0]}到${range[1]}条记录,共 ${total} 条记录` : '', + showTotal: (total: number, range: any) => (total && range ? '' : ''), onChange: handleChangePage, }); //点击联系人 @@ -287,28 +314,38 @@ background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } .grey-background.ant-switch { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } .blue-background.ant-switch-checked .ant-switch-handle { background-color: linear-gradient( 180deg, rgba(1, 206, 255, 1) 0%, - rgba(0, 150, 229, 1) 100% + rgba(57, 215, 187, 1) 100% ) !important; } - + .ant-switch-checked { + background-color: rgba(57, 215, 187, 1) !important; + } .grey-background.ant-switch .ant-switch-handle { - background-color: grey !important; + background-color: rgba(238, 238, 238, 1) !important; } :deep(.ant-form-item-label) { z-index: 20; text-align: left; width: 20%; } + :deep(.ant-pagination-prev) { + border: 1px solid rgba(207, 212, 219, 1) !important; + margin-right: 6px !important; + } + :deep(.ant-pagination-next) { + border: 1px solid rgba(207, 212, 219, 1) !important; + margin-left: 6px !important; + } diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts index 31b8c96..d11906a 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts @@ -14,10 +14,12 @@ const tableKeyMap = [ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '优先级', dataIndex: 'priority', + width: 120, }, { title: '告警标题', @@ -26,26 +28,32 @@ const tableKeyMap = [ { title: '错误码', dataIndex: 'errorCode', + width: 120, }, { title: '告警频率', dataIndex: 'alarmFrequency', + width: 120, }, { title: '重复次数', dataIndex: 'repetitions', + width: 120, }, { title: '频率间隔', dataIndex: 'interval', + width: 120, }, { title: '监测时长', dataIndex: 'monitorFrequency', + width: 120, }, { title: '是否启用', dataIndex: 'enableRules', + width: 140, }, ]; const doWnload = (url: any) => { @@ -103,9 +111,13 @@ export const energyAlarmConfigs = ( }, ], columns: tableKeyMap, + scroll: { x: 1800 }, // rowSelection: null, 选择按钮 columnActions: { title: '操作', + width: 250, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '编辑', diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts index 976230f..ca78c9e 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts @@ -14,6 +14,7 @@ const tableKeyMap = [ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '优先级', @@ -105,8 +106,12 @@ export const equipmentAlarmTableConfig = ( ], columns: tableKeyMap, // rowSelection: null, 选择按钮 + scroll: { x: 1800 }, columnActions: { title: '操作', + width: 250, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '编辑', diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts index 710f779..413d723 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts @@ -12,14 +12,17 @@ const tableKeyMap = [ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '优先级', dataIndex: 'prioritys', + width: 120, }, { title: '告警类型', dataIndex: 'alarmTypeName', + width: 140, }, { title: '告警标题', @@ -28,20 +31,24 @@ const tableKeyMap = [ { title: '错误码', dataIndex: 'errorCode', + width: 120, }, { title: '通知名单', dataIndex: 'notificationList', - width: 150, + width: 220, textEllipsis: true, + textWidth: 150, }, { title: '通知方式', dataIndex: 'notificationMethod', + width: 160, }, { title: '启用通知', dataIndex: 'enableNotifications', + width: 140, }, ]; export const notificationtableConfig = (notificationManagements: any) => { @@ -50,8 +57,12 @@ export const notificationtableConfig = (notificationManagements: any) => { api: notificationManagementApi.getTableList, headerActions: [], columns: tableKeyMap, + scroll: { x: 1800 }, columnActions: { title: '操作', + width: 140, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '联系方式', diff --git a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue index 404781c..1929c58 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue @@ -97,6 +97,7 @@ infoObject.value = {}; visible.value = false; config.value.dataSource = []; + formRef.value.resetFields(); }; const btnClick = () => { formRef.value.validate().then(() => { diff --git a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts index 9984202..a6b0ee1 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts @@ -57,11 +57,14 @@ export const notificationtableConfig = (look: any, status: any) => { title: '告警记录', api: energyAlarmApi.getTableList, headerActions: [{}], - scroll: { x: 2000 }, + scroll: { x: 1800 }, columns: tableKeyMap, // rowSelection: null, 选择按钮 columnActions: { title: '操作', + width: 180, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '详情', diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue index 92a2a7f..3fd7414 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue @@ -98,6 +98,7 @@ visible.value = false; config.value.dataSource = []; logList.value = []; + formRef.value.resetFields(); }; const btnClick = () => { formRef.value.validate().then(() => { diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts index 8da093c..4f1953a 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts @@ -59,11 +59,14 @@ export const notificationtableConfig = (look: any, status: any) => { title: '告警记录', api: equipmentAlarmApi.getTableList, headerActions: [{}], - scroll: { x: 2000 }, + scroll: { x: 1800 }, columns: tableKeyMap, // rowSelection: null, 选择按钮 columnActions: { title: '操作', + width: 180, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '详情', diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts index 3f72552..d81c75e 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts @@ -12,6 +12,7 @@ const tableKeyMap = [ customRender: (text: any) => { return text.index + 1; }, + width: 80, }, { title: '告警编号', @@ -24,10 +25,12 @@ const tableKeyMap = [ { title: '优先级', dataIndex: 'priority', + width: 120, }, { title: '状态', dataIndex: 'alarmLogState', + width: 140, }, { title: '错误码', @@ -53,8 +56,12 @@ export const notificationtableConfig = (look: any, status: any) => { headerActions: [{}], columns: tableKeyMap, // rowSelection: null, 选择按钮 + scroll: { x: 1800 }, columnActions: { title: '操作', + width: 180, + fixed: 'right', + dataIndex: 'tableAction', actions: [ { label: '详情', diff --git a/hx-ai-intelligent/src/view/equipmentControl/electricDoor/index.vue b/hx-ai-intelligent/src/view/equipmentControl/electricDoor/index.vue index 8cae1c6..1e2a307 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/electricDoor/index.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/electricDoor/index.vue @@ -117,10 +117,10 @@ clearInterval(intervalId); }); const tables = ref(null); - const customRow = (record) => { + const customRow = (record: any) => { return { //点击 行 进行查看详情 - onClick: (event) => { + onClick: () => { detailed.value = !detailed.value; infoObject.value = record; tables.value.toggle(record); diff --git a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts new file mode 100644 index 0000000..1f3e5ae --- /dev/null +++ b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts @@ -0,0 +1,152 @@ +import { planToAddApi } from '/@/api/planToAdd'; +import { ref } from 'vue'; +import { http } from '/nerv-lib/util'; +import { getEnum } from '/@/api'; +import { NsMessage } from '/nerv-lib/component'; + +const enumData: any = await getEnum({ params: { enumType: 'CtrlDeviceType' } }); +export const tableConfig = ( + orgId: any, + projectId: any, + mainRef: any, + nsModalFormConfig: any, + modalFormRef: any, +) => { + return ref({ + title: '计划库', + api: planToAddApi.getActivatedPlanListByTree, + params: { orgId, projectId, deviceType: enumData.data[0].value }, + treeConfig: { + defaultExpandAll: true, + header: { + icon: 'name', + title: '执行计划', + }, + params: { projectId, deviceType: enumData.data[0].value }, + dynamicParams: { + id: 'id', + pid: 'pid', + level: 'level', + projectId: 'projectId', + deviceType: 'deviceType', + }, + api: planToAddApi.getActivatedPlanTree, + fieldNames: { + title: 'name', + key: 'id', + pid: 'pid', + level: 'level', + projectId: 'projectId', + deviceType: 'deviceType', + children: 'childList', + }, + formConfig: { + schemas: [ + { + field: 'deviceType', + label: '告警优先级', + component: 'nsSelectApi', + autoSubmit: true, + componentProps: { + api: () => getEnum({ params: { enumType: 'CtrlDeviceType' } }), + immediate: true, + resultField: 'data', + labelField: 'label', + valueField: 'value', + placeholder: '请选择告警优先级', + showSearch: true, + autoSelectFirst: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + }, + }, + ], + }, + }, + rowSelection: null, + columns: [ + { + title: '执行顺序', + dataIndex: 'address', + width: 100, + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '计划类型', + dataIndex: 'planGroupName', + }, + { + title: '计划名称', + dataIndex: 'planName', + }, + { + title: '执行时间', + dataIndex: 'executionTime', + }, + ], + columnActions: { + title: '操作', + width: 200, + fixed: 'right', + dataIndex: 'tableAction', + actions: [ + { + label: '编辑', + name: 'energyAlarmEdit', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + const obj = { ...data }; + nsModalFormConfig.value.title = '编辑'; + setTimeout(() => { + nsModalFormConfig.value.data = { + id: obj.id, + }; + if (obj.startTime) { + nsModalFormConfig.value.data.createTime = obj.startTime + ? [obj.startTime, obj.endTime] + : []; + } + }, 1); + modalFormRef.value?.toggle(); + }, + }, + { + label: '删除', + name: 'energyAlarmDel', + dynamicParams: ['uuid', 'appealType'], + confirm: true, + handle: (data: any) => { + http.post(planToAddApi.updPlan, { id: data.id, isDeleted: 1 }).then((res) => { + if (res.msg === 'success') { + NsMessage.success('操作成功'); + mainRef.value?.nsTableRef.reload(); + } else { + NsMessage.error(res.msg); + } + }); + mainRef.value?.nsTableRef.reload(); + }, + }, + ], + }, + formConfig: { + schemas: [ + { + field: 'planName', + label: '计划标题', + component: 'NsInput', + componentProps: { + allowClear: true, + placeholder: '请输入计划名称关键字', + }, + }, + ], + params: {}, + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'uuid', + }); +}; diff --git a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue index c17f2d0..0809694 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue @@ -9,17 +9,15 @@