heyujie
2021-03-24 6e3d8234a4b1bae86b3c896468e20ea9f13c7fb7
src/pages/ai/index/App.vue
@@ -70,7 +70,7 @@
                                >
                                <el-button
                                  v-if="item.isUpgrade"
                                  @click="donwload(item)"
                                  @click="donwload(item,0)"
                                  type="warning"
                                  size="small"
                                  class="bot-btn"
@@ -133,7 +133,7 @@
                              </div>
                              <div class="mask-btn">
                                <el-button
                                 @click="donwload(item)"
                                 @click="donwload(item,1)"
                                  type="primary"
                                  class="bot-btn"
                                  >安装</el-button
@@ -512,7 +512,7 @@
              </el-tab-pane>
              <el-tab-pane name="update">
                <span slot="label">
                  <el-badge class="update-badge" :value="updateNum"
                  <el-badge class="update-badge" :value="updateNum" :hidden="updateNum==0"
                    >更新</el-badge
                  >
                </span>
@@ -574,7 +574,7 @@
                                >
                                <el-button
                                  v-if="item.isUpgrade"
                                  @click="donwload(item)"
                                  @click="donwload(item,0)"
                                  type="warning"
                                  size="small"
                                  class="bot-btn"
@@ -1149,7 +1149,7 @@
    batchUpdate(type) {
      if (type == "sdk") {
        this.hasNewVersionSdk.forEach((sdk) => {
          this.donwload(sdk);
          this.donwload(sdk,0);
        });
      } else {
        this.hasNewVersionApp.forEach((app) => {
@@ -1426,6 +1426,7 @@
    cancelActivate(){
      this.showInputCode= false
      this.activeCode = ""
    },
    newActInfo() {
      return {
@@ -1453,51 +1454,56 @@
    },
    actived() {
      let _this = this;
      if (this.activeCode.trim()=="") {
        this.$notify({
          type: "error",
          message: "激活码不能为空",
        });
        return
      }
      if (this.actType == "sdk") {
        //激活算法
        actPageAlg(this.actId, this.activeCode)
          .then((res) => {
            if (res.data.isSuccess) {
              this.productDetailVisible = false
              _this.activedSdkOrApp = res.data.successMsg;
              this.showActivateSuccess=true
      // if (this.actType == "sdk") {
      //   //激活算法
      //   actPageAlg(this.actId, this.activeCode)
      //     .then((res) => {
      //       if (res.data.isSuccess) {
      //         this.productDetailVisible = false
      //         _this.activedSdkOrApp = res.data.successMsg;
      //         this.showActivateSuccess=true
      //         _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.productDetailVisible = false
      //         _this.activedSdkOrApp = res.data.successMsg;
      //         this.showActivateSuccess=true
      //         _this.actStep++;
      //         _this.getUnActivedAppList();
      //         _this.getAllApps();
      //       } else {
      //         _this.$notify({
      //           type: "error",
      //           message: res.data.failMsg.failMsg,
      //         });
      //       }
      //     })
      //     .catch((e) => {
      //       console.log(e);
      //     });
      // }
              _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.productDetailVisible = false
              _this.activedSdkOrApp = res.data.successMsg;
              this.showActivateSuccess=true
              _this.actStep++;
              _this.getUnActivedAppList();
              _this.getAllApps();
            } else {
              _this.$notify({
                type: "error",
                message: res.data.failMsg.failMsg,
              });
            }
          })
          .catch((e) => {
            console.log(e);
          });
      }
    },
    getCodeDetail() {},
    checkMyAlgorith() {
@@ -1709,7 +1715,7 @@
      // 开启自动刷新
      this.sdkUpgreading = true;
    },
    donwload(item) {
    donwload(item,typ) {
      item.upgradeLoading = true;
      this.downloadItem = item.id;
@@ -1720,7 +1726,7 @@
          this.downloadItem = "";
          this.$notify({
            type: "success",
            message: "算法安装成功"
            message: typ==1? "算法安装成功":"算法升级成功"
          });
        })
        .catch((err) => {
@@ -1920,8 +1926,9 @@
             margin-bottom: 10px;
              .el-input{
                float: left;
                width: 64%;
                 margin-bottom: 8px;
                width: 63%;
                margin-bottom: 8px;
                margin-right: 10px;
              }
              el-button{
                float: left;
@@ -1991,6 +1998,8 @@
                background-color: rgba(242, 242, 242, 1.3);
                      margin: 5px 12px 0 12px;
                    font-size: 12px;
                        line-height: 18px;
              }
               margin-bottom: 12px;
            }