From 761c9e7f73ae18ce53d925f99bab7766c5c5876e Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 25 Sep 2025 10:53:13 +0800
Subject: [PATCH] feat: 全局ws
---
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
index 8749468..82b8a58 100644
--- a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -119,7 +119,7 @@
import CancelTaskDialog from '../CancelTaskDialog.vue'
import { useStore } from 'vuex'
import { cloneDeep } from 'lodash'
-import { inject, onBeforeUnmount } from 'vue';
+import { inject, onBeforeUnmount, watch } from 'vue';
import ElTooltipCopy from '@/components/ElTooltipCopy.vue';
const store = useStore()
const singleUavHome = computed(() => store.state.home.singleUavHome)
@@ -264,14 +264,14 @@
const changeKey = inject('changeKey')
-// 轮询查询是否刷新
-const polling = setInterval(async () => {
- const res = await statusChangedApi()
- if (res.data.data.DEVICE_REFRESH || res.data.data.JOB_REFRESH) {
- getJobList()
- changeKey.value++
- }
-}, 4000)
+const jobUpdateKey = computed(() => store.state.common.jobUpdateKey)
+const deviceUpdateKey = computed(() => store.state.common.deviceUpdateKey)
+
+watch([jobUpdateKey,deviceUpdateKey],()=>{
+ getJobList()
+ changeKey.value++
+})
+
onBeforeUnmount(() => {
clearInterval(polling)
--
Gitblit v1.9.3