From cd327dcbaca3476df44b064e56b950dc054cbb87 Mon Sep 17 00:00:00 2001
From: he wei <858544502@qq.com>
Date: 星期四, 17 十一月 2022 16:58:56 +0800
Subject: [PATCH] UA 添加自动升级检测功能 添加几种类型电池告警阀值

---
 src/pages/xmlResult.vue |  145 +++++++++++++++++++++++++++++++----------------
 1 files changed, 95 insertions(+), 50 deletions(-)

diff --git a/src/pages/xmlResult.vue b/src/pages/xmlResult.vue
index 09737dd..0c4be1b 100644
--- a/src/pages/xmlResult.vue
+++ b/src/pages/xmlResult.vue
@@ -88,7 +88,12 @@
       :show-close="false"
       width="800px"
     >
-      <file-info v-if="fileInfoVisible" :info="fileData" @ok="editOk" @quit="quit"></file-info>
+      <file-info
+        v-if="fileInfoVisible"
+        :info="fileData"
+        @ok="editOk"
+        @quit="quit"
+      ></file-info>
     </el-dialog>
   </div>
 </template>
@@ -99,7 +104,7 @@
 import ChartContextMenu from "@/components/chartContextMenu";
 import offset from "@/assets/js/offset";
 import { mapGetters } from "vuex";
-import { Loading } from 'element-ui';
+import { Loading } from "element-ui";
 import {
   getXmlValue,
   testReport,
@@ -154,7 +159,13 @@
       ],
       chainVisiable: [
         {
-          name: "杩炴帴鏉�",
+          name: "杩炴帴鏉″憡璀�",
+          y: 0,
+          type: "high",
+          color: "#ff0",
+        },
+        {
+          name: "杩炴帴鏉℃洿鎹�",
           y: 0,
           type: "high",
           color: "#d9001b",
@@ -312,47 +323,72 @@
           let fileParam = data.fileParam;
 
           const {
+            chainResChange,
             chainResCoeK5,
             resBadCoeK4,
             resGoodCoeK3,
+            vol1d2HighCoeK2,
+            vol1d2LowCoeK1,
             vol2HighCoeK2,
             vol2LowCoeK1,
+            vol6HighCoeK2,
+            vol6LowCoeK1,
             vol12HighCoeK2,
             vol12LowCoeK1,
           } = this.params;
 
           this.marks.resVisiable[0].y = toFixed(
-            resGoodCoeK3 * fileParam.battRes / 100,
+            (resGoodCoeK3 * fileParam.battRes) / 100,
             BIT
           );
           this.marks.resVisiable[1].y = toFixed(
-            resBadCoeK4 * fileParam.battRes / 100,
+            (resBadCoeK4 * fileParam.battRes) / 100,
             BIT
           );
-          if (2 == fileParam.battVol) {
-            this.marks.volVisiable[0].y = toFixed(
-              vol2HighCoeK2,
-              BIT
-            );
-            this.marks.volVisiable[1].y = toFixed(
-              vol2LowCoeK1,
-              BIT
-            );
-          } else if (12 == fileParam.battVol) {
-            this.marks.volVisiable[0].y = toFixed(
-              vol12HighCoeK2,
-              BIT
-            );
-            this.marks.volVisiable[1].y = toFixed(
-              vol12LowCoeK1,
-              BIT
-            );
-          } else {
-            this.marks.volVisiable = [];
+          if (!this.marks.volVisiable.length) {
+            this.marks.volVisiable = [
+              {
+                name: "楂樺帇鍛婅",
+                y: 0,
+                type: "high",
+                color: "#ff0",
+              },
+              {
+                name: "浣庡帇鍛婅",
+                y: 0,
+                type: "low",
+                color: "#d9001b",
+              },
+            ];
+          }
+          switch(fileParam.battVol) {
+            case 1.2:
+              this.marks.volVisiable[0].y = toFixed(vol1d2HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol1d2LowCoeK1, BIT);
+              break;
+            case 2:
+              this.marks.volVisiable[0].y = toFixed(vol2HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol2LowCoeK1, BIT);
+              break;
+            case 6:
+              this.marks.volVisiable[0].y = toFixed(vol6HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol6LowCoeK1, BIT);
+              break;
+            case 12:
+              this.marks.volVisiable[0].y = toFixed(vol12HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT);
+              break;
+            default:
+              this.marks.volVisiable = [];
+              break;
           }
 
           this.marks.chainVisiable[0].y = toFixed(
-            chainResCoeK5 * fileParam.chainRes / 100,
+            (chainResCoeK5 * fileParam.chainRes) / 100,
+            BIT
+          );
+          this.marks.chainVisiable[1].y = toFixed(
+            (chainResChange * fileParam.chainRes) / 100,
             BIT
           );
 
@@ -384,47 +420,56 @@
           let fileParam = this.fileData;
 
           const {
+            chainResChange,
             chainResCoeK5,
             resBadCoeK4,
             resGoodCoeK3,
+            vol1d2HighCoeK2,
+            vol1d2LowCoeK1,
             vol2HighCoeK2,
             vol2LowCoeK1,
+            vol6HighCoeK2,
+            vol6LowCoeK1,
             vol12HighCoeK2,
             vol12LowCoeK1,
           } = this.params;
 
           this.marks.resVisiable[0].y = toFixed(
-            resGoodCoeK3 * fileParam.battRes / 100,
+            (resGoodCoeK3 * fileParam.battRes) / 100,
             BIT
           );
           this.marks.resVisiable[1].y = toFixed(
-            resBadCoeK4 * fileParam.battRes / 100,
+            (resBadCoeK4 * fileParam.battRes) / 100,
             BIT
           );
-          if (2 == fileParam.battVol) {
-            this.marks.volVisiable[0].y = toFixed(
-              vol2HighCoeK2,
-              BIT
-            );
-            this.marks.volVisiable[1].y = toFixed(
-              vol2LowCoeK1,
-              BIT
-            );
-          } else if (12 == fileParam.battVol) {
-            this.marks.volVisiable[0].y = toFixed(
-              vol12HighCoeK2,
-              BIT
-            );
-            this.marks.volVisiable[1].y = toFixed(
-              vol12LowCoeK1,
-              BIT
-            );
-          } else {
-            this.marks.volVisiable = [];
+          switch(fileParam.battVol) {
+            case 1.2:
+              this.marks.volVisiable[0].y = toFixed(vol1d2HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol1d2LowCoeK1, BIT);
+              break;
+            case 2:
+              this.marks.volVisiable[0].y = toFixed(vol2HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol2LowCoeK1, BIT);
+              break;
+            case 6:
+              this.marks.volVisiable[0].y = toFixed(vol6HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol6LowCoeK1, BIT);
+              break;
+            case 12:
+              this.marks.volVisiable[0].y = toFixed(vol12HighCoeK2, BIT);
+              this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT);
+              break;
+            default:
+              this.marks.volVisiable = [];
+              break;
           }
 
           this.marks.chainVisiable[0].y = toFixed(
-            chainResCoeK5 * fileParam.chainRes / 100,
+            (chainResCoeK5 * fileParam.chainRes) / 100,
+            BIT
+          );
+          this.marks.chainVisiable[1].y = toFixed(
+            (chainResChange * fileParam.chainRes) / 100,
             BIT
           );
 
@@ -723,7 +768,7 @@
           const fileName = matchRes
             ? decodeURI(matchRes[1].trim())
             : "鏈煡鏂囦欢鍚�.xls";
-          
+
           let link = document.createElement("a");
           link.style.display = "none";
           link.href = url;

--
Gitblit v1.9.1