From 5f453af4d2e9900d5a8e32f550488bcc1426be03 Mon Sep 17 00:00:00 2001 From: hwj Date: Wed, 1 Jul 2026 10:11:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?style=EF=BC=9A=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B/=E7=89=A9=E8=81=94=E8=AE=BE=E5=A4=87-=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0deviceModelId/devi?= =?UTF-8?q?ceId=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/device/components/DeviceAttributeList.vue | 12 ++++++++++-- .../devicemodel/components/ModelAttributeList.vue | 14 ++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue index a8a7b9ba..bc29675f 100644 --- a/src/views/iot/device/components/DeviceAttributeList.vue +++ b/src/views/iot/device/components/DeviceAttributeList.vue @@ -220,7 +220,7 @@ const total = ref(0) // 列表的总页数 const queryParams = reactive({ pageNo: 1, pageSize: 10, - deviceId: undefined as unknown, + deviceId: undefined as number | undefined, attributeCode: undefined, attributeName: undefined, attributeType: undefined @@ -263,6 +263,8 @@ watch( return } queryParams.deviceId = val + selectedIds.value = [] + tableRef.value?.clearSelection?.() handleQuery() }, { immediate: true, deep: true } @@ -350,10 +352,16 @@ const handleImport = () => { /** 导出按钮操作 */ const handleExport = async () => { + if (!props.deviceId) { + message.error(t('DataCollection.Device.messageSelectDeviceRequired')) + return + } try { await message.exportConfirm() exportLoading.value = true - const params: any = {} + const params: any = { + deviceId: props.deviceId + } if (selectedIds.value.length) { params.ids = selectedIds.value.join(',') } diff --git a/src/views/iot/devicemodel/components/ModelAttributeList.vue b/src/views/iot/devicemodel/components/ModelAttributeList.vue index c5d049cf..24505aed 100644 --- a/src/views/iot/devicemodel/components/ModelAttributeList.vue +++ b/src/views/iot/devicemodel/components/ModelAttributeList.vue @@ -175,7 +175,7 @@ const queryParams = reactive({ dataUnit: undefined, ratio: undefined, remark: undefined, - deviceModelId: undefined, + deviceModelId: undefined as number | undefined, createTime: [], }) const queryFormRef = ref() // 搜索的表单 @@ -212,6 +212,9 @@ watch( return } queryParams.id = val + queryParams.deviceModelId = val + selectedIds.value = [] + tableRef.value?.clearSelection?.() handleQuery() }, { immediate: true, deep: true } @@ -298,8 +301,8 @@ const handleBatchDelete = async () => { /** 导出按钮操作 */ const handleExport = async () => { - if (!selectedIds.value.length) { - message.error('请选择需要导出的数据') + if (!props.id) { + message.error('请选择一个采集设备模型') return } try { @@ -307,7 +310,10 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await DeviceModelAttributeApi.exportDeviceModelAttribute({ ids: selectedIds.value.join(',') }) + const data = await DeviceModelAttributeApi.exportDeviceModelAttribute({ + deviceModelId: props.id, + ids: selectedIds.value.length ? selectedIds.value.join(',') : undefined, + }) download.excel(data, '采集设备模型-点位管理.xls') } catch { } finally { From 7620c516b1467a015a4faef61eae06d08479ee20 Mon Sep 17 00:00:00 2001 From: hwj Date: Wed, 1 Jul 2026 10:19:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?style=EF=BC=9A=E7=89=A9=E8=81=94=E8=AE=BE?= =?UTF-8?q?=E5=A4=87-=E5=90=AF=E7=94=A8switch=E6=8C=89=E9=92=AE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/device/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index c2d5bab0..9e16f431 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -148,6 +148,7 @@ @@ -272,6 +273,7 @@