From 3c46fcdb8c6217ff97e98c33d8f1e6e9b9cc7c1b Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期一, 02 十一月 2020 19:27:18 +0800
Subject: [PATCH] 桌面图标自适应,应用中心添加升级角标;应用中心算法卸载联调,tab名称更新;统计查询(集群)场景查询参数更新

---
 src/pages/ai/index/App.vue |   65 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 22 deletions(-)

diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue
index 236b9d4..bbe69c6 100644
--- a/src/pages/ai/index/App.vue
+++ b/src/pages/ai/index/App.vue
@@ -19,7 +19,7 @@
               @tab-click="handleTabClick"
               style="height: calc(100% - 20px);"
             >
-              <el-tab-pane label="宸插畨瑁�" name="myAlgorithm">
+              <el-tab-pane label="宸叉縺娲�" name="myAlgorithm">
                 <div class="width-new-line task-list" v-show="activeName === 'myAlgorithm'">
                   <p class="src-title">绠楁硶杞欢</p>
                   <div class="flex-list">
@@ -86,13 +86,12 @@
                                 <div v-if="item.remoteVersion">鏈�鏂扮増鏈�:{{item.remoteVersion}}</div>
                               </div>
                               <div class="mask-btn">
-                                <!-- <el-button
-                                  v-if="!item.isDefault"
-                                  @click="unLoad(item)"
+                                <el-button
+                                  @click="unLoadSdk(item)"
                                   type="primary"
                                   size="small"
                                   class="bot-btn"
-                                >鍗歌浇</el-button>-->
+                                >鍗歌浇</el-button>
                                 <el-button
                                   v-if="item.isUpgrade"
                                   @click="donwload(item)"
@@ -176,7 +175,7 @@
                             element-loading-background="rgba(0,0,0,.8)"
                           >
                             <i class="iconfont iconupdate" v-if="item.isUpgrade"></i>
-                            <div class="mask" v-if="!item.isDefault || item.isUpgrade">
+                            <div class="mask" >
                               <div class="info-onmask">
                                 <div>褰撳墠鐗堟湰:{{item.version}}</div>
                                 <div v-if="item.remoteVersion">鏈�鏂扮増鏈�:{{item.remoteVersion}}</div>
@@ -233,6 +232,7 @@
                           >
                             <div class="mask">
                               <el-button
+                                size="small"
                                 type="primary"
                                 class="bot-btn"
                                 @click="downloadApp(item)"
@@ -474,7 +474,7 @@
 </template>
 <script>
 
-import { findAllSdk, downloadSdk, installSdk, getInstallInfo } from "./api";
+import { findAllSdk, downloadSdk, installSdk, getInstallInfo, removeSdk} from "./api";
 import { getApps, installApp, removeApp, getUnActivedSdk, actPageAlg, getUnActivedApp, actApp } from "@/api/app";
 
 import FileUploader from "@/components/subComponents/FileUpload/index";
@@ -679,26 +679,47 @@
       this.installedApps = iArry;
       this.storeApps = sArry;
     },
+    //鍗歌浇绠楁硶
+    unLoadSdk(sdk){
+      let _this = this;
+      this.$confirm('纭畾瑕佸嵏杞借绠楁硶鍚�?','鎻愮ず').then(()=>{
+        sdk.unloadLoading = true;   
+        removeSdk({ sdkId: sdk.id }).then(res => {
+          if (res && res.success) {
+            sdk.unloadLoading = false;
+            _this.getAllSdk();
+            window.parent.postMessage({
+              msg: "AppUpdate"
+            }, '*')
+          }
+        }).catch(e => {
+          console.log(e);
+          sdk.unloadLoading = false;
+        })
+      }).catch( e => {
+        console.log(e)
+      })
+    },
     //鍗歌浇搴旂敤
     unLoad(app) {
-      app.unloadLoading = true;
       let _this = this;
-      removeApp({ appId: app.id }).then(res => {
-
-        if (res && res.success) {
-          //setTimeout(() => {
+      this.$confirm('纭畾瑕佸嵏杞借搴旂敤鍚�?','鎻愮ず').then(()=>{
+        app.unloadLoading = true;   
+        removeApp({ appId: app.id }).then(res => {
+          if (res && res.success) {
+            app.unloadLoading = false;
+            _this.getAllApps();
+            window.parent.postMessage({
+              msg: "AppUpdate"
+            }, '*')
+          }
+        }).catch(e => {
+          console.log(e);
           app.unloadLoading = false;
-          _this.getAllApps();
-          window.parent.postMessage({
-            msg: "AppUpdate"
-          }, '*')
-          //}, 3000);
-        }
-      }).catch(e => {
-        console.log(e);
-        app.unloadLoading = false;
+        })
+      }).catch( e => {
+        console.log(e)
       })
-
     },
     // actSdk (id) {
     //   this.actSdkId = id;

--
Gitblit v1.8.0