From 4c2989239d91e0f317324ab33ccd00d667a239af Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 22 Jul 2024 10:34:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E8=AE=BE=E5=A4=87=E5=91=8A=E8=AD=A6=20?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/alarmManagement/equipmentAlarm.ts | 4 + hx-ai-intelligent/src/icon/status-0.svg | 6 -- hx-ai-intelligent/src/icon/status-1.svg | 4 +- hx-ai-intelligent/src/icon/status-2.svg | 6 +- hx-ai-intelligent/src/icon/status-3.svg | 4 +- hx-ai-intelligent/src/icon/status-4.svg | 4 +- hx-ai-intelligent/src/icon/status-5.svg | 6 ++ .../view/alarmManagement/alarmOverview/index.vue | 4 +- .../energyAlarm/configureEnergyAlarms.vue | 24 ------ .../equipmentAlarm/configureDeviceAlarms.vue | 1 + .../equipmentAlarm/editConfigureDeviceAlarm.vue | 9 ++- .../alarmSettings/notificationManagement/index.vue | 9 ++- .../notificationManagement/linkPeople/index.vue | 63 ++++++++------- .../view/alarmManagement/equipmentAlarm/index.vue | 15 +++- .../view/alarmManagement/equipmentAlarm/look.vue | 50 +++++++++--- .../view/alarmManagement/equipmentAlarm/status.vue | 94 ++++++++++------------ .../alarmManagement/equipmentAlarm/ts/config.ts | 56 +++++++------ .../view/alarmManagement/gatewayAlarm/status.vue | 39 ++++----- 18 files changed, 218 insertions(+), 180 deletions(-) create mode 100644 hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts delete mode 100644 hx-ai-intelligent/src/icon/status-0.svg create mode 100644 hx-ai-intelligent/src/icon/status-5.svg 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/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/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/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..d3e369b 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
+ +
+ + From 69727fa6134dfa6b80db495d993b1af1709cfdfc Mon Sep 17 00:00:00 2001 From: fks-yangshouda Date: Mon, 22 Jul 2024 11:35:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/view/dict/index.vue | 92 ++++++++++++++++++------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/hx-ai-intelligent/src/view/dict/index.vue b/hx-ai-intelligent/src/view/dict/index.vue index 1a85aac..57d69dc 100644 --- a/hx-ai-intelligent/src/view/dict/index.vue +++ b/hx-ai-intelligent/src/view/dict/index.vue @@ -53,7 +53,7 @@ import { ref, onMounted, defineOptions } from 'vue'; import { http } from '/nerv-lib/util/http'; - import type { Rule } from 'ant-design-vue/es/form'; + import type { FormInstance, Rule } from 'ant-design-vue/es/form'; import { tableColumns } from './config'; import { dict } from '/@/api/dict'; import { NsMessage } from '/nerv-lib/component'; @@ -140,6 +140,7 @@ const data = ref([]); const updateInfo = ref({}); + const formRef = ref(null); const queryParams = ref({ grp: '', @@ -176,9 +177,9 @@ }; const visible = ref(false); - const formState = ref({ - orgId: orgId.value, - }); + // const formState = ref({ + // orgId: orgId.value, + // }); const labelCol = { span: 5 }; const wrapperCol = { span: 19 }; // 定义form表单的必填 @@ -190,25 +191,25 @@ seq: [{ required: true, message: '请输入排序数字', trigger: 'change' }], showed: [{ required: true, message: '请输入是否展示', trigger: 'change' }], }; - interface FormState { - energyType: string; - unit: string; - collectionNode: string; - emissionType: string | undefined; - isComputeCarbon: string; - janFlag: string; - febFlag: string; - marFlag: string; - aprFlag: string; - mayFlag: string; - junFlag: string; - julFlag: string; - augFlag: string; - sepFlag: string; - octFlag: string; - novFlag: string; - decFlag: string; - } + // interface FormState { + // energyType: string; + // unit: string; + // collectionNode: string; + // emissionType: string | undefined; + // isComputeCarbon: string; + // janFlag: string; + // febFlag: string; + // marFlag: string; + // aprFlag: string; + // mayFlag: string; + // junFlag: string; + // julFlag: string; + // augFlag: string; + // sepFlag: string; + // octFlag: string; + // novFlag: string; + // decFlag: string; + // } // 关闭新增抽屉 const onClose = () => { visible.value = false; @@ -226,29 +227,42 @@ // 打开新增页 const addDict = () => { updateInfo.value = {}; + updateInfo.value.showed = 1; visible.value = true; // todo 打开编辑页 }; // 点击确定提交 const onSubmit = () => { - if (updateInfo.value.id) { - fetch(dict.updateDictionary, updateInfo.value).then((res) => { - if (res.retcode == 0) { - visible.value = false; - NsMessage.success('保存成功'); - getTableList(); - } - }); - } else { - fetch(dict.createDictionary, updateInfo.value).then((res) => { - if (res.retcode == 0) { - visible.value = false; - NsMessage.success('保存成功'); - getTableList(); + debugger; + formRef.value + ?.validate() + .then((valid) => { + if (valid) { + if (updateInfo.value.id) { + fetch(dict.updateDictionary, updateInfo.value).then((res) => { + if (res.retcode == 0) { + visible.value = false; + NsMessage.success('保存成功'); + getTableList(); + } + }); + } else { + fetch(dict.createDictionary, updateInfo.value).then((res) => { + if (res.retcode == 0) { + visible.value = false; + NsMessage.success('保存成功'); + getTableList(); + } + }); + } + } else { + console.log('表单验证失败'); } + }) + .catch((error) => { + console.log('表单验证失败', error); }); - } }; // 删除字典 From b82b97ebb14f839c9ca374874e211e6e7e4a1609 Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 22 Jul 2024 11:38:36 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=20=20=E8=83=BD=E6=BA=90=E5=91=8A=E8=AD=A6=20?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=20=E6=B7=BB=E5=8A=A0=E4=B9=8B=E5=90=8E=20?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=80=9A=E7=9F=A5=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/alarmManagement/alarmSettings/index.vue | 2 ++ .../alarmSettings/ts/energyAlarmConfig.ts | 4 +-- .../alarmSettings/ts/equipmentAlarmConfig.ts | 4 +-- .../view/alarmManagement/equipmentAlarm/status.vue | 39 ++++++++++++---------- 4 files changed, 25 insertions(+), 24 deletions(-) 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/ts/energyAlarmConfig.ts b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts index 86059b8..d1e199d 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts @@ -117,9 +117,7 @@ export const energyAlarmConfigs = ( if (obj.monitorFrequency) { obj.monitorFrequency = data.monitorFrequency.value; } - if (obj.createWorkOrder) { - obj.createWorkOrder = data.createWorkOrder + ''; - } + obj.createWorkOrder = obj.createWorkOrder + ''; if (obj.alarmFrequency !== 2) { obj.repetitions = null; obj.intervalDuration = null; 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 2aba285..656c80b 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts @@ -114,9 +114,7 @@ export const equipmentAlarmTableConfig = ( if (obj.intervalDurationUnit) { obj.intervalDurationUnit = data.intervalDurationUnit.value; } - if (obj.createWorkOrder) { - obj.createWorkOrder = data.createWorkOrder + ''; - } + obj.createWorkOrder = obj.createWorkOrder + ''; if (obj.alarmFrequency !== 2) { obj.repetitions = null; obj.intervalDuration = null; diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue index d3e369b..5c4755a 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue @@ -63,14 +63,14 @@ const visible = ref(false); const showEdit = ref(true); const infoObject = ref({}); - const data = ref({}); + const equipmentAlarm = ref({}); const statusOptions = ref(); const logList = ref([ - { name: '李四', status: '3', time: '2024-03-10 10:00:00', desc: '完成' }, - { name: '王五', status: '5', time: '2024-03-10 10:00:00' }, - { name: '王五', status: '4', time: '2024-03-10 10:00:00' }, - { name: '王五', status: '2', time: '2024-03-10 10:00:00', desc: '创建工单' }, - { name: '赵六', status: '1', time: '2024-03-10 10:00:00' }, + { name: '李四', status: 3, time: '2024-03-10 10:00:00', desc: '完成' }, + { name: '王五', status: 5, time: '2024-03-10 10:00:00' }, + { name: '王五', status: 4, time: '2024-03-10 10:00:00' }, + { name: '王五', status: 2, time: '2024-03-10 10:00:00', desc: '创建工单' }, + { name: '赵六', status: 1, time: '2024-03-10 10:00:00' }, ]); const config = ref({ size: logList.value.length, @@ -81,25 +81,28 @@ }; const btnClick = () => { NsMessage.success('操作成功'); + delete infoObject.value.time; + console.log(infoObject.value, equipmentAlarm.value, '操作'); console.log('btnClick'); }; const toggle = (data) => { - data.value = data; + console.log(data, '数据'); + equipmentAlarm.value = data; infoObject.value = { ...logList.value[0] }; - if (data.value.createWorkOrder === 1) { + if (equipmentAlarm.value.createWorkOrder === 1) { statusOptions.value = [ - { value: '1', label: '待处理' }, - { value: '2', label: '处理中' }, - { value: '3', label: '已完成' }, - { value: '4', label: '超时' }, - { value: '5', label: '已关闭' }, + { value: 1, label: '待处理' }, + { value: 2, label: '处理中' }, + { value: 3, label: '已完成' }, + { value: 4, label: '超时' }, + { value: 5, label: '已关闭' }, ]; } else { statusOptions.value = [ - { value: '1', label: '待处理' }, - { value: '2', label: '处理中' }, - { value: '3', label: '已完成' }, - { value: '5', label: '已关闭' }, + { value: 1, label: '待处理' }, + { value: 2, label: '处理中' }, + { value: 3, label: '已完成' }, + { value: 5, label: '已关闭' }, ]; } let statusMap = { @@ -126,7 +129,7 @@ return { infoObject, showEdit, - data, + equipmentAlarm, statusOptions, btnClick, visible,