From 773134bc5889cbfa8e570f012220a451ce2e6622 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期二, 27 十月 2020 16:36:39 +0800
Subject: [PATCH] 修改国标端口校验规则

---
 src/pages/ai/index/App.vue | 1881 +++++++++++++++++++++++----------------------------------
 1 files changed, 765 insertions(+), 1,116 deletions(-)

diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue
index b4293e5..c836d3e 100644
--- a/src/pages/ai/index/App.vue
+++ b/src/pages/ai/index/App.vue
@@ -8,7 +8,7 @@
           </div>
         </div>
         <!-- 瓒呯骇绠$悊鍛樺彲瑙� -->
-        <div class="super" v-if="isSuperUser">
+        <div class="super">
           <div class="left-box">
             <!-- <div class="title">
           <label>绠楁硶搴�</label>
@@ -21,28 +21,40 @@
             >
               <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">
-                    <!-- <draggable
-                :list="installedList"
-                :group="{ name: 'article', pull: 'clone', put: false }"
-                :sort="false"
-                @start="startRight"
-                @end="endLeft"
-                style="display:inline"
-                    >-->
-
-                    <div class="wrap-box" v-for="item in ungradeList" :key="item.id">
+                    <!-- <div class="wrap-box" v-for="item in ungradeList" :key="'upgrade'+item.id">
                       <div class="list-choose-item-left">
-                        <div class="mask">
-                          <el-button type="primary" class="bot-btn" @click="donwload(item)">鍗囩骇</el-button>
-                        </div>
-
                         <div class="list-complete-item-handle">
-                          <div class="svg-wrap">
-                            <!-- <svg class="icon" aria-hidden="true" style="font-size:7rem;">
-                              <use :xlink:href="`#${item.icon}`" />
-                            </svg> -->
-                            <img class="baseImg" :src="`data:image/png;base64,${item.iconBlob}`" alt="">
+                          <div
+                            class="svg-wrap"
+                            :class="{willUpGrade:item.isUpgrade}"
+                            v-loading="item.upgradeLoading"
+                            :element-loading-text="item.progressMsg"
+                            element-loading-background="rgba(0,0,0,.8)"
+                          >
+                            <i class="iconfont iconupdate" v-if="item.isUpgrade"></i>
+                            <div class="mask">
+                              <div class="info-onmask">
+                                <div>褰撳墠鐗堟湰:{{item.version}}</div>
+                                <div>鏈�鏂扮増鏈�:{{item.remoteVersion}}</div>
+                              </div>
+                              <div class="mask-btn">
+                                <el-button
+                                  type="warning"
+                                  class="bot-btn"
+                                  size="small"
+                                  @click="donwload(item)"
+                                >鍗囩骇</el-button>
+                              </div>
+                            </div>
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
                           </div>
                           <div class="alg-name">
                             <div style="padding:0px 10px 0px 10px;">
@@ -51,27 +63,52 @@
                           </div>
                         </div>
                       </div>
-                    </div>
+                    </div>-->
                     <div class="wrap-box" v-for="(item) in installedList" :key="item.id">
                       <div class="list-choose-item-left">
-                        <div class="mask" v-if="!item.isEdit">
-                          <el-button
-                            @click="commandAlgLib(item)"
-                            type="primary"
-                            class="bot-btn"
-                          >缂栬緫鍚嶇О</el-button>
-                        </div>
                         <div class="list-complete-item-handle">
-                          <!-- <span :class="`iconfont ${item.icon}`" style="font-size:3rem;"></span> -->
-                          <div class="svg-wrap">
-                            <!-- <svg class="icon" aria-hidden="true" style="font-size:7rem;">
-                              <use :xlink:href="`#${item.icon}`" />
-                            </svg>-->
+                          <div
+                            class="svg-wrap"
+                            :class="{willUpGrade:item.isUpgrade}"
+                            v-loading="item.upgradeLoading"
+                            :element-loading-text="item.progressMsg"
+                            element-loading-background="rgba(0,0,0,.8)"
+                          >
+                            <!-- <div class="mask flex-center">
+                              <div class="info-onmask">
+                                <div>褰撳墠鐗堟湰:{{item.version}}</div>
+                              </div>
+                            </div>-->
+                            <i class="iconfont iconupdate" v-if="item.isUpgrade"></i>
+                            <div class="mask" v-if="!item.isDefault || item.isUpgrade">
+                              <div class="info-onmask">
+                                <div>褰撳墠鐗堟湰:{{item.version}}</div>
+                                <div v-if="item.remoteVersion">鏈�鏂扮増鏈�:{{item.remoteVersion}}</div>
+                              </div>
+                              <div class="mask-btn">
+                                <!-- <el-button
+                                  v-if="!item.isDefault"
+                                  @click="unLoad(item)"
+                                  type="primary"
+                                  size="small"
+                                  class="bot-btn"
+                                >鍗歌浇</el-button>-->
+                                <el-button
+                                  v-if="item.isUpgrade"
+                                  @click="donwload(item)"
+                                  type="warning"
+                                  size="small"
+                                  class="bot-btn"
+                                >鍗囩骇</el-button>
+                              </div>
+                            </div>
                             <img
+                              v-if="item.iconBlob"
                               class="baseImg"
-                              :src="`data:image/png;base64,${item.iconBlob}`"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
                               alt
                             />
+                            <img v-else class="baseImg" :src="item.icon" alt />
                           </div>
                           <div class="alg-name">
                             <div style="padding:0px 10px 0px 10px;">
@@ -103,12 +140,19 @@
                           <span class="iconfont iconxiazai1"></span>
                         </div>
                         <div class="list-complete-item-handle">
-                          <!-- <span :class="`iconfont ${item.icon}`" style="font-size:3rem;"></span> -->
-                          <div class="svg-wrap">
-                            <!-- <svg class="icon" aria-hidden="true" style="font-size:7rem;">
-                              <use :xlink:href="`#${item.icon}`" />
-                            </svg> -->
-                            <img class="baseImg" :src="`data:image/png;base64,${item.iconBlob}`" alt="">
+                          <div
+                            class="svg-wrap"
+                            v-loading="item.installLoading||item.upgradeLoading"
+                            :element-loading-text="item.progressMsg"
+                            element-loading-background="rgba(0,0,0,.8)"
+                          >
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
                           </div>
                           <div class="alg-name">
                             <div style="padding:0px 10px 0px 10px;">
@@ -119,14 +163,113 @@
                       </div>
                     </div>
                   </div>
-                  <!-- 鏈笅杞� -->
+                  <p class="src-title">搴旂敤杞欢</p>
+                  <div class="flex-list">
+                    <div class="wrap-box" v-for="(item) in installedApps" :key="item.id">
+                      <div class="list-choose-item-left">
+                        <div class="list-complete-item-handle">
+                          <div
+                            class="svg-wrap"
+                            :class="{willUpGrade:item.isUpgrade}"
+                            v-loading="item.unloadLoading||item.upgradeLoading"
+                            :element-loading-text="item.progressMsg"
+                            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="info-onmask">
+                                <div>褰撳墠鐗堟湰:{{item.version}}</div>
+                                <div v-if="item.remoteVersion">鏈�鏂扮増鏈�:{{item.remoteVersion}}</div>
+                              </div>
+                              <div class="mask-btn">
+                                <el-button
+                                  v-if="!item.isDefault"
+                                  @click="unLoad(item)"
+                                  type="primary"
+                                  size="small"
+                                  class="bot-btn"
+                                >鍗歌浇</el-button>
+                                <el-button
+                                  v-if="item.isUpgrade"
+                                  @click="downloadApp(item,'upgrade')"
+                                  type="warning"
+                                  size="small"
+                                  class="bot-btn"
+                                >鍗囩骇</el-button>
+                              </div>
+                            </div>
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
+                          </div>
+                          <div class="alg-name">
+                            <div style="padding:0px 10px 0px 10px;">
+                              <span v-if="!item.isEdit">{{ item.name }}</span>
+                              <el-input
+                                size="small"
+                                v-model="item.sdk_name"
+                                v-if="item.isEdit"
+                                v-focus
+                                :maxlength="15"
+                                @blur="inputBlur(item)"
+                              ></el-input>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div class="wrap-box" v-for="item in storeApps" :key="item.id">
+                      <div class="list-choose-item-left">
+                        <div class="list-complete-item-handle uninstall">
+                          <div
+                            class="svg-wrap"
+                            v-loading="item.installLoading||item.upgradeLoading"
+                            :element-loading-text="item.progressMsg"
+                            element-loading-background="rgba(0,0,0,.8)"
+                          >
+                            <div class="mask">
+                              <el-button
+                                type="primary"
+                                class="bot-btn"
+                                @click="downloadApp(item)"
+                              >瀹夎</el-button>
+                            </div>
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
+                          </div>
+                          <div class="alg-name">
+                            <div style="padding:0px 10px 0px 10px;">
+                              <span v-if="!item.isEdit">{{ item.name }}</span>
+                              <el-input
+                                size="small"
+                                v-model="item.name"
+                                v-if="item.isEdit"
+                                v-focus
+                                :maxlength="15"
+                                @blur="inputBlur(item)"
+                              ></el-input>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
                 </div>
               </el-tab-pane>
 
               <el-tab-pane
                 label="绂荤嚎鍗囩骇/瀹夎"
                 name="upgradeOrInstallation"
