From e2150515ac0f387eb26843af0c65cfe71f25d985 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期五, 13 六月 2025 14:52:37 +0800 Subject: [PATCH] fix:添加检测数据的定时器功能 --- src/views/screen/flow/graphic/index.vue | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/src/views/screen/flow/graphic/index.vue b/src/views/screen/flow/graphic/index.vue index 228ed16..59a7f1f 100644 --- a/src/views/screen/flow/graphic/index.vue +++ b/src/views/screen/flow/graphic/index.vue @@ -1,5 +1,5 @@ <script setup> -import {onMounted, ref} from "vue"; +import {onMounted, onUnmounted, ref} from "vue"; import {getUserType} from '@/utils/auth.js' import {getFlowPointList} from '@/api/screen/index' import {getFlowVideoData} from '@/api/screen/graphic/index.js' @@ -16,6 +16,7 @@ const playerData = ref([]) const showFullScreen = ref(false) const fullIndex = ref() +let timer = null // 全屏弹窗 const handleFullScreen = (index) => { @@ -67,6 +68,14 @@ getFlowVideoData({pointId: id, pointName: searchVal.value}).then(async res => { playerData.value = res.data }) + + if(timer) clearTimeout(timer) + + timer = setInterval(() => { + getFlowVideoData({pointId: id, pointName: searchVal.value}).then(async res => { + playerData.value = res.data + }) + }, 10000) } @@ -74,6 +83,10 @@ getMoitorList() getPlayerList(route.params.id || '') }) + +onUnmounted(() => { + if(timer) clearTimeout(timer) +}) </script> <template> -- Gitblit v1.9.3