From 106374208e6e7265db3c00ddfa948c39b7c252ea Mon Sep 17 00:00:00 2001
From: he wei <858544502@qq.com>
Date: 星期五, 08 十一月 2024 11:19:26 +0800
Subject: [PATCH] U 修改批量操作

---
 src/views/test/devCard.vue |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/src/views/test/devCard.vue b/src/views/test/devCard.vue
index a86dc3a..18bdf4b 100644
--- a/src/views/test/devCard.vue
+++ b/src/views/test/devCard.vue
@@ -3,6 +3,10 @@
 import { ref, computed } from "vue";
 import formatSeconds from "@/assets/js/tools/formatSeconds";
 
+import toFixed from "@/assets/js/tools/toFixed.js";
+import const_digits from "@/assets/js/const/const_digits";
+const { VOL, GROUPVOL, CURR_YT, CURR_JH } = const_digits;
+
 const props = defineProps({
   devIdcode: {
     type: [String, Number],
@@ -17,20 +21,25 @@
   info: {
     type: Object,
     required: true,
-  }
+  },
 });
 
 const testStates = computed(() => {
   if (1 == props.devType) {
-    return ["--", "鏀剧數娴嬭瘯", "鍏呯數娴嬭瘯"][props.info.state?.testType];
+    if (props.info.state.testPause) {
+      return "鏆傚仠涓�";
+    } else if (props.info.state.isTesting) {
+      return ["--", "鏀剧數娴嬭瘯", "鍏呯數娴嬭瘯"][props.info.state?.testType];
+    } else {
+      return "--";
+    }
   } else {
-    let states = ["鍏呯數", "鏀剧數", "鍧囪 "];
-    let [res1, res2] = [0, 1].map((v) =>
-      props.info.state
-        ? states[props.info.state[v].workMode] || "--"
-        : "--"
-    );
-    return `缁�1:${res1}, 缁�2: ${res2}`;
+    // let states = ["鍏呯數", "鏀剧數", "鍧囪 "];
+    // let [res1, res2] = [0, 1].map((v) =>
+    //   props.info.state ? states[props.info.state[v].workMode] || "--" : "--"
+    // );
+    let [res1, res2] = [0, 1].map((v) => props.info.state[v].moduleStatus);
+  return `缁�1:${res1}, 缁�2: ${res2}`;
   }
 });
 </script>
@@ -59,11 +68,11 @@
         <div class="info">
           <template v-if="1 == props.devType">
             <div class="item">
-              {{ info.state.storageVoltage }}V
+              {{ toFixed(info.state.storageVoltage, GROUPVOL) }}V
               <div class="link"></div>
             </div>
             <div class="item">
-             {{ info.state.testCurrent }}A
+              {{ toFixed(info.state.testCurrent, CURR_YT) }}A
               <div class="link"></div>
             </div>
             <div class="item">
@@ -104,7 +113,9 @@
         {{ onLine ? "鍦ㄧ嚎" : "绂荤嚎" }}
       </div>
       <div class="wrap" v-else>
-        <div class="workstate">{{ info.state.isTesting ? testStates : '--' }}</div>
+        <div class="workstate">
+          {{ testStates }}
+        </div>
         <icon-arrow-right class="icon"></icon-arrow-right>
       </div>
     </div>

--
Gitblit v1.9.1