Browse Source

fix:设备台账补充筛选项去重逻辑

deploy-dev
xuziqiang 4 months ago
parent
commit
58300c60e2
  1. 4
      hx-ai-intelligent/src/view/equipmentManage/group/index.vue
  2. 28
      hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts

4
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;

28
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;
},

Loading…
Cancel
Save