Browse Source

fix: 设备台账调整搜索

deploy-dev
xuziqiang 2 months ago
parent
commit
0681836c02
  1. 44
      hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts
  2. 2
      lib/saas/view/system/login.vue

44
hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts

@ -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,
}, },
}, },
{ {

2
lib/saas/view/system/login.vue

@ -129,7 +129,7 @@
accountNo: userName.value.trim(), accountNo: userName.value.trim(),
password: password.value.trim(), password: password.value.trim(),
}); });
validator(null, value.code) validator(null, value?.code)
.then(() => { .then(() => {
// //
rememberFunc(data); rememberFunc(data);

Loading…
Cancel
Save