-                v-show="activeName==='upgradeOrInstallation'"
+                v-if="isShow('algorithmManage:insOffLine')"
               >
                 <div class="tab-content">
                   <div class="action-bar">
@@ -134,7 +277,7 @@
                       single
                       tip
                       tipWords="涓婁紶绠楁硶"
-                      uploadPlaceholder="绂荤嚎瀹夎绠楁硶"
+                      uploadPlaceholder="涓婁紶瀹夎杞欢"
                       url="/data/api-v/sdk/upload"
                       @complete="onFileUpload"
                       @file-added="onFileAdded"
@@ -142,28 +285,82 @@
                   </div>
                 </div>
               </el-tab-pane>
-              <el-tab-pane label="搴旂敤涓績" name="algorithmMall" v-show="activeName==='algorithmMall'">
+              <el-tab-pane label="搴旂敤涓績" name="algorithmMall" v-if=" isShow('algorithmManage:buy')">
                 <div class="tab-content">
-                  <p>绠楁硶杞欢</p>
-                  <div class="store-list">
-                    <div class="wrap-box">
-                      <div class="inner">
-                        <div class="mask" @click="actDrawerShow=true">
-                          <svg class="icon" aria-hidden="true" style="font-size:2rem;">
-                            <use xlink:href="#iconyunxiazai" />
-                          </svg>
+                  <p class="src-title">绠楁硶杞欢</p>
+                  <div class="store-list flex-list">
+                    <div class="wrap-box" v-for="item in unActivedSDKList" :key="item.id">
+                      <div class="list-choose-item-left">
+                        <div class="list-complete-item-handle">
+                          <div class="alg-icon svg-wrap">
+                            <div class="mask" @click="actSdkOrApp(item.id)">
+                              <span
+                                class="iconfont iconyunxiazai"
+                                style="color:#ff6a00;font-size:20px;position:absolute;top:45%;left:45%"
+                              ></span>
+                            </div>
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
+                          </div>
+                          <div class="alg-name">
+                            <div style="padding:0px 10px 0px 10px;">
+                              <span v-if="!item.isEdit">{{ item.sdk_name }}</span>
+                              <el-input
+                                size="small"
+                                v-model="item.sdk_name"
+                                v-if="item.isEdit"
+                                v-focus
+                                :maxlength="15"
+                                @blur="inputBlur(item)"
+                              ></el-input>
+                            </div>
+                          </div>
                         </div>
-                        <div class="alg-icon">
-                          <svg class="icon" aria-hidden="true" style="font-size:7rem;">
-                            <use xlink:href="#iconrenyuanyidong" />
-                          </svg>
-                        </div>
-                        <div class="alg-name">name</div>
                       </div>
                     </div>
                   </div>
-                  <p>搴旂敤杞欢</p>
-                  <div class="app-list"></div>
+                  <p class="src-title">搴旂敤杞欢</p>
+                  <div class="app-list flex-list">
+                    <div class="wrap-box" v-for="item in unActivedAppList" :key="item.id">
+                      <div class="list-choose-item-left">
+                        <div class="list-complete-item-handle">
+                          <div class="alg-icon svg-wrap">
+                            <div class="mask" @click="actSdkOrApp(item.id,'app')">
+                              <span
+                                class="iconfont iconyunxiazai"
+                                style="color:#ff6a00;font-size:20px;position:absolute;top:45%;left:45%"
+                              ></span>
+                            </div>
+                            <img
+                              v-if="item.iconBlob"
+                              class="baseImg"
+                              :src="item.iconBlob.indexOf(',')>0? item.iconBlob:`data:image/png;base64,${item.iconBlob}`"
+                              alt
+                            />
+                            <img v-else class="baseImg" :src="item.icon" alt />
+                          </div>
+                          <div class="alg-name">
+                            <div style="padding:0px 10px 0px 10px;">
+                              <span v-if="!item.isEdit">{{ item.name }}</span>
+                              <el-input
+                                size="small"
+                                v-model="item.name"
+                                v-if="item.isEdit"
+                                v-focus
+                                :maxlength="15"
+                                @blur="inputBlur(item)"
+                              ></el-input>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
                 </div>
                 <el-drawer title="涓嬭浇" :visible.sync="actDrawerShow" :direction="direction">
                   <div class="drawer-content">
@@ -191,28 +388,28 @@
                       <ul class="desc">
                         <li>
                           <label>婵�娲荤爜:</label>
-                          <span>YUAAA-AAAEU-QJQE3-ZRRXD-K9MWR</span>
+                          <span>{{activedSdkOrApp.activateCode}}</span>
                         </li>
                         <li>
                           <label>浜у搧鍚嶇О:</label>
-                          <span>浜哄憳璺熻釜SDK</span>
+                          <span>{{activedSdkOrApp.productName}}</span>
                         </li>
                         <li>
                           <label>閰嶇疆璇︽儏:</label>
-                          <span>鏃�</span>
+                          <span>{{activedSdkOrApp.setting}}</span>
                         </li>
                         <li>
                           <label>鏈嶅姟鍒版湡鏃�:</label>
-                          <span>2021-03-04</span>
+                          <span>{{activedSdkOrApp.expireTime}}</span>
                         </li>
                         <li>
                           <label>璁稿彲璇�:</label>
-                          <span>鏈澶�</span>
+                          <span>{{activedSdkOrApp.licence}}</span>
                         </li>
-                        <li>
+                        <!-- <li>
                           <label>璁惧ID:</label>
                           <span>3342-235f-ret55-fdsg</span>
-                        </li>
+                        </li>-->
                       </ul>
                       <div class="text-right">
                         <el-button type="primary" @click="checkMyAlgorith">纭畾</el-button>
@@ -227,31 +424,60 @@
         </div>
       </div>
     </div>
+    <el-dialog
+      title="瀹夎鍖呬俊鎭�"
+      :visible.sync="installDialogVisible"
+      width="40%"
+      :close-on-click-modal="false"
+    >
+      <div class="installInfo">
+        <template v-if="installAppPackage != null">
+          <div>
+            <div>
+              <span>瀹夎鍖呭悕绉帮細</span>
+              <span>{{installAppPackage.productName}}</span>
+            </div>
+            <div>
+              <span>瀹夎鐗堟湰锛�</span>
+              <span>{{installAppPackage.version}}</span>
+            </div>
+            <div>
+              <span>鏇存柊鍐呭锛�</span>
+              <span>{{installAppPackage.installContent}}</span>
+            </div>
+          </div>
+        </template>
+        <template v-if="installSdkPackage != null">
+          <div>
+            <div>
+              <span>瀹夎鍖呭悕绉帮細</span>
+              <span>{{installSdkPackage.productName}}</span>
+            </div>
+            <div>
+              <span>瀹夎鐗堟湰锛�</span>
+              <span>{{installSdkPackage.version}}</span>
+            </div>
+            <div>
+              <span>鏇存柊鍐呭锛�</span>
+              <span>{{installSdkPackage.installContent}}</span>
+            </div>
+          </div>
+        </template>
+        <p>纭畾瀹夎锛�</p>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="installDialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="offlineInstall">瀹� 瑁�</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
 
-import {
-  findAllSdk,
-  findAll,
-  addTaskSdk,
-  delTaskSdk,
-  deleteTask,
-  updateTaskStatus,
-  updateTaskName,
-  getSdkArgs,
-  saveTaskSdkRule,
-  addTask,
-  getRulesByTaskSdk,
-  deleteTaskSdkRule,
-  findByType,
-  getTagList,
-  downloadSdk,
-  installSdk
-} from "./api";
+import { findAllSdk, downloadSdk, installSdk, getInstallInfo } from "./api";
+import { getApps, installApp, removeApp, getUnActivedSdk, actPageAlg, getUnActivedApp, actApp } from "@/api/app";
+
 import FileUploader from "@/components/subComponents/FileUpload/index";
