From 58300c60e26047b61ea2b4d4069766e1a6d21c64 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 16:58:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=AE=BE=E5=A4=87=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E8=A1=A5=E5=85=85=E7=AD=9B=E9=80=89=E9=A1=B9=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/group/index.vue | 4 +++- .../src/view/equipmentManage/ledger/config.ts | 28 +++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 8ddb9c9..7eb9cd3 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -170,7 +170,9 @@ { title: '删除', key: 'deleteNode', func: (data) => deleteNode(data) }, ]; const handleSelect = (key, record) => { - console.log(record); + //清除选中行数据 + tableRef.value?.nsTableRef.clearCheck(); + tableCalRef.value?.nsTableRef.clearCheck(); const { node: { pointType, id, energyType }, } = record; diff --git a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts index cd2d05b..6ceee63 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts @@ -141,11 +141,19 @@ export const tableConfig = (orgId) => { component: 'NsSelectApi', componentProps: { placeholder: '请选择设备名称', - api: device.dropArea, + api: (params) => { + return http.post(device.dropArea, params).then((res) => { + const result = res.data?.reduce((pre, cur) => { + !pre.includes(cur.deviceName) && pre.push(cur.deviceName); + return pre; + }, []); + return { data: result }; + }); + }, resultField: 'data', params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, - labelField: 'deviceName', - valueField: 'deviceName', + // labelField: 'deviceName', + // valueField: 'deviceName', filterOption: (input: string, option: any) => { return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; }, @@ -205,11 +213,19 @@ export const tableConfig = (orgId) => { component: 'NsSelectApi', componentProps: { placeholder: '请选择设备厂商', - api: device.dropArea, + api: (params) => { + return http.post(device.dropArea, params).then((res) => { + const result = res.data?.reduce((pre, cur) => { + !pre.includes(cur.manufacturer) && pre.push(cur.manufacturer); + return pre; + }, []); + return { data: result }; + }); + }, resultField: 'data', params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, - labelField: 'manufacturer', - valueField: 'manufacturer', + // labelField: 'manufacturer', + // valueField: 'manufacturer', filterOption: (input: string, option: any) => { return option.manufacturer.toLowerCase().indexOf(input.toLowerCase()) >= 0; },