From 4fc2af244447702f5f7040befb136aa36058d0c0 Mon Sep 17 00:00:00 2001 From: zhongwenkai <3478244299@qq.com> Date: Wed, 8 Jul 2026 16:42:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E4=BA=A7=E7=BA=BF=E7=BC=96=E7=A0=81?= =?UTF-8?q?-=E5=90=8D=E7=A7=B0=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E6=8B=A9=20&=20=E5=8D=95=E8=AE=BE=E5=A4=87=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E5=88=B7=E6=96=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/components/DeviceAttributeList.vue | 21 +++++++++- src/views/iot/deviceattributetype/index.vue | 1 + src/views/iot/historyData/index.vue | 38 +++++++++++++++--- .../SingleDeviceMonitorDialog.vue | 12 +++++- src/views/iot/realTimeMonitoring/index.vue | 39 +++++++++++++++---- 5 files changed, 96 insertions(+), 15 deletions(-) diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue index bc29675f..486f439f 100644 --- a/src/views/iot/device/components/DeviceAttributeList.vue +++ b/src/views/iot/device/components/DeviceAttributeList.vue @@ -82,7 +82,7 @@ @@ -207,6 +208,17 @@ const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +const updatePlanTableMaxHeight = async () => { + await nextTick() + const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0 + const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72 + const pageBottomGap = 56 + const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap + planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight))) +} const props = defineProps<{ deviceId?: number // 设备id(主表的关联字段) @@ -279,6 +291,7 @@ async function getList() { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -380,5 +393,11 @@ onMounted(async () => { } catch { typeList.value = [] } + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/iot/deviceattributetype/index.vue b/src/views/iot/deviceattributetype/index.vue index ec626fff..1a8dbb9c 100644 --- a/src/views/iot/deviceattributetype/index.vue +++ b/src/views/iot/deviceattributetype/index.vue @@ -133,6 +133,7 @@ - - @@ -130,6 +136,7 @@ ([]) +const lineTreeLoading = ref(false) + +/** 获取产线树数据 */ +const fetchLineTree = async () => { + lineTreeLoading.value = true + try { + const res = await DeviceLineApi.getDeviceLineTree() + lineTreeData.value = Array.isArray(res) ? res : (res?.data || res?.list || []) + } catch (e) { + console.error('获取产线树失败', e) + } finally { + lineTreeLoading.value = false + } +} const selectedIds = ref<(string | number)[]>([]) const handleSelectionChange = (rows: LineDeviceVO[]) => { @@ -269,6 +292,8 @@ const handleQuery = () => { const resetQuery = () => { queryFormRef.value?.resetFields() + queryParams.lineNode = undefined + queryParams.lineName = undefined handleQuery() } @@ -313,6 +338,7 @@ const handleSingleAnalyseView = (row: LineDeviceVO) => { onMounted(() => { getList() + fetchLineTree() updatePlanTableMaxHeight() window.addEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue b/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue index d1db069a..92b06b84 100644 --- a/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue +++ b/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue @@ -3,7 +3,10 @@ {{ t('DataCollection.RealTimeMonitoring.dialogDeviceNameLabel') }}{{ deviceName || '-' }} - {{ t('DataCollection.RealTimeMonitoring.dialogCollectionTimeLabel') }}{{ displayTime }} + + 刷新 + {{ t('DataCollection.RealTimeMonitoring.dialogCollectionTimeLabel') }}{{ displayTime }} + @@ -53,6 +56,7 @@ v-for="col in section.columns" :key="col.prop" :prop="col.prop" :label="col.labe