From 4c7918b9533a079190856c1780391527e1ae636e Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 11 十一月 2024 13:40:04 +0800 Subject: [PATCH] 预测项粒度 --- 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