From c33670251d19a29ef02f7cda1db11091c168d731 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Wed, 20 May 2026 10:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AD=90=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E8=AE=BE=E5=A4=87=E5=9C=B0=E5=9D=80=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=AA=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/TreeModelDeviceSelect.vue | 18 +++++++++++++++++- .../TreeModelDeviceSelect.vue | 18 +++++++++++++++++- .../deviceData/dynamicColumns.ts | 5 ++--- .../iotdbdatamanagement/deviceData/index.vue | 14 +++++++------- .../iotdbdatamanagement/deviceData/schema.ts | 5 ----- 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/apps/web-antd/src/views/components/TreeModelDeviceSelect.vue b/apps/web-antd/src/views/components/TreeModelDeviceSelect.vue index 4d43b96..72b3355 100644 --- a/apps/web-antd/src/views/components/TreeModelDeviceSelect.vue +++ b/apps/web-antd/src/views/components/TreeModelDeviceSelect.vue @@ -35,9 +35,11 @@ const options = ref([]); const query = ref({ pageIndex: 1, pageSize: 10, + deviceAddress: '', // 搜索关键词 }); const total = ref(0); const loading = ref(false); +const searchInput = ref(''); // 最大页码 const maxPage = computed(() => { @@ -60,7 +62,8 @@ const fetchData = async () => { body: { pageIndex: query.value.pageIndex, pageSize: query.value.pageSize, - IoTDataType: props.ioTDataType, + ioTDataType: props.ioTDataType, + deviceAddress: query.value.deviceAddress || undefined, }, }); @@ -79,6 +82,15 @@ const fetchData = async () => { } }; +/** + * 处理搜索输入 + */ +const handleSearch = useDebounceFn((value: string) => { + query.value.deviceAddress = value; + query.value.pageIndex = 1; // 搜索时重置到第一页 + fetchData(); +}, 300); + /** * 上下页 * @param type 1: 下一页, 0: 上一页 @@ -100,6 +112,8 @@ watch( () => props.ioTDataType, (newVal) => { query.value.pageIndex = 1; + query.value.deviceAddress = ''; // 重置搜索关键词 + searchInput.value = ''; if (newVal) { fetchData(); } else { @@ -146,7 +160,9 @@ defineExpose({ :disabled="disabled || !ioTDataType" :allow-clear="allowClear" :loading="loading" + :search-value="searchInput" @change="handleValueChange" + @search="handleSearch" >