From 050ddd6c3d08bd069ccad1df0d97a8e7c161ceb8 Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期四, 07 十一月 2024 11:37:02 +0800 Subject: [PATCH] tag当前值 --- src/views/data/channel/http/api/tag/index.vue | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/views/data/channel/http/api/tag/index.vue b/src/views/data/channel/http/api/tag/index.vue index 82cf55a..5f16d44 100644 --- a/src/views/data/channel/http/api/tag/index.vue +++ b/src/views/data/channel/http/api/tag/index.vue @@ -163,6 +163,7 @@ import {ref} from "vue"; import {onBeforeUnmount, onMounted} from "vue"; import TagImportForm from '../../../common/tag/TagImportForm.vue' + import * as OpcUaTagApi from "@/api/data/channel/opcua/tag"; defineOptions({name: 'HttpTag'}) @@ -275,4 +276,24 @@ exportLoading.value = false } } + + let intervalId; + + onMounted(async () => { + // 创建定时器 + intervalId = setInterval(async () => { + if(queryParams.currentValue){ + const page = await HttpTagApi.getHttpTagPage(queryParams) + list.value = page.list + total.value = page.total + } + }, 10000); + }); + + // 在组件卸载时清除定时器 + onBeforeUnmount(() => { + if (intervalId) { + clearInterval(intervalId); + } + }); </script> -- Gitblit v1.9.3