|
@ -138,9 +138,21 @@ export const tableConfig = (orgId) => { |
|
|
{ |
|
|
{ |
|
|
field: 'deviceName', |
|
|
field: 'deviceName', |
|
|
label: '设备名称', |
|
|
label: '设备名称', |
|
|
component: 'NsInput', |
|
|
component: 'NsSelectApi', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
placeholder: '请输入设备名称', |
|
|
placeholder: '请选择设备名称', |
|
|
|
|
|
api: device.dropArea, |
|
|
|
|
|
resultField: 'data', |
|
|
|
|
|
params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, |
|
|
|
|
|
labelField: 'deviceName', |
|
|
|
|
|
valueField: 'deviceName', |
|
|
|
|
|
filterOption: (input: string, option: any) => { |
|
|
|
|
|
return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; |
|
|
|
|
|
}, |
|
|
|
|
|
showSearch: true, |
|
|
|
|
|
immediate: true, |
|
|
|
|
|
dropdownReload: true, |
|
|
|
|
|
allowClear: true, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -166,7 +178,7 @@ export const tableConfig = (orgId) => { |
|
|
loadData: (selectedOptions, options) => { |
|
|
loadData: (selectedOptions, options) => { |
|
|
const targetOption = selectedOptions[selectedOptions.length - 1]; |
|
|
const targetOption = selectedOptions[selectedOptions.length - 1]; |
|
|
if (!selectedOptions.length) { |
|
|
if (!selectedOptions.length) { |
|
|
http.post(device.dropArea, { orgId }).then((res) => { |
|
|
http.post(device.dropArea, { orgId, filterField: 'DEVICE_AREA' }).then((res) => { |
|
|
options.value = res.data?.map((item) => { |
|
|
options.value = res.data?.map((item) => { |
|
|
return { label: item, value: item, children: [], isLeaf: false }; |
|
|
return { label: item, value: item, children: [], isLeaf: false }; |
|
|
}); |
|
|
}); |
|
@ -175,7 +187,9 @@ export const tableConfig = (orgId) => { |
|
|
const value = targetOption?.value; |
|
|
const value = targetOption?.value; |
|
|
if (targetOption) { |
|
|
if (targetOption) { |
|
|
targetOption.loading = true; |
|
|
targetOption.loading = true; |
|
|
http.post(device.dropArea, { device1Area: value, orgId }).then((res) => { |
|
|
http |
|
|
|
|
|
.post(device.dropArea, { device1Area: value, orgId, filterField: 'DEVICE_AREA' }) |
|
|
|
|
|
.then((res) => { |
|
|
targetOption.loading = false; |
|
|
targetOption.loading = false; |
|
|
targetOption.children = res.data?.map((item) => { |
|
|
targetOption.children = res.data?.map((item) => { |
|
|
return { label: item, value: item, children: [], isLeaf: true }; |
|
|
return { label: item, value: item, children: [], isLeaf: true }; |
|
@ -188,15 +202,21 @@ export const tableConfig = (orgId) => { |
|
|
{ |
|
|
{ |
|
|
field: 'manufacturer', |
|
|
field: 'manufacturer', |
|
|
label: '设备厂商', |
|
|
label: '设备厂商', |
|
|
component: 'NsInput', |
|
|
component: 'NsSelectApi', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
placeholder: '请输入设备厂商', |
|
|
placeholder: '请选择设备厂商', |
|
|
options: [ |
|
|
api: device.dropArea, |
|
|
{ |
|
|
resultField: 'data', |
|
|
label: '全部', |
|
|
params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, |
|
|
value: '', |
|
|
labelField: 'manufacturer', |
|
|
}, |
|
|
valueField: 'manufacturer', |
|
|
], |
|
|
filterOption: (input: string, option: any) => { |
|
|
|
|
|
return option.manufacturer.toLowerCase().indexOf(input.toLowerCase()) >= 0; |
|
|
|
|
|
}, |
|
|
|
|
|
showSearch: true, |
|
|
|
|
|
immediate: true, |
|
|
|
|
|
dropdownReload: true, |
|
|
|
|
|
allowClear: true, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|