From d8944c4764c3fc4b7baf6b5c1586cf17c88b0bb1 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 23 三月 2022 22:38:20 +0800
Subject: [PATCH] 修改ztree复选框默认为父子联动

---
 src/pages/ai/index/App.vue |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue
index 0c04f9f..36972a1 100644
--- a/src/pages/ai/index/App.vue
+++ b/src/pages/ai/index/App.vue
@@ -88,7 +88,9 @@
                     <div class="desc-2">鐗堟湰 {{ item.version }}</div>
                   </div>
                   <div class="right-icon">
-                    <span class="icon iconfont">&#xe71a;</span>
+                    <el-tooltip effect="dark" content="涓嬭浇" placement="bottom">
+                      <span class="icon iconfont">&#xe71a;</span>
+                    </el-tooltip>
                   </div>
                 </div>
               </div>
@@ -141,7 +143,10 @@
                   class="front-page-item"
                   v-for="(item, index) in tempList"
                   :key="index"
-                  @click="checkDetail(item)"
+                  @click="checkDetail(item, 'Appcenter')"
+                  :class="{
+                    disabled: activeName == '搴旂敤涓績' && !item.canUpOrIns,
+                  }"
                 >
                   <div class="icon-img">
                     <span class="icon iconfont" v-if="item.isUpgrade"
@@ -168,7 +173,7 @@
                       type="primary"
                       class="other-btn"
                       round
-                      @click="checkDetail(item)"
+                      @click="checkDetail(item, 'Appcenter')"
                       v-if="activeName == '搴旂敤涓績' && item.price > 0"
                       >婵�娲�</el-button
                     >
@@ -357,6 +362,7 @@
           <detailPage
             :detailProductID="detailProductID"
             :detailType="detailType"
+            :detailPrice="detailPrice"
             v-if="inDetail"
             @flushSdk="getAllSdk"
             @flushApp="getAllApps"
@@ -469,6 +475,7 @@
       showUpload: false,
       detailType: "",
       detailProductID: "",
+      detailPrice: "",
       buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [],
       activeName: "搴旂敤涓績",
       patchUpdateStatus: "",
@@ -615,8 +622,13 @@
       }
     },
     checkDetail(item, typ) {
+      if (!item.canUpOrIns && typ == "Appcenter") {
+        return false;
+      }
+
       this.inDetail = true;
       this.detailProductID = item.id;
+      this.detailPrice = item.price;
       if (typ) {
         this.detailType = typ;
       } else {
@@ -683,7 +695,7 @@
           }
         })
         .catch((e) => {
-          _this.$notify.warning(e.data);
+          _this.$notify.warning(e.msg);
           clearInterval(timer);
           app.upgradeLoading = false;
         });
@@ -789,6 +801,10 @@
       });
     },
     actived(item) {
+      if (!item.canUpOrIns) {
+        return false;
+      }
+
       let _this = this;
       if (this.activeTab == "sdk") {
         actPageAlg(item.id, "")
@@ -844,7 +860,6 @@
                 version: res.data.apps[0].version,
                 productName: res.data.productName,
                 installContent: res.data.apps[0].installContent,
-                
               };
             }
             if (res.data.sdks.length > 0) {
@@ -1320,6 +1335,10 @@
             height: 76px;
             border-radius: 4px;
 
+            &.disabled {
+              cursor: default;
+            }
+
             .icon-img {
               width: 58px;
               height: 58px;
@@ -1403,6 +1422,7 @@
                 text-align: end;
                 position: absolute;
                 right: 0;
+                width: 120px;
                 margin-top: 2px;
               }
               .rocket-icon {

--
Gitblit v1.8.0