From 2bea34a35d1551cdb57fdd48696b1db4f7b665fd Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期三, 24 一月 2024 14:37:49 +0800 Subject: [PATCH] 样式调整 --- src/stores/plc.ts | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stores/plc.ts b/src/stores/plc.ts index 50e7926..83ff4cd 100644 --- a/src/stores/plc.ts +++ b/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() @@ -26,12 +27,12 @@ } = useRequest( () => getProductProgress({ - channel: taskStore.activeTask?.Channel, - procedureId: taskStore.activeTask?.Procedure.ID + channel: taskStore.activeChannel ?? 0, + procedureId: taskStore.activeTask?.Procedure.ID ?? undefined } as ProductProgressParams), { manual: true, - pollingInterval: 6000, + pollingInterval: PLC_POLLING_DURATION, pollingWhenHidden: false } ) @@ -41,7 +42,7 @@ * 濡傛灉鍒囨崲鍒板叾浠栭�氶亾鐨勪换鍔�,鍒欓噸鏂拌疆璇lc */ unwatch.value = watch( - () => taskStore.activeTask?.Channel, + () => taskStore.activeChannel, () => { cancelPLCPolling() startPLCPolling() -- Gitblit v1.8.0