无人机管理后台前端(已迁走)
罗广辉
2025-09-27 8411f7555769a717d711fcee3810a497dddc06bd
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -264,14 +264,13 @@
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)