From 7102032c702da45e3d38388cfe6f51e87258a540 Mon Sep 17 00:00:00 2001 From: hwj Date: Mon, 5 Jan 2026 11:55:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor=EF=BC=9A=E6=95=B0=E6=8D=AE=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=9B=91=E6=8E=A7-=E5=BC=B9=E6=A1=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SingleDeviceMonitorDialog.vue | 283 +++++++++--------- src/views/iot/realTimeMonitoring/index.vue | 18 +- 2 files changed, 143 insertions(+), 158 deletions(-) diff --git a/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue b/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue index a9f97a4f..040fd7d2 100644 --- a/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue +++ b/src/views/iot/realTimeMonitoring/SingleDeviceMonitorDialog.vue @@ -1,73 +1,59 @@ -watch( - () => selectedGroupKey.value, - () => { - pageNo.value = 1 - handlePagination() - } -) + diff --git a/src/views/iot/realTimeMonitoring/index.vue b/src/views/iot/realTimeMonitoring/index.vue index a85de6ae..f5accc16 100644 --- a/src/views/iot/realTimeMonitoring/index.vue +++ b/src/views/iot/realTimeMonitoring/index.vue @@ -59,6 +59,7 @@ v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @ v-model="monitorDialogVisible" :device-id="monitorDeviceId" :device-name="monitorDeviceName" + :collection-time="monitorCollectionTime" /> @@ -91,6 +92,7 @@ const queryFormRef = ref() // 搜索的表单 const monitorDialogVisible = ref(false) const monitorDeviceId = ref() const monitorDeviceName = ref() +const monitorCollectionTime = ref() const buildQueryParams = (): Parameters[0] => { const params: Parameters[0] = { @@ -137,25 +139,11 @@ const handleSingleMonitor = (row: LineDeviceVO) => { } monitorDeviceId.value = deviceId monitorDeviceName.value = row?.deviceName ?? '' + monitorCollectionTime.value = row?.collectionTime monitorDialogVisible.value = true } -let timer: any = null - onMounted(() => { getList() - timer = setInterval(async () => { - try { - const data = await DeviceApi.getLineDevicePage(buildQueryParams()) - list.value = data.list - total.value = data.total - } catch { } - }, 5000) -}) - -onUnmounted(() => { - if (timer) { - clearInterval(timer) - } })