From db5872786c1e1697a59af41386136ee002bb68ad Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 30 六月 2023 17:17:12 +0800
Subject: [PATCH] 修改为汇丰默认图标,修改处理率计算方式

---
 src/views/hashrate/HashManage/index.vue |   42 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/src/views/hashrate/HashManage/index.vue b/src/views/hashrate/HashManage/index.vue
index c3d84ef..804eb20 100644
--- a/src/views/hashrate/HashManage/index.vue
+++ b/src/views/hashrate/HashManage/index.vue
@@ -5,7 +5,7 @@
         <!-- 鎬荤畻鍔� -->
         <div class="card">
           <div class="hashrate">
-            <img src="/images/hashrate/鎬荤畻鍔�.png" alt="" />
+            <img src="/images/hashrate/total.png" alt="" />
             <div class="hashrateContent">
               <div class="label">鎬荤畻鍔�</div>
               <div class="data">
@@ -16,12 +16,12 @@
           </div>
         </div>
         <!-- 瀹炴椂绠楀姏 -->
-        <HashCard :type="0" :hashrate="realTime"></HashCard>
+        <HashCard :type="0" :hashrate="polling"></HashCard>
       </div>
 
       <div class="medium">
         <!-- 杞绠楀姏 -->
-        <HashCard class="topCard" :type="1" :hashrate="polling"></HashCard>
+        <HashCard class="topCard" :type="1" :hashrate="realTime"></HashCard>
         <!-- 鏁版嵁鏍堢畻鍔� -->
         <HashCard :type="2" :hashrate="stack"></HashCard>
       </div>
@@ -77,6 +77,7 @@
       :list="deviceList"
       @chooseCluster="chooseCluster"
       @chooseDevice="chooseDevice"
+      @refreshCluster="chooseCluster(ClusterId)"
       @back="back"
       :listType="listType"
     ></ClusterList>
@@ -88,7 +89,6 @@
 import ClusterList from "./components/ClusterList";
 import {
   userStatisticRunInfo,
-  userSysInfo,
   userStatisticRun,
   clusterStatisticRunInfo,
   clusterSysInfo,
@@ -102,6 +102,8 @@
     ClusterList,
   },
   created() {
+    sessionStorage.removeItem("devId");
+    sessionStorage.removeItem("clusterId");
     this.getUserInfo();
     this.getUserDevice();
   },
@@ -120,6 +122,7 @@
       },
       deviceList: [],
       listType: "cluster",
+      ClusterId: "",
     };
   },
   methods: {
@@ -138,6 +141,13 @@
             res1.data.realRunningCount -
             res1.data.realInvalidCount,
         };
+
+        if (res1.data.hasOwnProperty("duanliuID")) {
+          this.realTime["duanliu"] = [...new Set(res1.data.duanliuID)]
+
+          this.realTime.noDeal += this.realTime["duanliu"].length
+        }
+
         this.polling = {
           valid: res1.data.pollTotal,
           total: res1.data.pollChannelCount,
@@ -160,7 +170,9 @@
             res1.data.stackRunningCount,
         };
       }
-      const res2 = await userSysInfo();
+      const res2 = await clusterSysInfo({
+        clusterId: "",
+      });
       if (res2 && res2.success) {
         this.systemInfo = {
           cpu: parseInt(res2.data.cpu.usedPercent),
@@ -193,6 +205,13 @@
             res1.data.realRunningCount -
             res1.data.realInvalidCount,
         };
+
+        if (res1.data.hasOwnProperty("duanliuID")) {
+          this.realTime["duanliu"] = [...new Set(res1.data.duanliuID)]
+
+          this.realTime.noDeal += this.realTime["duanliu"].length
+        }
+
         this.polling = {
           valid: res1.data.pollTotal,
           total: res1.data.pollChannelCount,
@@ -215,7 +234,10 @@
             res1.data.stackRunningCount,
         };
       }
-      const res2 = await clusterSysInfo({ clusterId: id });
+      const res2 = await clusterSysInfo(
+        //id
+        { clusterId: "" }
+      );
       if (res2 && res2.success) {
         this.systemInfo = {
           cpu: parseInt(res2.data.cpu.usedPercent),
@@ -248,6 +270,13 @@
             res1.data.realRunningCount -
             res1.data.realInvalidCount,
         };
+
+        if (res1.data.hasOwnProperty("duanliuID")) {
+          this.realTime["duanliu"] = [...new Set(res1.data.duanliuID)]
+
+          this.realTime.noDeal += this.realTime["duanliu"].length
+        }
+
         this.polling = {
           valid: res1.data.pollTotal,
           total: res1.data.pollChannelCount,
@@ -283,6 +312,7 @@
     chooseCluster(id) {
       this.getClusterInfo(id);
       this.getClusterDevice(id);
+      this.ClusterId = id;
     },
     back() {
       this.getUserInfo();

--
Gitblit v1.8.0