-import TaskManage from "@/Pool/TaskMange";
-import VideoManageData from "@/Pool/VideoManageData";
 export default {
   name: "algorithmManage",
   props: {},
@@ -259,107 +485,80 @@
     FileUploader
   },
   computed: {
-    notInstalledList() {
-      return this.TaskMange.list1.filter(sdk => {
-        return sdk.installed === false;
-      });
+    // notInstalledList () {
+    //   return this.sdkList.filter(sdk => {
+    //     return sdk.installed === false;
+    //   });
+    // },
+    // installedList () {
+    //   return this.sdkList.filter(sdk => {
+    //     return sdk.installed === true && !sdk.isUpgrade;
+    //   });
+    // },
+    // ungradeList () {
+    //   // 鍗囩骇澶勭悊浼氬鑷撮噸澶嶇殑key,闇�瑕佷慨鏀�
+    //   let arr = this.sdkList.filter(sdk => {
+    //     return sdk.isUpgrade === true;
+    //   });
+    //   arr.forEach(sdk => {
+    //     sdk.upgradeLoading = false;
+    //   });
+    //   return arr;
+    // },
+    isAdmin() {
+      if (
+        sessionStorage.getItem("userInfo") &&
+        sessionStorage.getItem("userInfo") !== ""
+      ) {
+        let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
+        return loginName === "superadmin" || loginName === "basic";
+      }
+
+      return false;
     },
-    installedList() {
-      return this.TaskMange.list1.filter(sdk => {
-        return sdk.installed === true;
-      });
-    },
-    ungradeList() {
-      // 鍗囩骇澶勭悊浼氬鑷撮噸澶嶇殑key,闇�瑕佷慨鏀�
-      return [];
-      return this.TaskMange.list1.filter(sdk => {
-        return sdk.isUpgrade === true;
-      });
-    }
   },
   data() {
     return {
-      TaskMange: new TaskManage,
-      VideoManageData: new VideoManageData,
+      sdkList: [],
+      installedList: [],
+      ungradeList: [],
+      notInstalledList: [],
+      buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [],
       activeName: "myAlgorithm",
       patchUpdateStatus: "",
-      dragging: false,
-      list1: [
-        {
-          sdk_name: "浜鸿劯鎻愬彇"
-        }
-      ],
-      list2: [
-        {
-          id: "001",
-          name: "浠诲姟1",
-          child: [
-            {
-              id: "1",
-              sdk_name: "浜鸿劯妫�娴�",
-              isSelect: false
-            },
-            {
-              id: "2",
-              sdk_name: "浜鸿劯瀵规瘮",
-              isSelect: false
-            }
-          ],
-          isSetting: false,
-          isShowSetAlgo: false
-        }
-      ],
-      argsList: [],
-      baseObject: {
-        id: "",
-        algoId: "",
-        options1: [],
-        options2: [],
-        options3: [],
-        value1: "",
-        value2: "",
-        value3: "",
-        unit: ""
-      },
-      currentAlgoId: "",
-      currentTaskId: "",
-      isSuperUser: false,
       downloadItem: "",
       downloading: false,
-      sceneDialogVisible: false,
-      dialogTitle: '',
       direction: "rtl",
       actDrawerShow: false,
       actStep: 0,
       activeCode: "",
-      sceneTemplates: [],
-      appSceneForm: {
-        id: "",
-        name: "",
-        desc: "",
-        rules: "",
-        txt: ""
-      },
-      sceneSdks: [],
-      sceneRuleList: "",
       isInstall: false,
-      installPercentage: 0
-    }
-  },
-  watch: {
-    list2: {
-      handler(newVal, oldVal) {
-        // window.console.log(newVal, oldVal, '鐩戝惉list2')
-        if (newVal !== oldVal) {
-          // window.console.log(newVal, '鐩戝惉list2')
-          newVal.map((i, index) => {
-            i.child.map(j => {
-              this.$set(j, "parentId", i.id);
-            });
-          });
-        }
+      installDialogVisible: false,
+      installPackage: {},
+      installAppPackage: null,
+      installSdkPackage: null,
+      installPercentage: 0,
+      unActivedSDKList: [],
+      unActivedAppList: [],
+      //actSdkId: '',
+      actType: '',
+      actId: '',
+      activedSdkOrApp: {
+        activateCode: '',
+        productName: '',
+        setting: '',
+        expireTime: '',
+        licence: '',
+        devIds: ''
       },
-      deep: true
+      // unloadLoading: false,
+      // installLoading: false,
+      installedApps: [],
+      storeApps: [],
+      installFile: {},
+      freshTimer: null,
+      appUpgreading: false,
+      sdkUpgreading: false
     }
   },
   directives: {
@@ -370,22 +569,214 @@
     }
   },
   mounted() {
-    this.findAllSdk();
-    this.findByType();
-    this.getBaseList();
-    this.findAll();
-    this.getUser();
-    // this.TaskMange.findAllSdk();
-    // this.TaskMange.findByType();
-    this.VideoManageData.init();
+    // 鑾峰彇鎵�鏈夊簲鐢�
+    this.getAllSdk();
+    this.getAllApps();
+
+    this.getUnActivedList();
+    this.getUnActivedAppList();
   },
   methods: {
-    installFormat(percentage) {
-      return percentage === 100 ? '瀹夎鎴愬姛' : `${percentage}%`;
+    isShow(authority) {
+      return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1
+    },
+    //绂荤嚎瀹夎
+    offlineInstall() {
+      this.installDialogVisible = false;
+      this.isInstall = true;
+      //瀹夎
+      installSdk(this.installFile).then(res => {
+        if (res.success) {
+          this.isInstall = false;
+          this.$message({
+            type: 'success',
+            message: '瀹夎鎴愬姛,灏嗚烦杞嚦鎴戠殑绠楁硶涓煡鐪�'
+          });
+          setTimeout(() => {
+            this.getAllSdk();
+            this.getAllApps();
+            window.parent.postMessage({
+              msg: "AppUpdate"
+            }, '*')
+            this.activeName = 'myAlgorithm';
+          }, 3000);
+        }
+
+      }).catch(e => {
+        console.log(e)
+        this.isInstall = false;
+        this.$message({
+          type: 'error',
+          message: e.data
+        });
+      })
+    },
+    downloadApp(app, action) {
+      if (action == 'upgrade') {
+        app.upgradeLoading = true;
+      } else {
+        app.installLoading = true;
+      }
+      let _this = this;
+
+      installApp({ path: app.id }).then(res => {
+        if (res && res.success) {
+          setTimeout(() => {
+            if (action == 'upgrade') {
+              app.upgradeLoading = false;
+              _this.$notify({
+                type: 'success',
+                message: '鍗囩骇鎴愬姛'
+              });
+            } else {
+              app.installLoading = false;
+              _this.$notify({
+                type: 'success',
+                message: '瀹夎鎴愬姛'
+              });
+            }
+            _this.getAllApps();
+            window.parent.postMessage({
+              msg: "AppUpdate"
+            }, '*')
+          }, 3000);
+        }
+      }).catch(e => {
+        console.log(e);
+        if (action == 'upgrade') {
+          app.upgradeLoading = false;
+        } else {
+          app.installLoading = false;
+        }
+      })
+
+      // 寮�鍚嚜鍔ㄥ埛鏂�
+      this.appUpgreading = true;
+      this.startAutoFresh();
+    },
+    async getAllApps() {
+      let iArry = []
+      let sArry = []
+
+      let rsp = await getApps();
+      if (rsp && rsp.success) {
+        // 閬嶅巻app鐨勮繃绋嬮噸缃�
+        this.appUpgreading = false;
+
+        rsp.data.forEach(item => {
+          let obj = Object.assign({ unloadLoading: false, upgradeLoading: false }, item)
+          if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") {
+            obj.upgradeLoading = true;
+
+            this.appUpgreading = true;
+            this.startAutoFresh();
+          }
+
+          item.installed ? iArry.push(obj) : sArry.push(obj)
+        });
+      }
+
+      this.installedApps = iArry;
+      this.storeApps = sArry;
+    },
+    //鍗歌浇搴旂敤
+    unLoad(app) {
+      app.unloadLoading = true;
+      let _this = this;
+      removeApp({ appId: app.id }).then(res => {
+
+        if (res && res.success) {
+          //setTimeout(() => {
+          app.unloadLoading = false;
+          _this.getAllApps();
+          window.parent.postMessage({
+            msg: "AppUpdate"
+          }, '*')
+          //}, 3000);
+        }
+      }).catch(e => {
+        console.log(e);
+        app.unloadLoading = false;
+      })
+
+    },
+    // actSdk (id) {
+    //   this.actSdkId = id;
+    //   this.actDrawerShow = true;
+    //   this.actStep = 0;
+    //   this.activeCode = '';
+    //   this.activedSdkOrApp = this.newActInfo()
+    // },
+    actSdkOrApp(id, type = 'sdk') {
+      this.actType = type;
+      this.actId = id;
+      this.actDrawerShow = true;
+      this.actStep = 0;
+      this.activeCode = '';
+      this.activedSdkOrApp = this.newActInfo()
+    },
+    newActInfo() {
+      return {
+        activateCode: '',
+        productName: '',
+        setting: '',
+        expireTime: '',
+        licence: '',
+        devIds: ''
+      }
+    },
+    getUnActivedList() {
+      getUnActivedSdk().then(res => {
+        if (res.code == 200) {
+          this.unActivedSDKList = res.data;
+        }
+      })
+
+    },
+    getUnActivedAppList() {
+      getUnActivedApp().then(res => {
+        if (res.code == 200) {
+          this.unActivedAppList = res.data;
+        }
+      });
     },
     actived() {
-      //this.activeCode
-      this.actStep++
+      let _this = this;
+      if (this.actType == 'sdk') {
+        //婵�娲荤畻娉�
+        actPageAlg(this.actId, this.activeCode).then(res => {
+          if (res.data.isSuccess) {
+            _this.activedSdkOrApp = res.data.successMsg;
+            _this.actStep++;
+            _this.getUnActivedList();
+            _this.getAllSdk();
+          } else {
+            _this.$notify({
+              type: 'error',
+              message: res.data.failMsg.failMsg
+            });
+          }
+        }).catch(e => {
+          console.log(e)
+        });
+      } else if (this.actType == 'app') {
+        //婵�娲诲簲鐢�
+        actApp(this.actId, this.activeCode).then(res => {
+          if (res.data.isSuccess) {
+            _this.activedSdkOrApp = res.data.successMsg;
+            _this.actStep++;
+            _this.getUnActivedAppList();
+            _this.getAllApps();
+          } else {
+            _this.$notify({
+              type: 'error',
+              message: res.data.failMsg.failMsg
+            });
+          }
+        }).catch(e => {
+          console.log(e)
+        });
+      }
     },
     getCodeDetail() { },
     checkMyAlgorith() {
@@ -397,716 +788,129 @@
       this.patchFile = { ...file };
       this.fileAdded = true;
       const h = this.$createElement;
-      // this.$msgbox({
-      //     title: '绠楁硶淇℃伅',
-      //     message: h('div', null, [
-      //       h('span', null, '绠楁硶鍚嶇О锛� '),
-      //       h('i', { style: 'color: teal' }, file.filename)
-      //     ]),
-      //     showCancelButton: true,
-      //     confirmButtonText: '纭畾',
-      //     cancelButtonText: '鍙栨秷',
-      //     beforeClose: (action, instance, done) => {
-      //       if (action === 'confirm') {
-      //         instance.confirmButtonLoading = true;
-      //         instance.confirmButtonText = '鎵ц涓�...';
-      //         setTimeout(() => {
-      //           done();
-      //           setTimeout(() => {
-      //             instance.confirmButtonLoading = false;
-      //           }, 300);
-      //         }, 3000);
-      //       } else {
-      //         done();
-      //       }
-      //     }
-      //   }).then(action => {
-      //     this.$message({
-      //       type: 'info',
-      //       message: 'action: ' + action
-      //     });
-      //   });
-
-      this.$confirm('', '绠楁硶淇℃伅', {
-        message: `<div class="installInfo">
-                    <div><span>绠楁硶鍚嶇О锛�</span><span>${file.filename}</span></div>
-                    <div><span>瀹夎鐗堟湰锛�</span><span></span></div>
-                    <div><span>鏇存柊鍐呭锛�</span><span></span></div>
-                    <p>纭畾瀹夎姝ょ畻娉曪紵</p>
-                  </div>`,
-        confirmButtonText: '瀹夎',
-        cancelButtonText: '鍙栨秷',
-        dangerouslyUseHTMLString: true,
-        type: ''
-      }).then(() => {
-        this.isInstall = true;
-        //瀹夎
-        installSdk(file).then(res => {
-          if (res.success) {
-            debugger
-            this.isInstall = false;
-            //this.$refs['progressBar'].style.width = 100%
-            //this.installPercentage = 100%
-            this.$message({
-              type: 'success',
-              message: '瀹夎鎴愬姛,灏嗚烦杞嚦鎴戠殑绠楁硶涓煡鐪�'
-            });
-            setTimeout(() => {
-              this.findAllSdk();
-              this.activeName = 'myAlgorithm';
-            }, 3000)
+      //涓婁紶瀹屾垚鑾峰彇瀹夎淇℃伅
+      let _this = this;
+      getInstallInfo(file).then(res => {
+        _this.installFile = file;
+        if (res.success) {
+          _this.installDialogVisible = true;
+          if (res.data.apps.length > 0) {
+            _this.installAppPackage = {
+              appId: res.data.apps[0].appId,
+              version: res.data.apps[0].version,
+              productName: res.data.productName,
+              installContent: res.data.apps[0].installContent
+            }
           }
+          if (res.data.sdks.length > 0) {
+            _this.installSdkPackage = {
+              appId: res.data.sdks[0].sdkId,
+              version: res.data.sdks[0].version,
+              productName: res.data.productName,
+              installContent: res.data.sdks[0].installContent
+            }
+          }
+        }
+      }).catch(e => {
+        this.$message({
+          type: 'error',
+          message: e.data
         });
-      }).catch(() => {
-        console.log('鍙栨秷瀹夎')
       })
 
     },
 
     onFileAdded(f) {
-      debugger;
       this.patchUpdateStatus = "";
     },
-    // 鏍¢獙杈撳叆鐨勬槸鍚︽槸鏁板瓧
-    valiNum(value) {
-      if (value) {
-        let re = /[^\-?\d.]*$/;
-        if (!re.test(value)) {
-          // this.$toast({
-          //   type: "warning",
-          //   message: "璇疯緭鍏ユ暟瀛楋紒"
-          // });
-          this.$notify({
-            title: "鎻愮ず",
-            message: "璇疯緭鍏ユ暟瀛楋紒",
-            type: "warning"
-          });
-        }
-      }
-    },
-    // 宸﹁竟鎷栧姩妯″潡寰楁嫋鍔ㄧ粨鏉熷悗鐨勮Е鍙戝嚱鏁�
-    endLeft(env) {
-      this.dragging = false;
-      let taskId = env.to.id;
-      let sdkId = this.TaskMange.list1[env.oldIndex].id;
-      if (!taskId.length || !sdkId.length) {
-        return;
-      }
-      // 鑾峰彇鍒拌浠诲姟鎵�鍦ㄧ殑鍏冪礌
-      let task = this.TaskMange.list2.find(i => {
-        return i.id === taskId;
-      });
-      let arr = task.child.filter(i => {
-        return i.id === sdkId;
-      });
-      // window.console.log(task, "鎷栬繘鏉ョ殑浠诲姟淇℃伅", sdkId, arr);
-      if (arr && arr.length >= 2) {
-        // this.$toast({
-        //   type: "warning",
-        //   message: "璇ョ畻娉曞凡瀛樺湪锛�"
-        // });
-        this.$notify({
-          title: "鎻愮ず",
-          message: "璇ョ畻娉曞凡瀛樺湪锛�",
-          type: "warning"
-        });
-        task.child.splice(env.newIndex, 1);
-        return true;
-      }
-      let list = task.child.map((i, index) => {
-        let obj = {};
-        obj.sdkId = i.id;
-        obj.sort = index + 1;
-        return obj;
-      });
-      let json = {
-        taskId: taskId,
-        sdks: list
-      };
-      this.addTaskSdk(json);
-    },
-    // 鍙宠竟鎷栧姩妯″潡寮�濮嬫嫋鍔ㄨЕ鍙戝嚱鏁�
-    startRight(env) {
-      this.$nextTick(() => {
-        this.dragging = true;
-      });
-      // window.window.console.log(env, "right start");
-    },
-    // 鍙宠竟鎷栧姩妯″潡鎷栧姩缁撴潫瑙﹀彂鍑芥暟
-    endRight(env) {
-      // window.window.console.log(env, "right end");
-    },
-    clickSet(data) {
-      if (data.isSetting) {
-        data.isSetting = false;
-      } else {
-        data.isSetting = true;
-      }
-    },
-    clickDel(data, Index) {
-      this.$confirm("鎻愮ず锛氬垹闄ゅ悗锛屾浠诲姟鍦ㄦ憚鍍忔満涓殑搴旂敤澶辨晥锛屾槸鍚﹀垹闄わ紵", {
-        center: true,
-        showConfirmButton: true,
-        showCancelButton: true,
-        confirmButtonClass: "comfirm-class-sure",
-        cancelButtonClass: "comfirm-class-cancle"
-      })
-        .then(() => {
-          this.deleteTask(data);
-        })
-        .catch(err => { });
-    },
-    clickSetAlgo(row, data) {
-      // window.console.log(row, data, "缂栬緫浠诲姟涓煇涓�涓畻娉�");
-      if (row.isShowSetAlgo && data.id === this.TaskMange.currentAlgoId) {
-        row.isShowSetAlgo = false;
-        data.isSelect = false;
-        return false;
-      }
-      if (data.id !== this.TaskMange.currentAlgoId) {
-        let isEdit = false;
-        if (this.argsList && this.argsList.length !== 0) {
-          this.TaskMange.argsList.map((i, index) => {
-            if (i.value2 !== this.argsList[index].value2) {
-              isEdit = true;
-            }
-            if (i.value3 !== this.argsList[index].value3) {
-              isEdit = true;
-            }
-          });
-        }
-        if (isEdit) {
-          this.$notify({
-            title: "鎻愮ず",
-            message: "璇峰厛淇濆瓨鏈繚瀛樼殑閰嶇疆锛�",
-            type: "warning"
-          });
-          return false;
-        } else {
-          let task = this.TaskMange.list2.find(element => {
-            return element.isShowSetAlgo;
-          });
-          // console.log(task, '鏄惁鏈夊凡缁忔墦寮�缂栬緫鐨�')
-          if (task !== undefined) {
-            this.$set(task, "isShowSetAlgo", false);
-            task.child.map(i => {
-              this.$set(i, "isSelect", false);
-            });
-          }
-        }
-      }
-      this.TaskMange.currentAlgoId = data.id;
-      this.TaskMange.currentTaskId = row.id;
-      let task = this.TaskMange.list2.find(element => {
-        return element.isShowSetAlgo;
-      });
-      if (task === undefined) {
-        this.getSdkArgs(data).then(() => {
-          this.getRulesByTaskSdk(row.id, data.id);
-        });
-        if (row.isShowSetAlgo) {
-          row.isShowSetAlgo = false;
-        } else {
-          row.isShowSetAlgo = true;
-          data.isSelect = true;
-        }
-      } else {
-        // this.$toast({
-        //   type: "warning",
-        //   message: "璇峰厛淇濆瓨鏈繚瀛樼殑閰嶇疆锛�"
-        // });
-        // this.$notify({
-        //   title: "鎻愮ず",
-        //   message: "璇峰厛淇濆瓨鏈繚瀛樼殑閰嶇疆锛�",
-        //   type: "warning"
-        // });
-      }
-    },
-    async getRulesByTaskSdk(taskId, sdkId) {
-      let res = await getRulesByTaskSdk({
-        taskId: taskId,
-        sdkId: sdkId
-      });
-      if (res && res.success) {
-        if (res.data.rules && res.data.rules.length !== 0) {
-          this.TaskMange.argsList = res.data.rules.map((i, index) => {
-            let sdk = res.data.argList.find(j => {
-              return j.alias === i.sdk_arg_alias;
-            });
-            let obj = JSON.parse(JSON.stringify(this.TaskMange.baseObject));
-            obj.value1 = i.sdk_arg_alias ? i.sdk_arg_alias : "";
-            obj.value2 = i.operator ? i.operator : "";
-            obj.value3 = i.sdk_arg_value ? i.sdk_arg_value : "";
-            obj.unit = sdk.unit ? sdk.unit : "";
-            obj.id = i.Id ? i.Id : "";
-            obj.algoId = sdkId;
-            return obj;
-          });
-        } else {
-          this.TaskMange.argsList = res.data.argList.map(i => {
-            let obj = JSON.parse(JSON.stringify(this.TaskMange.baseObject));
-            obj.value1 = i.alias ? i.alias : "";
-            obj.value2 = i.default_operator ? i.default_operator : "";
-            obj.value3 = i.default_value ? i.default_value : "";
-            obj.unit = i.unit ? i.unit : "";
-            obj.id = "";
-            obj.algoId = sdkId;
-            return obj;
-          });
-        }
-        // window.console.log(res, '鏌ユ壘绠楁硶瑙勫垯', this.argsList)
-        this.argsList = JSON.parse(JSON.stringify(this.TaskMange.argsList));
-      }
-    },
-    async findAllSdk() {
+
+    async getAllSdk() {
+      let installedList = [];
+      let unInstalledList = [];
       let res = await findAllSdk();
       if (res && res.success) {
-        // debugger
-        this.TaskMange.list1 = res.data.map((i, index) => {
-          this.$set(i, "isEdit", false);
-          //mock 鏈畨瑁�/寰呭崌绾�
-          // if (index == 1 || index == 2) {
-          //   this.$set(i, "isUpgrade", true);
-          // }
-          // if (index == 3 || index == 4) {
-          //   this.$set(i, "installed", false);
-          // }
-          //mock end
-          return i;
-        });
-      }
-    },
-    addTask() {
-      let obj = {
-        id: "",
-        name: "浠诲姟" + this.TaskMange.list2.length,
-        child: [],
-        isSetting: false,
-        isShowSetAlgo: false
-      };
-      // window.console.log(this.TaskMange.list2, "addTask");
-      this.TaskMange.list2.push(obj);
-      this.addTaskAsync(obj.name);
-      this.$nextTick(() => {
-        let taskArea = document.getElementById("taskArea");
-        taskArea.scrollTop = taskArea.scrollHeight;
-      });
-    },
-    async findAll() {
-      let res = await findAll();
-      if (res && res.success) {
-        if (res.data && res.data.length !== 0) {
-          let list = res.data.map(i => {
-            let obj = {};
-            obj.id = i.task.taskid;
-            obj.name = i.task.taskname;
-            obj.enable = i.task.enable;
-            obj.is_alarm = i.task.is_alarm;
-            obj.child = [];
-            if (i.sdks && i.sdks.length !== 0) {
-              obj.child = i.sdks.map(j => {
-                let t = {};
-                t.id = j.id;
-                t.ipc_id = j.ipc_id;
-                if (i.sdks.length == 1) {
-                  t.sdk_name = i.task.taskname;
-                  // console.log("鍗曚釜sdk绠楁硶锛�",t.sdk_name)
-                } else {
-                  t.sdk_name = j.sdk_name;
-                  // console.log("澶氫釜sdk绠楁硶锛�",t.sdk_name)
-                }
-                t.icon = j.icon;
-                t.enable = j.enable;
-                t.isSelect = false;
-                return t;
-              });
-            }
-            obj.isSetting = false;
-            obj.isShowSetAlgo = false;
-            return obj;
-          });
-          this.TaskMange.list2 = list;
-        }
-      }
-    },
-    clickDelSdk(task, sdk) {
-      this.$confirm(
-        "鎻愮ず锛氬垹闄ゅ悗锛屾绠楁硶鍦ㄦ湰浠诲姟涓Щ闄わ紝鍚屾椂鍦ㄦ憚鍍忔満涓殑搴旂敤澶辨晥锛屾槸鍚﹀垹闄わ紵",
-        {
-          center: true,
-          showConfirmButton: true,
-          showCancelButton: true,
-          confirmButtonClass: "comfirm-class-sure",
-          cancelButtonClass: "comfirm-class-cancle"
-        }
-      )
-        .then(() => {
-          this.delTaskSdk(task, sdk);
-        })
-        .catch(err => { });
-    },
-    selectChange(event, type, data) {
-      if (type === "options1") {
-        // window.window.console.log(type, data, "閫夋嫨涓嬫媺妗�");
-        data.options1.map(i => {
-          if (i.value === data.value1) {
-            this.$set(data, "unit", i.unit ? i.unit : "");
+
+        res.data.forEach(item => {
+          let obj = Object.assign({ unloadLoading: false, upgradeLoading: false }, item)
+          if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") {
+            obj.upgradeLoading = true;
+
+            this.appUpgreading = true;
+            this.startAutoFresh();
           }
+
+          //绠楁硶杞欢 宸插畨瑁呭叾涓寘鍚緟鍗囩骇 鏈畨瑁�
+          item.installed ? installedList.push(obj) : unInstalledList.push(obj)
+
         });
-      }
-    },
-    // 鍒犻櫎浠诲姟绠楁硶
-    async delTaskSdk(task, sdk) {
-      let json = {
-        taskId: task.id,
-        sdkId: sdk.id
-      };
-      let res = await delTaskSdk(json);
-      if (res && res.success) {
-        // this.$toast({
-        //   type: "success",
-        //   message: "鍒犻櫎浠诲姟绠楁硶鎴愬姛!"
+
+
+        // this.sdkList = res.data.map((i, index) => {
+        //   if (i.progressMsg !== "" && i.progressMsg !== "宸插畨瑁�") {
+        //     i.upgradeLoading = true;
+
+        //     this.appUpgreading = true;
+        //     this.startAutoFresh();
+        //   }
+        //   this.$set(i, "isEdit", false);
+        //   return i;
         // });
-        this.$notify({
-          title: "鎴愬姛",
-          message: "鍒犻櫎浠诲姟绠楁硶鎴愬姛!",
-          type: "success"
-        });
-        this.findAll();
       }
+      this.installedList = installedList;
+      this.notInstalledList = unInstalledList;
     },
-    // 鍒犻櫎浠诲姟
-    async deleteTask(data, index) {
-      // window.console.log(data, "deleteTask");
-      let res = await deleteTask({ taskId: data.id });
-      // this.$toast({
-      //   type: res.success ? "success" : "error",
-      //   message: res.msg
-      // });
-      this.$notify({
-        title: res.success ? "鎴愬姛" : "澶辫触",
-        message: res.msg,
-        type: res.success ? "success" : "error"
-      });
-      if (data.id && res.success) {
-        this.findAll();
-      }
-    },
-    // 鏇存柊浠诲姟鐘舵��
-    async updateTaskStatus(data) {
-      // window.console.log(data, '鏇存柊浠诲姟鐘舵��')
-      let json = {
-        taskId: data.id,
-        enable: data.enable
-      };
-      let res = await updateTaskStatus(json);
-      // this.$toast({
-      //   type: res.success ? "success" : "error",
-      //   message: res.msg
-      // });
-      this.$notify({
-        title: res.success ? "鎴愬姛" : "澶辫触",
-        message: res.msg,
-        type: res.success ? "success" : "error"
-      });
-    },
-    // 鏇存柊浠诲姟鍚嶇О
-    async updateTaskName(data) {
-      let json = {
-        taskId: data.id,
-        taskName: data.name
-      };
-      let res = await updateTaskName(json);
-      // this.$toast({
-      //   type: res.success ? "success" : "error",
-      //   message: res.msg
-      // });
-      this.$notify({
-        title: res.success ? "鎴愬姛" : "澶辫触",
-        message: res.msg,
-        type: res.success ? "success" : "error"
-      });
-      if (res && res.success) {
-        this.$set(data, "isSetting", false);
-      }
-    },
-    // 鑾峰彇搴曞簱鏁版嵁
-    async getBaseList() {
-      // let res = await getTagList();
-      // if (res && res.success) {
-      //   let filter = res.data.filter(i => {
-      //     return i.status === 0;
-      //   });
-      //   let list = filter.map(i => {
-      //     let obj = {};
-      //     obj.id = i.key;
-      //     obj.name = i.title;
-      //     obj.value = i.value;
-      //     return obj;
-      //   });
-      //   list.unshift({
-      //     id: "",
-      //     name: "鍏ㄩ儴搴曞簱",
-      //     value: ""
-      //   })
 
-      //   // this.TaskMange.baseObject.options3 = [...all, ...list];
-      //   this.TaskMange.baseObject.options3 = [...list];
-      // }
-
-      this.TaskMange.baseObject.options3 = [
-        { id: true, name: true, value: true },
-        { id: false, name: false, value: false }
-      ];
-    },
-    // 鑾峰彇绠楁硶鍙傛暟
-    async getSdkArgs(data) {
-      let res = await getSdkArgs({
-        sdkId: data.id,
-        scope: "TASKRULE"
-      });
-      if (res && res.success) {
-        // window.console.log(res, "鏌ヨ绠楁硶鍙傛暟");
-        let list = res.data.map(i => {
-          let obj = {};
-          obj.name = i.name;
-          obj.id = i.alias;
-          obj.value = i.alias;
-          obj.unit = i.unit;
-          obj.must = i.must;
-          obj.range = i.range;
-          obj.sort = i.sort;
-          return obj;
-        });
-        this.TaskMange.baseObject.options1 = [...list];
-      }
-    },
-    // 鏌ヨ瀛楀吀
-    async findByType() {
-      let res = await findByType();
-      if (res && res.success) {
-        let list = res.data.RULECOMPUTEBETWEEN.map(i => {
-          let obj = {};
-          obj.name = i.name;
-          obj.value = i.value;
-          return obj;
-        });
-        this.TaskMange.baseObject.options2 = [...list];
-      }
-    },
-    // 绠楁硶閰嶇疆锛屾柊寤�
-    add() {
-      this.TaskMange.argsList.push(
-        JSON.parse(JSON.stringify(this.TaskMange.baseObject))
-      );
-    },
-    // 绠楁硶閰嶇疆 鍒犻櫎
-    delRule(index) {
-      this.TaskMange.argsList.splice(index, 1);
-    },
-    // 绠楁硶鍙傛暟淇濆瓨
-    async save() {
-      let list = this.TaskMange.argsList.map(i => {
-        let obj = {};
-        obj.id = i.id;
-        obj.operator = i.value2;
-        obj.sdk_arg_alias = i.value1;
-        obj.sdk_arg_value = i.value3;
-        return obj;
-      });
-      let json = {
-        rules: list,
-        sdkId: this.TaskMange.currentAlgoId,
-        taskId: this.TaskMange.currentTaskId
-      };
-      let res = await saveTaskSdkRule(json);
-      this.$notify({
-        title: "鎻愮ず",
-        type: res.success ? "success" : "error",
-        message: res.msg
-      });
-      if (res && res.success) {
-        let task = this.TaskMange.list2.find(i => {
-          return i.id === this.TaskMange.currentTaskId;
-        });
-        if (task) {
-          this.$set(task, "isShowSetAlgo", false);
-          this.TaskMange.argsList = [];
-          task.child.map(i => {
-            this.$set(i, "isSelect", false);
-          });
-        }
-      }
-    },
-    getDefault() {
-      this.deleteTaskSdkRule(
-        this.TaskMange.currentTaskId,
-        this.TaskMange.currentAlgoId
-      ).then(() => {
-        this.getRulesByTaskSdk(
-          this.TaskMange.currentTaskId,
-          this.TaskMange.currentAlgoId
-        );
-      });
-    },
-    async deleteTaskSdkRule(taskId, sdkId) {
-      let json = {
-        taskId: taskId,
-        sdkId: sdkId
-      };
-      let res = await deleteTaskSdkRule(json);
-      // this.$toast({
-      //   type: res.success ? "success" : "error",
-      //   message: res.msg
-      // });
-      this.$notify({
-        title: res.success ? "鎴愬姛" : "澶辫触",
-        message: res.msg,
-        type: res.success ? "success" : "error"
-      });
-      if (res && res.success) {
-        // window.console.log(res, "鎭㈠榛樿鍊�");
-      }
-    },
-    // 缁欎换鍔℃坊鍔犵畻娉�
-    async addTaskSdk(data) {
-      let res = await addTaskSdk(data);
-      if (res && res.success) {
-        // window.console.log(res, 'res')
-        this.findAll();
-      }
-    },
-    // 鏂版坊鍔犱换鍔�
-    async addTaskAsync(name) {
-      let res = await addTask({ taskname: name });
-      // this.$toast({
-      //   type: res.success ? "success" : "error",
-      //   message: res.msg
-      // });
-      // window.console.log(res, "addTaskAsync");
-      this.$notify({
-        title: res.success ? "鎴愬姛" : "澶辫触",
-        message: res.msg,
-        type: res.success ? "success" : "error"
-      });
-      if (res && res.success) {
-        this.findAll();
-      }
-    },
-    cancle(row) {
-      if (row.isShowSetAlgo) {
-        row.isShowSetAlgo = false;
-      }
-      this.TaskMange.argsList = [];
-      this.TaskMange.currentAlgoId = "";
-      row.child.map(i => {
-        this.$set(i, "isSelect", false);
-      });
-    },
-    cancleTask(row) {
-      if (row.isSetting) {
-        row.isSetting = false;
-      }
-    },
-    commandAlgo(command, row, item) {
-      if (command === 1) {
-        // console.log('璁剧疆绠楁硶')
-        this.clickSetAlgo(row, item);
-      }
-      if (command === 2) {
-        // console.log('鍒犻櫎绠楁硶')
-        this.clickDelSdk(row, item);
-      }
-    },
-    commandTask(command, row) {
-      if (command === 1) {
-        //缂栬緫浠诲姟
-        this.clickSet(row);
-      }
-    },
-    getUser() {
-      // console.log("鐧诲綍鐢ㄦ埛",JSON.parse(sessionStorage.getItem("userInfo")).username)
-      if (
-        sessionStorage.getItem("userInfo") &&
-        (JSON.parse(sessionStorage.getItem("userInfo")).username ==
-          "superadmin" ||
-          JSON.parse(sessionStorage.getItem("userInfo")).username == "basic")
-      ) {
-        this.isSuperUser = true;
-      } else {
-        this.isSuperUser = false;
-      }
-    },
     donwload(item) {
-      this.downloading = true;
+      item.upgradeLoading = true;
+      //this.downloading = true;
       this.downloadItem = item.id;
 
       downloadSdk({ path: item.id })
         .then(rsp => {
-          this.$notify({
-            type: "success",
-            message: "绠楁硶宸插畨瑁�"
-          });
-          this.downloading = false;
+          // this.$notify({
+          //   type: "success",
+          //   message: "绠楁硶宸插畨瑁�"
+          // });
+          item.upgradeLoading = false;
+          //this.downloading = false;
           this.downloadItem = "";
-          this.findAllSdk();
+          this.getAllSdk();
         })
         .catch(err => {
           this.$notify({
             type: "warning",
             message: err.data
           });
-
-          this.downloading = false;
+          item.upgradeLoading = false;
+          //this.downloading = false;
           this.downloadItem = "";
         });
-    },
-    commandAlgLib(item) {
-      this.$set(item, "isEdit", true);
+      // 寮�鍚嚜鍔ㄥ埛鏂�
+      this.appUpgreading = true;
+      this.startAutoFresh();
     },
     inputBlur(item) {
       // console.log(item, '淇敼鍚嶇О')
       this.$set(item, "isEdit", false);
     },
-    
-    cleanTemplateForm() {
-      this.appSceneForm.name = "";
-      this.appSceneForm.desc = "";
-      this.appSceneForm.rules = "";
-      this.appSceneForm.txt = "";
-
-      this.$refs.ruleEditor.cleanRule();
-    },
     handleTabClick() {
-     
-    },
-    handleCreateScene() {
-      this.sceneDialogVisible = true;
-      this.dialogTitle = '鍒涘缓鍦烘櫙妯℃澘';
 
-      this.sceneSdks = this.TaskMange.list1.filter(sdk => {
-        return sdk.installed === true;
-      });
-      this.sceneRuleList = "";
+    },
+    startAutoFresh() {
+      if (this.freshTimer) {
+        clearTimeout(this.freshTimer)
+      }
 
-      this.$nextTick(() => {
-        this.cleanTemplateForm();
-      });
-    },
-    handleDialogClose() {
-      this.sceneDialogVisible = false;
-    },
-    handleEditScene(item) {
-      this.appSceneForm.name = item.name;
-      this.appSceneForm.desc = item.desc;
+      if (!this.appUpgreading && !this.sdkUpgreading) {
+        this.freshTimer = -1
+        return
+      }
 
-      this.sceneSdks = item.sdks;
-      this.sceneRuleList = item.rules;
-      this.sceneDialogVisible = true;
-      this.dialogTitle = '缂栬緫鍦烘櫙妯℃澘';
-    },
-   
-    
+      this.getAllSdk()
+      this.getAllApps()
+
+      this.freshTimer = setTimeout(this.startAutoFresh, 5 * 1000)
+    }
   }
 };
 </script>
@@ -1116,16 +920,8 @@
   height: 100%;
   box-sizing: border-box;
   text-align: left;
-  // background-color: #f2f6fc;
-  .s-video-manage-breadcrumb {
-    height: 5%;
-    box-sizing: border-box;
-    border: 1px solid #e4e7ed;
-    background-color: rgb(255, 255, 255);
-    -webkit-box-shadow: #e4e7ed 0px 0px 9px inset;
-    box-shadow: #e4e7ed 0px 0px 9px inset;
-    border-radius: 5px;
-  }
+  min-width: 1106px;
+
   .el-tabs {
     height: calc(100% - 50px);
     // margin-top: 5px !important;
@@ -1152,20 +948,43 @@
     height: 100%;
   }
 }
-.el-breadcrumb__inner {
-  font-weight: bold;
-  color: #606266;
-  cursor: pointer;
-}
 
+.el-loading-mask .el-loading-spinner {
+  top: 40px !important;
+}
+.el-loading-mask .el-loading-spinner svg {
+  transform: none !important;
+  top: 20px !important;
+  left: 40% !important;
+}
+.el-loading-mask .el-loading-spinner p.el-loading-text {
+  display: block !important;
+  text-align: center !important;
+  bottom: 10px !important;
+  top: 80px !important;
+  right: 0 !important;
+  color: #78adf7;
+}
+.el-loading-mask .el-loading-spinner .path {
+  stroke: #78adf7;
+}
 .installInfo {
   text-indent: 2em;
   font-size: 14px;
-  color: #777;
+  line-height: 26px;
   p {
     text-align: center;
-    color: #666;
   }
+}
+.src-title {
+  //color: #bfbfbf;
+  color: #bbcee8;
+  font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC";
+  font-weight: 650;
+  font-style: normal;
+  height: 36px;
+  font-size: 15px;
+  padding-left: 25px;
 }
 .task-manage {
   height: 100%;
@@ -1216,16 +1035,8 @@
   //     width: 58% !important;
   //   }
   // }
-  .edit-rules-box {
-    padding: 0 2px 0 13px;
-  }
-  .common {
-    .rigth-box {
-      width: 90% !important;
-    }
-  }
-  .super,
-  .common {
+
+  .super {
     width: 100%;
     height: 100%;
     .title {
@@ -1240,7 +1051,15 @@
       height: 100%;
       box-sizing: border-box;
       // float: left;
-
+      .el-drawer__header {
+        border-bottom: 2px solid #eee;
+        padding-bottom: 10px;
+        font-size: 16px;
+        margin-bottom: 0px;
+        span {
+          outline: none !important;
+        }
+      }
       .action-bar {
         margin-bottom: 30px;
         .el-input {
@@ -1248,211 +1067,47 @@
         }
       }
       .task-list {
-        background: #fff;
-        padding: 30px 20px 20px;
+        background: #fdfdfd;
+        padding: 20px;
         box-sizing: border-box;
+
         .flex-list {
           display: flex;
           flex-direction: row;
           flex-wrap: wrap;
-          // justify-content: space-around;
-          // align-content: space-around;
-          // &:after {
-          //   content: "";
-          //   flex: auto;
-          // }
           .wrap-box {
             width: 16.66%;
           }
           .list-choose-item-left {
-            // width: 220px;
-            // height: 214px;
             width: 80%;
             height: auto;
             margin: auto;
             margin-bottom: 30px;
-            // @media screen and(min-width: 1895px) {
-            //   //margin: 20px 25px 20px 20px;
-            //   width: 230px;
-            //   height: 224px;
-            // }
-            // @media screen and(min-width: 1695px) and(max-width:1895px ) {
-            //   margin: 20px 10px 20px 15px;
-            // }
-            // @media screen and(min-width: 1460px) and(max-width: 1695px) {
-            //   margin: 20px 25px 20px 20px;
-            // }
-            // @media screen and(max-width: 1460px) {
-            //   margin: 20px 15px 20px 10px;
-            // }
-          }
-        }
-      }
-      .appScenarios-list {
-        display: flex;
-        flex-wrap: wrap;
-        .wrap-box {
-          width: 16.6%;
-          margin-bottom: 30px;
-          .inner {
-            width: 80%;
-
-            box-sizing: border-box;
-            position: relative;
-            font-size: 14px;
-            padding: 20px 0 50px;
-            transition: all 1s;
-            background: #ffffff;
-            border: 1px solid #e2e2e2;
-            box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07);
-            border-radius: 4px;
-            margin: auto;
-            &:hover {
-              .mask {
-                display: block;
-              }
-            }
+            max-width: 200px;
             .mask {
-              position: absolute;
-              top: 0;
-              left: 0;
               width: 100%;
-              height: 100%;
-              background: rgba(0, 0, 0, 0.65);
-              backdrop-filter: blur(1px) brightness(100%);
-              text-align: center;
-              z-index: 1;
-              border-radius: 3px;
-              display: none;
-              .tool {
-                position: absolute;
-                top: 49%;
-                left: 50%;
-                transform: translate(-50%, -50%);
-                i {
-                  font-size: 50px;
-                }
-                i:nth-of-type(1) {
-                  margin-right: 30px;
-                }
-                i:nth-of-type(2) {
-                  color: red;
-                }
+
+              .el-button + .el-button {
+                margin-left: 0 !important;
               }
-            }
-            .scenario-icon {
-              display: flex;
-              width: 100%;
-              height: 100%;
-              margin: auto;
-              justify-content: center;
-              align-content: center;
-              align-items: center;
-              .single,
-              .double,
-              .third,
-              .four {
-                width: 80%;
-                padding-top: 80%;
-                position: relative;
-                margin: auto;
-                display: flex;
-                flex-wrap: wrap;
-                justify-content: center;
-                .svg-wrap {
-                  width: 50%;
-                  position: absolute;
-                  height: 0;
-                  padding-top: 50%;
-                  text-align: center;
-                  box-shadow: 0 0 3px 2px rgb(247, 247, 247) inset;
-                  svg {
-                    position: absolute;
-                    top: 50%;
-                    left: 50%;
-                    transform: translate(-50%, -50%);
-                  }
-                  .baseImg {
-                    position: absolute !important;
-                    top: 50%;
-                    left: 50%;
-                    transform: translate(-50%, -50%);
-                  }
-                }
-              }
-              .single {
-                margin: auto;
-                .svg-wrap {
-                  top: 50%;
-                  left: 50%;
-                  transform: translate(-50%, -50%);
-                  box-shadow: none;
-                }
-              }
-              .double {
-                .svg-wrap:nth-of-type(1) {
-                  top: 50%;
-                  transform: translateY(-50%);
-                  left: 0;
-                }
-                .svg-wrap:nth-of-type(2) {
-                  top: 50%;
-                  transform: translateY(-50%);
-                  right: 0;
-                }
-              }
-              .third {
-                .svg-wrap:nth-of-type(1) {
-                  top: 0;
-                  left: 0;
-                }
-                .svg-wrap:nth-of-type(2) {
-                  top: 0;
-                  right: 0;
-                }
-                .svg-wrap:nth-of-type(3) {
-                  top: 50%;
-                  left: 50%;
-                  transform: translateX(-50%);
-                }
-              }
-              .four {
-                .svg-wrap:nth-of-type(1) {
-                  top: 0;
-                  left: 0;
-                }
-                .svg-wrap:nth-of-type(2) {
-                  top: 0;
-                  right: 0;
-                }
-                .svg-wrap:nth-of-type(3) {
-                  top: 50%;
-                  left: 0;
-                }
-                .svg-wrap:nth-of-type(4) {
-                  top: 50%;
-                  right: 0;
-                }
-              }
-            }
-            .scenario-name {
-              width: 100%;
-              height: 36px;
-              line-height: 36px;
-              text-align: center;
-              position: absolute;
-              bottom: 10px;
-              left: 0;
             }
           }
         }
       }
-      .store-list {
+      .store-list,
+      .app-list {
         display: flex;
         flex-wrap: wrap;
         .wrap-box {
           width: 16.6%;
           margin-bottom: 30px;
+          .list-choose-item-left {
+            width: 80%;
+            height: auto;
+            margin: auto;
+            margin-bottom: 30px;
+            max-width: 200px;
+          }
           .inner {
             width: 80%;
             box-sizing: border-box;
@@ -1557,6 +1212,7 @@
         }
         .text-right {
           padding-right: 30px;
+          text-align: right;
           .tip {
             color: #999;
             line-height: 38px;
@@ -1566,22 +1222,6 @@
       .tab-content {
         padding: 30px 20px;
       }
-    }
-
-    .right-box {
-      height: 100%;
-      padding: 10px 10px;
-      box-sizing: border-box;
-      float: left;
-      .task-manage-table {
-        height: calc(100% - 30px);
-        margin-top: 5px;
-        overflow-x: hidden;
-        overflow-y: auto;
-      }
-      // .task-manage-table::-webkit-scrollbar {
-      //   width: 0 !important ;
-      // }
     }
     .mask {
       position: absolute;
@@ -1593,7 +1233,13 @@
       z-index: 1;
       border-radius: 3px;
       display: none;
-
+      .info-onmask {
+        color: #8ecaff;
+      }
+      .mask-btn {
+        width: 100%;
+        display: flex;
+      }
       i {
         color: #fff;
         position: relative;
@@ -1657,28 +1303,9 @@
       cursor: pointer;
       position: relative;
       font-size: 14px;
-      // display: inline-block;
-      // @media screen and(min-width: 1895px) {
-      //   //margin: 20px 25px 20px 20px;
-      //   margin: 20px 30px 20px 20px;
-      // }
-      // @media screen and(min-width: 1695px) and(max-width:1895px ) {
-      //   margin: 20px 10px 20px 15px;
-      // }
-      // @media screen and(min-width: 1460px) and(max-width: 1695px) {
-      //   margin: 20px 25px 20px 20px;
-      // }
-      // @media screen and(max-width: 1460px) {
-      //   margin: 20px 15px 20px 10px;
-      // }
-      // width: 126px;
-      // height: 120px;
-      // width: 220px;
-      // height: 214px;
+
       transition: all 1s;
       background: #ffffff;
-      border: 1px solid #e2e2e2;
-      box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07);
       border-radius: 4px;
       p {
         display: none;
@@ -1698,8 +1325,15 @@
       .mask {
         display: flex;
         align-items: flex-end;
+        flex-wrap: wrap;
+        justify-content: center;
+        top: 0;
         .bot-btn {
           flex: 1;
+        }
+        &.flex-center {
+          align-items: center;
+          justify-content: center;
         }
       }
     }
@@ -1813,11 +1447,12 @@
       color: #222222;
     }
     .alg-name {
-      margin-top: 12px;
+      //margin-top: 12px;
       line-height: 36px;
       font-family: PingFangSC-Regular;
-      font-size: 15px;
-      color: #222222;
+      font-size: 14px;
+      letter-spacing: 0.05em;
+      color: #3e4664;
       // background-color: #ecf5ff;
       .el-input {
         position: relative;
@@ -1825,16 +1460,6 @@
         display: inline-block;
         width: 100%;
       }
-    }
-    .task-name {
-      text-align: center;
-      margin-top: 16px;
-      line-height: 28px;
-      font-family: PingFangSC-Regular;
-      font-size: 13px;
-      color: #222222;
-      text-align: center;
-      // background-color: #ecf5ff;
     }
     .unit-class {
       margin-left: 10px;
@@ -1849,13 +1474,16 @@
     }
     .list-complete-item-handle {
       height: 100%;
-      padding-bottom: 10px;
+      //padding-bottom: 10px;
       text-align: center;
       .svg-wrap {
-        width: 80%;
+        //width: 80%;
+        width: 100%;
         margin: auto;
         padding-top: 80%;
+        padding-top: 100%;
         position: relative;
+        box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07);
         svg {
           position: absolute;
           top: 50%;
@@ -1863,10 +1491,31 @@
           transform: translate(-50%, -50%);
         }
         .baseImg {
+          width: 56%;
           position: absolute;
           top: 50%;
           left: 50%;
           transform: translate(-50%, -50%);
+          max-width: 106px;
+          max-height: 106px;
+        }
+      }
+      .willUpGrade {
+        .iconupdate {
+          color: #01e667;
+          position: absolute;
+          top: 5px;
+          right: 5px;
+          font-weight: 550;
+          font-size: 26px;
+        }
+      }
+      &.uninstall {
+        .svg-wrap {
+          background-color: #ddd;
+        }
+        .alg-name {
+          color: darkgray;
         }
       }
     }

--
Gitblit v1.8.0