From 4526da936e5437236c40a1812e4084c148fbf3f1 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Fri, 12 Jul 2024 17:39:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/group/config.ts | 7 +- .../src/view/equipmentManage/group/edit.vue | 5 +- .../src/view/equipmentManage/group/editCal.vue | 5 +- .../src/view/equipmentManage/group/mock.json | 121 --------------------- 4 files changed, 8 insertions(+), 130 deletions(-) delete mode 100644 hx-ai-intelligent/src/view/equipmentManage/group/mock.json diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index 4b9fff1..a009cd3 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -21,6 +21,7 @@ const tableCalKeyMap = [ { title: '设备编号', dataIndex: 'deviceNum', + textNumber: 10, }, { textNumber: 10, @@ -35,7 +36,10 @@ const tableCalKeyMap = [ { textNumber: 10, title: '设备状态', - dataIndex: 'position', + dataIndex: 'deviceStatus', + customRender: ({ value }) => { + return value === '0' ? '启用' : '停用'; + }, }, ]; const tableKeyMap = [ @@ -62,7 +66,6 @@ const doWnload = (url) => { a.click(); }; -const mockData = ref(data.listData); export const formSchema = [ { field: 'isCreate', diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue index 78cd18b..9ce1621 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue @@ -49,12 +49,9 @@ const toggle = () => { visible.value = !visible.value; clearData(); + visible.value && getData(currentId.value); }; - onMounted(() => { - getData(currentId.value); - }); - const filterOption = (inputValue: string, option: any) => { return option?.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1; }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index 9301f50..9a3e31d 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -49,11 +49,10 @@ const toggle = () => { visible.value = !visible.value; clearData(); + visible.value && getData(currentId.value); }; - onMounted(() => { - getData(currentId.value); - }); + onMounted(() => {}); const filterOption = (inputValue: string, option: any) => { return option?.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/mock.json b/hx-ai-intelligent/src/view/equipmentManage/group/mock.json deleted file mode 100644 index 05811ba..0000000 --- a/hx-ai-intelligent/src/view/equipmentManage/group/mock.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "data":[ - { - "title": "1号楼", - "key": "A001", - "children": [ - { - "title": "1号楼空调用电", - "key": "A002" - }, - { - "title": "1号楼照明用电", - "key": "A003" - } - ] - }, - { - "title": "2号楼(A005)", - "key": "A004", - "children": [ - { - "title": "2号楼空调用电(A007)", - "key": "A006" - } - ] - }, - { - "title": "3号楼", - "key": "A008", - "children": [ - { - "title": "3号楼空调用电", - "key": "A009" - }, - { - "title": "3号楼照明用电", - "key": "A010" - } - ] - } - ], - "insertData":[ - { - "title": "北京公司", - "key": "A001" - }, - { - "title": "广州公司", - "key": "A002" - }, - { - "title": "南京公司", - "key": "A004" - }, - { - "title": "上海公司", - "key": "A008", - "children": [ - { - "title": "上海长宁", - "key": "A009" - }, - { - "title": "上海徐汇", - "key": "A010" - }, - { - "title": "上海浦东", - "key": "A011" - } - ] - } -], - "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 commodo", - "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 - } - ] - -} \ No newline at end of file