From 1519870c0e18171ced014a840e86a459dc6b00f1 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 12 十二月 2023 17:26:06 +0800
Subject: [PATCH] 报工记录列表增加人员姓名

---
 src/stores/devices.ts |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/stores/devices.ts b/src/stores/devices.ts
index fb0fd53..e0f81ef 100644
--- a/src/stores/devices.ts
+++ b/src/stores/devices.ts
@@ -1,4 +1,4 @@
-import { computed, onUnmounted } from 'vue'
+import { computed } from 'vue'
 import { defineStore } from 'pinia'
 import { getDeviceList } from '@/api'
 import { useRequest } from 'vue-hooks-plus'
@@ -8,6 +8,14 @@
 export const useDevicesStore = defineStore('device', () => {
   const deviceInfo = computed(() => {
     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
   })
 
   /**
@@ -28,9 +36,5 @@
     startDevicePolling()
   }
 
-  onUnmounted(() => {
-    cancelDevicePolling()
-  })
-
-  return { deviceInfo, startPollingDevice }
+  return { deviceInfo, startPollingDevice, currentDeviceAllowNoParams }
 })

--
Gitblit v1.8.0