From c9ff2979fbf0b648240a22014e0d7c404f6899eb Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期四, 07 十一月 2024 17:40:42 +0800 Subject: [PATCH] pointChart bug 修复 --- 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