From 8f1e5d92579da34c21a83f74b924dfd4908889c6 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 06 二月 2024 17:22:36 +0800
Subject: [PATCH] 注掉获取PLC运行数据

---
 src/stores/plc.ts |   46 ++++++++++++++++++++++------------------------
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/src/stores/plc.ts b/src/stores/plc.ts
index 83ff4cd..152c2b8 100644
--- a/src/stores/plc.ts
+++ b/src/stores/plc.ts
@@ -13,29 +13,27 @@
 export const usePLCStore = defineStore('plc', () => {
   const taskStore = useTasksStore()
 
-  const plcInfo = computed(() => {
-    return plcRes?.value?.data as PLCResponse
-  })
+  const plcInfo = ref()
 
   /**
    * 濡傛灉浠诲姟鐘舵�佹槸杩涜涓�, 鍒欒疆璇� plc 鍙栬繘搴�
    */
-  const {
-    data: plcRes,
-    run: startPLCPolling,
-    cancel: cancelPLCPolling
-  } = useRequest(
-    () =>
-      getProductProgress({
-        channel: taskStore.activeChannel ?? 0,
-        procedureId: taskStore.activeTask?.Procedure.ID ?? undefined
-      } as ProductProgressParams),
-    {
-      manual: true,
-      pollingInterval: PLC_POLLING_DURATION,
-      pollingWhenHidden: false
-    }
-  )
+  // const {
+  //   data: plcRes,
+  //   run: startPLCPolling,
+  //   cancel: cancelPLCPolling
+  // } = useRequest(
+  //   () =>
+  //     getProductProgress({
+  //       channel: taskStore.activeChannel ?? 0,
+  //       procedureId: taskStore.activeTask?.Procedure.ID ?? undefined
+  //     } as ProductProgressParams),
+  //   {
+  //     manual: true,
+  //     pollingInterval: PLC_POLLING_DURATION,
+  //     pollingWhenHidden: false
+  //   }
+  // )
 
   if (!unwatch.value) {
     /**
@@ -44,19 +42,19 @@
     unwatch.value = watch(
       () => taskStore.activeChannel,
       () => {
-        cancelPLCPolling()
-        startPLCPolling()
+        // cancelPLCPolling()
+        // startPLCPolling()
       }
     )
   }
 
   function startPollingPLC() {
-    cancelPLCPolling()
-    startPLCPolling()
+    // cancelPLCPolling()
+    // startPLCPolling()
   }
 
   onUnmounted(() => {
-    cancelPLCPolling()
+    // cancelPLCPolling()
   })
 
   return { plcInfo, startPollingPLC }

--
Gitblit v1.8.0