From 0681836c0249f7d090e2d89c8d62734c9a81deb1 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 10:22:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/ledger/config.ts | 52 +++++++++++++++------- lib/saas/view/system/login.vue | 2 +- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts index d7954ff..cd2d05b 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts @@ -138,9 +138,21 @@ export const tableConfig = (orgId) => { { field: 'deviceName', label: '设备名称', - component: 'NsInput', + component: 'NsSelectApi', 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) => { const targetOption = selectedOptions[selectedOptions.length - 1]; 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) => { return { label: item, value: item, children: [], isLeaf: false }; }); @@ -175,12 +187,14 @@ export const tableConfig = (orgId) => { const value = targetOption?.value; if (targetOption) { targetOption.loading = true; - http.post(device.dropArea, { device1Area: value, orgId }).then((res) => { - targetOption.loading = false; - targetOption.children = res.data?.map((item) => { - return { label: item, value: item, children: [], isLeaf: true }; + http + .post(device.dropArea, { device1Area: value, orgId, filterField: 'DEVICE_AREA' }) + .then((res) => { + targetOption.loading = false; + targetOption.children = res.data?.map((item) => { + return { label: item, value: item, children: [], isLeaf: true }; + }); }); - }); } }, }, @@ -188,15 +202,21 @@ export const tableConfig = (orgId) => { { field: 'manufacturer', label: '设备厂商', - component: 'NsInput', + component: 'NsSelectApi', componentProps: { - placeholder: '请输入设备厂商', - options: [ - { - label: '全部', - value: '', - }, - ], + placeholder: '请选择设备厂商', + api: device.dropArea, + resultField: 'data', + params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, + 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, }, }, { diff --git a/lib/saas/view/system/login.vue b/lib/saas/view/system/login.vue index 8c59eab..187327a 100644 --- a/lib/saas/view/system/login.vue +++ b/lib/saas/view/system/login.vue @@ -129,7 +129,7 @@ accountNo: userName.value.trim(), password: password.value.trim(), }); - validator(null, value.code) + validator(null, value?.code) .then(() => { // 记住密码 rememberFunc(data);