From 82e27d0cadbddfc73e8b978e778b802dc8e51fa1 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 29 三月 2024 10:51:36 +0800
Subject: [PATCH] 报工入参修改和工序ID修改

---
 src/stores/devices.ts |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/stores/devices.ts b/src/stores/devices.ts
index a23d468..0b71784 100644
--- a/src/stores/devices.ts
+++ b/src/stores/devices.ts
@@ -7,10 +7,15 @@
 
 export const useDevicesStore = defineStore('device', () => {
   const deviceInfo = computed(() => {
-    if (deviceInfo?.value) {
-      deviceRes.value.data.currentDeviceID = 'wwwwwwww222222'
-    }
     return deviceRes?.value?.data as Devices
+  })
+
+  // 褰撳墠璁惧鍦ㄧ己灏戝伐鑹哄弬鏁扮殑鏃跺�欐槸鍚﹀厑璁镐笅鍙戠敓浜�
+  const currentDeviceAllowNoParams = computed(() => {
+    const currentDeviceInfo = deviceInfo.value.deviceList?.find((ele) => {
+      return ele.deviceID === deviceInfo.value.currentDeviceID
+    })
+    return !currentDeviceInfo?.needSetProcessParams
   })
 
   /**
@@ -20,16 +25,19 @@
     data: deviceRes,
     run: startDevicePolling,
     cancel: cancelDevicePolling
-  } = useRequest(getDeviceList, {
-    manual: true,
-    pollingInterval: DEVICE_INFO_POLLING_DURATION,
-    pollingWhenHidden: false
-  })
+  } = useRequest(
+    getDeviceList
+    //   {
+    //   manual: true,
+    //   pollingInterval: DEVICE_INFO_POLLING_DURATION,
+    //   pollingWhenHidden: false
+    // }
+  )
 
   function startPollingDevice() {
     cancelDevicePolling()
     startDevicePolling()
   }
 
-  return { deviceInfo, startPollingDevice }
+  return { deviceInfo, startPollingDevice, currentDeviceAllowNoParams }
 })

--
Gitblit v1.8.0