From 5cc9eb2d302ffe6218221208a28b60f91b57e41e Mon Sep 17 00:00:00 2001
From: he wei <858544502@qq.com>
Date: 星期六, 09 十一月 2024 14:02:59 +0800
Subject: [PATCH] U bug修复

---
 src/views/test/index.vue |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/views/test/index.vue b/src/views/test/index.vue
index 995f2c5..b5cc44a 100644
--- a/src/views/test/index.vue
+++ b/src/views/test/index.vue
@@ -49,6 +49,19 @@
   return _list.filter((v) => v.devId == currentDevId.value)[0] || {};
 });
 
+// 鏄惁鍙互淇敼鍧囪 浠數姹犵粍鏁�
+const canChangeBattCount = computed(() => {
+  // !currentDev.state[0].isTesting && !currentDev.state[1].isTesting
+  if (1 == devType.value || !currentDev.value.state) {
+    return false;
+  }
+  if (onlyOneGroup.value) {
+    return !currentDev.value.state[0].isTesting;
+  } else {
+    return !currentDev.value.state[0].isTesting && !currentDev.value.state[1].isTesting;
+  }
+});
+
 const testMode = computed(() => {
   if (1 == devType.value) {
     return ["--", "鏀剧數娴嬭瘯", "鍏呯數娴嬭瘯"][currentDev.value.state?.testType];
@@ -59,7 +72,7 @@
         ? states[currentDev.value.state[v].workMode] || "--"
         : "--"
     );
-    return `缁�1:${res1}, 缁�2: ${res2}`;
+    return onlyOneGroup.value ? `缁�1:${res1}` : `缁�1:${res1}, 缁�2: ${res2}`;
   }
 });
 
@@ -76,7 +89,7 @@
         ? currentDev.value.state[v].moduleStatus || "--"
         : "--"
     );
-    return `缁�1:${res1}, 缁�2: ${res2}`;
+    return onlyOneGroup.value ? `缁�1:${res1}` : `缁�1:${res1}, 缁�2: ${res2}`;
   }
 });
 
@@ -138,7 +151,7 @@
 
 function setBattCount() {
   jhyBattCountVisible.value = true;
-  console.log("cur", currentDev, "=============");
+  // console.log("cur", currentDev, "=============");
 }
 
 /**
@@ -151,7 +164,7 @@
 }
 
 function pauseYtj(type) {
-  console.log("currentDev", currentDev, "=============");
+  // console.log("currentDev", currentDev, "=============");
   if (!currentDev.value.devId) {
     return false;
   }
@@ -272,7 +285,7 @@
             size="small"
             :disabled="!currentDev.devOnline"
             class="btn-start btn-grp1"
-            v-if="!currentDev.state[0].isTesting"
+            v-if="canChangeBattCount"
             @click="setBattCount"
             >璁剧疆缁勬暟</el-button
           >

--
Gitblit v1.9.1