From f7f0e44c4be8eb0e77fd310296c3b43bde21e4f9 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期四, 23 六月 2022 14:17:01 +0800
Subject: [PATCH] 新增联动场景

---
 src/views/hashrate/AlgManage/index.vue |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/src/views/hashrate/AlgManage/index.vue b/src/views/hashrate/AlgManage/index.vue
index 71f24a5..3053435 100644
--- a/src/views/hashrate/AlgManage/index.vue
+++ b/src/views/hashrate/AlgManage/index.vue
@@ -20,7 +20,7 @@
       <div class="label freeLabel">
         鍏嶈垂绠楁硶 <span class="des">浠庢澶勬嫋鎷界畻娉曞浘鏍囧畨瑁呭埌璁惧</span>
       </div>
-      <div class="freeList">
+      <div class="freeList scroll">
         <div
           class="algCard"
           v-for="(item, index) in freeAlg"
@@ -75,7 +75,7 @@
           >
             <img src="/images/hashrate/绠楁硶绠$悊绌洪〉闈�.png" alt="" />
             <div class="des">
-              鏆傛湭瀹夎绠楁硶锛屼粠宸︿晶绠楁硶涓績鎷栧埌绠楁硶鍒版澶勶紝鍗冲彲瀹夎
+              鏆傛湭瀹夎绠楁硶锛屼粠宸︿晶绠楁硶涓績绠楁硶鍒版澶勶紝鍗冲彲瀹夎
             </div>
           </div>
         </div>
@@ -187,7 +187,12 @@
     async getEquipment() {
       const res = await findAllSdk();
       if (res && res.success) {
-        this.equipmentArr = res.data;
+        this.equipmentArr = [];
+        res.data.forEach((item, index) => {
+          if (item.sdkList) {
+            this.equipmentArr.push(item);
+          }
+        });
       }
     },
     //鎷栨嫿寮�濮�
@@ -205,16 +210,21 @@
         sdk_name: this.dragAlg.productName,
       });
 
-      const res = await downloadOrUpgrade({
-        nodeId: devId,
-        path: this.dragAlg.productBaseId,
-        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
-      });
-      if (res && res.success) {
-        this.$notify({
-          type: "success",
-          message: "鎿嶄綔鎴愬姛,璇风◢鍚�",
+      try {
+        const res = await downloadOrUpgrade({
+          nodeId: devId,
+          path: this.dragAlg.productBaseId,
+          userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
+          inputText: this.dragAlg.productName,
         });
+        if (res && res.success) {
+          this.$notify({
+            type: "success",
+            message: "鎿嶄綔鎴愬姛,璇风◢鍚�",
+          });
+        }
+      } catch (err) {
+        algArr.pop();
       }
 
       this.dragAlg = null;
@@ -261,7 +271,7 @@
       if (res && res.success) {
         this.$notify({
           type: "success",
-          message: "鎿嶄綔鎴愬姛",
+          message: res.msg,
         });
       }
     },

--
Gitblit v1.8.0