haoxuan
2023-11-03 6b027c18660b828ec7b57ad0e3f4ffca9f4d14d1
src/stores/plc.ts
@@ -5,6 +5,7 @@
import { useRequest } from 'vue-hooks-plus'
import { useTasksStore } from '@/stores/tasks'
import type { PLCResponse } from '@/api/plc'
import { PLC_POLLING_DURATION } from '@/common/constants'
// 全局 watcher ref 防止多次调用 usePLCStore 时重复注册侦听器
const unwatch = ref()
@@ -31,7 +32,7 @@
      } as ProductProgressParams),
    {
      manual: true,
      pollingInterval: 6000,
      pollingInterval: PLC_POLLING_DURATION,
      pollingWhenHidden: false
    }
  )