heyujie
2021-04-21 fed1301812fab576517b582fa01dfe51bb429f8c
src/pages/ai/index/App.vue
@@ -49,7 +49,7 @@
                              v-if="!item.isDefault || item.isUpgrade"
                            >
                              <div class="left-top">
                                <div>当前版本:{{ item.version }}</div>
                                <div>当前版本1:{{ item.version }}</div>
                                <div v-if="item.remoteVersion">
                                  最新版本:{{ item.remoteVersion }}
                                </div>
@@ -70,11 +70,11 @@
                                >
                                <el-button
                                  v-if="item.isUpgrade"
                                  @click="donwload(item,0)"
                                  @click="donwload(item, 0)"
                                  type="warning"
                                  size="small"
                                  class="bot-btn"
                                  >升级</el-button
                                  >升级1</el-button
                                >
                              </div>
                            </div>
@@ -119,28 +119,28 @@
                        v-loading="downloading && downloadItem == item.id"
                      >
                        <div class="mask">
                           <div class="left-top">
                                <div v-if="item.installed">当前版本:{{ item.version }}</div>
                                <div v-if="item.remoteVersion">
                                  最新版本:{{ item.remoteVersion }}
                                </div>
                              </div>
                              <div
                                class="info-onmask"
                                @click="checkDetail(item, 'activeNotInstall')"
                              >
                                查看详情
                              </div>
                              <div class="mask-btn">
                                <el-button
                                 @click="donwload(item,1)"
                                  type="primary"
                                  class="bot-btn"
                                  >安装</el-button
                                >
                              </div>
                          <div class="left-top">
                            <div v-if="item.installed">
                              当前版本:{{ item.version }}
                            </div>
                            <div v-if="item.remoteVersion">
                              最新版本:{{ item.remoteVersion }}
                            </div>
                          </div>
                          <div
                            class="info-onmask"
                            @click="checkDetail(item, 'activeNotInstall')"
                          >
                            查看详情
                          </div>
                          <div class="mask-btn">
                            <el-button
                              @click="donwload(item, 1)"
                              type="primary"
                              class="bot-btn"
                              >安装</el-button
                            >
                          </div>
                        </div>
                        <div class="click-download" title="下载">
                          <span class="iconfont iconxiazai1"></span>
@@ -206,10 +206,10 @@
                                  最新版本:{{ item.remoteVersion }}
                                </div>
                              </div>
                                  <!-- v-if="!item.isDefault" -->
                              <!-- v-if="!item.isDefault" -->
                              <div
                                class="info-onmask"
                                @click="checkDetail(item,'active')"
                                @click="checkDetail(item, 'active')"
                              >
                                查看详情
                              </div>
@@ -276,7 +276,6 @@
                            element-loading-background="rgba(0,0,0,.8)"
                          >
                            <div class="mask">
                              <el-button
                                size="small"
                                type="primary"
@@ -388,7 +387,6 @@
                                  class="bot-btn"
                                  >激活</el-button
                                >
                              </div>
                            </div>
                            <img
@@ -424,7 +422,7 @@
                  </div>
                  <p class="src-title">应用软件</p>
                  <div class="app-list flex-list">
                     <div v-if="!unActivedAppList.length" class="empty-tip">
                    <div v-if="!unActivedAppList.length" class="empty-tip">
                      暂无数据
                    </div>
                    <div
@@ -450,7 +448,7 @@
                                "
                              ></span>
                            </div> -->
                             <div
                            <div
                              class="mask"
                              v-if="!item.isDefault || item.isUpgrade"
                            >
@@ -462,19 +460,18 @@
                              </div>
                              <div
                                class="info-onmask"
                                @click="actSdkOrApp(item,'app')"
                                @click="actSdkOrApp(item, 'app')"
                              >
                                查看详情
                              </div>
                              <div class="mask-btn">
                                <el-button
                                  @click="actSdkOrApp(item,'app')"
                                  @click="actSdkOrApp(item, 'app')"
                                  type="primary"
                                  size="small"
                                  class="bot-btn"
                                  >激活</el-button
                                >
                              </div>
                            </div>
                            <img
@@ -508,11 +505,13 @@
                  </div>
                </div>
                <!--  -->
              </el-tab-pane>
              <el-tab-pane name="update">
                <span slot="label">
                  <el-badge class="update-badge" :value="updateNum" :hidden="updateNum==0"
                  <el-badge
                    class="update-badge"
                    :value="updateNum"
                    :hidden="updateNum == 0"
                    >更新</el-badge
                  >
                </span>
@@ -527,8 +526,8 @@
                    >
                  </div>
                  <div class="flex-list">
                    <div v-if="hasNewVersionSdk.length==0" class="empty-tip">
                      {{errMsg?errMsg:"暂无数据"}}
                    <div v-if="hasNewVersionSdk.length == 0" class="empty-tip">
                      {{ errMsg ? errMsg : "暂无数据" }}
                    </div>
                    <div
                      class="wrap-box"
@@ -560,7 +559,7 @@
                              </div>
                              <div
                                class="info-onmask"
                                @click="checkDetail(item,'active')"
                                @click="checkDetail(item, 'active')"
                              >
                                查看详情
                              </div>
@@ -574,7 +573,7 @@
                                >
                                <el-button
                                  v-if="item.isUpgrade"
                                  @click="donwload(item,0)"
                                  @click="donwload(item, 0)"
                                  type="warning"
                                  size="small"
                                  class="bot-btn"
@@ -647,7 +646,7 @@
                              </div>
                              <div
                                class="info-onmask"
                                @click="checkDetail(item,'active')"
                                @click="checkDetail(item, 'active')"
                              >
                                查看详情
                              </div>
@@ -758,16 +757,21 @@
      :visible="productDetailVisible"
      @close="closeDial"
    >
    <!-- <el-button-group> -->
      <div class="button-group" v-show="!backDisable||!forwardDisable">
  <el-button    size="small" @click="backwards" :disabled="backDisable"> <span>&#60;</span> </el-button>
  <!-- <el-button type="primary" size="small" icon="el-icon-arrow-left"></el-button> -->
  <el-button    size="small" @click="forwards" :disabled="forwardDisable">></el-button>
  <!-- <el-button type="primary" size="small"><i class="el-icon-arrow-right el-icon--right"></i></el-button> -->
      <!-- <el-button-group> -->
      <div class="button-group" v-show="!backDisable || !forwardDisable">
        <el-button size="small" @click="backwards" :disabled="backDisable">
          <span>&#60;</span>
        </el-button>
        <!-- <el-button type="primary" size="small" icon="el-icon-arrow-left"></el-button> -->
        <el-button size="small" @click="forwards" :disabled="forwardDisable"
          >></el-button
        >
        <!-- <el-button type="primary" size="small"><i class="el-icon-arrow-right el-icon--right"></i></el-button> -->
      </div>
<!-- </el-button-group> -->
      <div class="dialog-title" slot="title">{{isSDKDialog?"算法详情":"应用详情"}}</div>
      <!-- </el-button-group> -->
      <div class="dialog-title" slot="title">
        {{ isSDKDialog ? "算法详情" : "应用详情" }}
      </div>
      <div class="dialog-content">
        <div class="box-top">
          <div class="top-left">
@@ -823,39 +827,85 @@
                />
              </div>
              <div class="right-desc">
                <div class="name"><el-tooltip class="" effect="dark" :content="productDetail.productName  " placement="right-start">
                  <span>{{ productDetail.productName  }}</span>
                </el-tooltip></div>
                <div class="name">
                  <el-tooltip
                    class=""
                    effect="dark"
                    :content="productDetail.productName"
                    placement="right-start"
                  >
                    <span>{{ productDetail.productName }}</span>
                  </el-tooltip>
                </div>
                <div class="tags">
                  <el-tag type="info" size="small" color="#fff" v-if="!isSDKDialog">应用</el-tag>
                  <el-tag type="info" size="small" color="#fff" v-if="isSDKDialog">算法</el-tag>
                  <el-tag
                    type="info"
                    size="small"
                    color="#fff"
                    v-if="!isSDKDialog"
                    >应用</el-tag
                  >
                  <el-tag
                    type="info"
                    size="small"
                    color="#fff"
                    v-if="isSDKDialog"
                    >算法</el-tag
                  >
                </div>
                <div class="btns">
                  <el-button size="small" type="warning"  v-if="needToUpgradeInWin||productDetail.isUpgrade" @click="upgradeSDKinWin" >{{
                    isUpgrading ? "升级中.." : "升级"
                  }}</el-button>
                  <el-button size="small" type="primary" v-if="isActive&&!isDefaultApp" @click="unloadSDKinWin">卸载</el-button>
                  <el-button size="small" type="primary" v-if="!isActive&&!showInstallNotActive" @click="showInputCode=!showInputCode">激活</el-button>
                  <el-button size="small" type="primary" v-if="!isActive&&showInstallNotActive" @click="downloadSdkInSide">{{isUpgrading?"安装中..":"安装"}}</el-button>
                  <el-button size="small" type="success" v-if="!isSDKDialog&&isActive" @click="openApp">打开</el-button>
                  <el-button
                    size="small"
                    type="warning"
                    v-if="needToUpgradeInWin || productDetail.isUpgrade"
                    @click="upgradeSDKinWin"
                    >{{ isUpgrading ? "升级中.." : "升级" }}</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    v-if="isActive && !isDefaultApp"
                    @click="unloadSDKinWin"
                    >卸载</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    v-if="!isActive && !showInstallNotActive"
                    @click="showInputCode = !showInputCode"
                    >激活</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    v-if="!isActive && showInstallNotActive"
                    @click="downloadSdkInSide"
                    >{{ isUpgrading ? "安装中.." : "安装" }}</el-button
                  >
                  <el-button
                    size="small"
                    type="success"
                    v-if="!isSDKDialog && isActive"
                    @click="openApp"
                    >打开</el-button
                  >
                </div>
              </div>
            </div>
            <div class="jihuo-input" v-if="showInputCode">
                        <el-input size="small"
                          v-model="activeCode"
                          placeholder="00000-00000-00000-00000-00000"
                          @blur="getCodeDetail"
                        ></el-input>
                         <el-button type="primary" size="small" @click="actived"
                          >激活</el-button
                        >
                           <el-button type="primary" size="small" @click="cancelActivate"
                          >取消</el-button
                        >
                      </div>
              <el-input
                size="small"
                v-model="activeCode"
                placeholder="00000-00000-00000-00000-00000"
                @blur="getCodeDetail"
              ></el-input>
              <el-button type="primary" size="small" @click="actived"
                >激活</el-button
              >
              <el-button type="primary" size="small" @click="cancelActivate"
                >取消</el-button
              >
            </div>
            <div class="product-intruduction">
              <div class="part-title" v-if="!showInputCode">简介</div>
              <div class="text">
@@ -895,7 +945,9 @@
        </div>
        <div class="box-bottom">
          <div class="bot-left">
            <div class="part-title">{{isSDKDialog?"应用场景":"功能特点"}}</div>
            <div class="part-title">
              {{ isSDKDialog ? "应用场景" : "功能特点" }}
            </div>
            <div class="list-zone">
              <div
                class="list-item"
@@ -906,11 +958,7 @@
                  {{ item.title === "" ? "暂无数据" : item.title }}
                </el-tag>
                <div class="desc">
                  {{
                    item.desc === ""
                      ? "暂无数据"
                      : item.desc
                  }}
                  {{ item.desc === "" ? "暂无数据" : item.desc }}
                </div>
              </div>
            </div>
@@ -940,15 +988,26 @@
                    alt
                  />
                <div class="icon-name">
                  <el-tooltip class="" effect="dark" :content="item.name === '' ? '暂无数据':item.name" placement="top-start">
                  <span>{{ item.name === "" ? "暂无数据" : item.name }}</span>
                </el-tooltip>
                  <div class="icon-name">
                    <el-tooltip
                      class=""
                      effect="dark"
                      :content="item.name === '' ? '暂无数据' : item.name"
                      placement="top-start"
                    >
                      <span>{{
                        item.name === "" ? "暂无数据" : item.name
                      }}</span>
                    </el-tooltip>
                  </div>
                </div>
                <div class="look-button">
                  <el-button type="primary" size="mini" @click="checkInWindow(item)">查看</el-button>
                  <el-button
                    type="primary"
                    size="mini"
                    @click="checkInWindow(item)"
                    >查看</el-button
                  >
                </div>
              </div>
            </div>
@@ -956,12 +1015,12 @@
        </div>
      </div>
    </el-dialog>
    <el-dialog
    :visible.sync="showActivateSuccess"
    title="激活成功!"
  width="30%"
  class="active-Dial"
  :before-close="handleClose"
    <el-dialog
      :visible.sync="showActivateSuccess"
      title="激活成功!"
      width="30%"
      class="active-Dial"
      :before-close="handleClose"
    >
      <div class="dialog-active">
        <ul class="desc">
@@ -987,9 +1046,7 @@
          </li>
        </ul>
        <div class="text-right">
          <el-button type="primary" @click="checkMyAlgorith"
            >确定</el-button
          >
          <el-button type="primary" @click="checkMyAlgorith">确定</el-button>
          <p class="tip">提示:请在“已激活”中查看并安装算法</p>
        </div>
      </div>
@@ -1015,7 +1072,7 @@
  actApp,
} from "@/api/app";
import bus from '@/plugin/bus'
import bus from "@/plugin/bus";
import FileUploader from "@/components/subComponents/FileUpload/index";
export default {
  name: "algorithmManage",
@@ -1073,19 +1130,19 @@
      downloading: false,
      direction: "rtl",
      actStep: 0,
      showActivateSuccess:false,
      showActivateSuccess: false,
      activeCode: "",
      isInstall: false,
      installDialogVisible: false,
      installPackage: {},
      installAppPackage: null,
      installSdkPackage: null,
      isActive:true,
      isDefaultApp:false,
      isActive: true,
      isDefaultApp: false,
      installPercentage: 0,
      unActivedSDKList: [],
      unActivedAppList: [],
      isSDKDialog:true,
      isSDKDialog: true,
      //actSdkId: '',
      actType: "",
      actId: "",
@@ -1113,12 +1170,12 @@
      otherProducts: [],
      backStack: [],
      forwardStack: [],
      backDisable:true,
      forwardDisable:true,
      showInputCode:false,
      needToUpgradeInWin:false,
      errMsg:"",
      showInstallNotActive:false
      backDisable: true,
      forwardDisable: true,
      showInputCode: false,
      needToUpgradeInWin: false,
      errMsg: "",
      showInstallNotActive: false,
    };
  },
  directives: {
@@ -1135,7 +1192,6 @@
    this.getUnActivedList();
    this.getUnActivedAppList();
  },
  beforeDestroy() {
    this.autoRefresh = false;
@@ -1149,7 +1205,7 @@
    batchUpdate(type) {
      if (type == "sdk") {
        this.hasNewVersionSdk.forEach((sdk) => {
          this.donwload(sdk,0);
          this.donwload(sdk, 0);
        });
      } else {
        this.hasNewVersionApp.forEach((app) => {
@@ -1157,115 +1213,114 @@
        });
      }
    },
    closeDial(){
      this.productDetailVisible = false
      this.productDetail = {}
      this.otherProducts = []
    closeDial() {
      this.productDetailVisible = false;
      this.productDetail = {};
      this.otherProducts = [];
    },
    checkDetail(item,type) {
      if (type =='inactive') {
        this.isActive =false
         this.showInstallNotActive = false
        this.showInputCode = false
      }else if (type =='active'){
        this.showInputCode = false
         this.showInstallNotActive = false
         this.isActive =true
      }else if (type =='activeNotInstall'){
        this.showInputCode = false
         this.isActive =false
         this.showInstallNotActive = true
    checkDetail(item, type) {
      if (type == "inactive") {
        this.isActive = false;
        this.showInstallNotActive = false;
        this.showInputCode = false;
      } else if (type == "active") {
        this.showInputCode = false;
        this.showInstallNotActive = false;
        this.isActive = true;
      } else if (type == "activeNotInstall") {
        this.showInputCode = false;
        this.isActive = false;
        this.showInstallNotActive = true;
      }
      this.checkIsDefOrNot(item.id)
        this.needToUpgradeInWin = item.isUpgrade?true:false
      this.resetStack()
      if (item.sdk_type===undefined) {
       this.isSDKDialog=false
      }else{
       this.isSDKDialog=true
      this.checkIsDefOrNot(item.id);
      this.needToUpgradeInWin = item.isUpgrade ? true : false;
      this.resetStack();
      if (item.sdk_type === undefined) {
        this.isSDKDialog = false;
      } else {
        this.isSDKDialog = true;
      }
      this.productDetailVisible = true;
      let _this = this;
      getAppDetail({ id: item.id }).then((res) => {
        _this.productDetail = res.data.detail;
        _this.productDetail.isUpgrade = item.isUpgrade
        _this.productDetail.iconBlob = item.iconBlob
        _this.productDetail.isUpgrade = item.isUpgrade;
        _this.productDetail.iconBlob = item.iconBlob;
        _this.otherProducts = res.data.randoms;
      });
    },
    resetStack(){
      this.forwardStack = []
       this.backStack = []
       this.backDisable = true
       this.forwardDisable = true
    resetStack() {
      this.forwardStack = [];
      this.backStack = [];
      this.backDisable = true;
      this.forwardDisable = true;
    },
    checkInWindow(item){
      this.backStack.push([this.productDetail, this.otherProducts])
      this.backDisable = false
      this.checkIsDefOrNot(item.id)
    checkInWindow(item) {
      this.backStack.push([this.productDetail, this.otherProducts]);
      this.backDisable = false;
      this.checkIsDefOrNot(item.id);
      let _this = this;
      getAppDetail({ id: item.id }).then((res) => {
        _this.productDetail = res.data.detail;
        _this.productDetail.iconBlob = item.iconBlob
        this.actId = _this.productDetail.productBaseId
        let flag=false
       const allNeedToNew = [...this.hasNewVersionSdk,...this.hasNewVersionApp]
        _this.productDetail.iconBlob = item.iconBlob;
        this.actId = _this.productDetail.productBaseId;
        let flag = false;
        const allNeedToNew = [
          ...this.hasNewVersionSdk,
          ...this.hasNewVersionApp,
        ];
        for (let i = 0; i < allNeedToNew.length; i++) {
          const item = allNeedToNew[i];
          if (item.id == _this.productDetail.productBaseId) {
            flag=true
            flag = true;
          }
        }
        this.needToUpgradeInWin = flag
          _this.productDetail.isUpgrade = flag
        this.needToUpgradeInWin = flag;
        _this.productDetail.isUpgrade = flag;
        _this.otherProducts = res.data.randoms;
      });
    },
    checkIsDefOrNot(id){
      if (id.length>10) {
        this.isDefaultApp=false
      }else {
        this.isDefaultApp=true
    checkIsDefOrNot(id) {
      if (id.length > 10) {
        this.isDefaultApp = false;
      } else {
        this.isDefaultApp = true;
      }
    },
    backwards(){
      if (this.backStack.length ==0) {
        this.backDisable = true
      return
    backwards() {
      if (this.backStack.length == 0) {
        this.backDisable = true;
        return;
      }
   this.forwardStack.push([this.productDetail,this.otherProducts])
   let item = this.backStack.pop()
   this.productDetail =  item[0]
   this.checkIsDefOrNot(this.productDetail.productBaseId)
   this.otherProducts = item[1]
  this.forwardDisable=false
 if (this.backStack.length ==0) {
        this.backDisable = true
      this.forwardStack.push([this.productDetail, this.otherProducts]);
      let item = this.backStack.pop();
      this.productDetail = item[0];
      this.checkIsDefOrNot(this.productDetail.productBaseId);
      this.otherProducts = item[1];
      this.forwardDisable = false;
      if (this.backStack.length == 0) {
        this.backDisable = true;
      }
    },
    forwards(){
      if(this.forwardStack.length==0){
        this.forwardDisable=true
        return
    forwards() {
      if (this.forwardStack.length == 0) {
        this.forwardDisable = true;
        return;
      }
        this.backStack.push([this.productDetail,this.otherProducts])
        this.backDisable=false
        let item = this.forwardStack.pop()
      this.backStack.push([this.productDetail, this.otherProducts]);
      this.backDisable = false;
      let item = this.forwardStack.pop();
        this.productDetail = item[0]
        this.otherProducts = item[1]
      if (this.forwardStack.length==0) {
        this.forwardDisable=true
      this.productDetail = item[0];
      this.otherProducts = item[1];
      if (this.forwardStack.length == 0) {
        this.forwardDisable = true;
      }
    },
    //离线安装
    offlineInstall() {
@@ -1313,10 +1368,10 @@
        .then((res) => {
          if (res && res.success) {
            _this.$notify({
               title: "成功",
               message: "安装应用成功",
               type: "success",
             });
              title: "成功",
              message: "安装应用成功",
              type: "success",
            });
            setTimeout(() => {
              if (action == "upgrade") {
                app.upgradeLoading = false;
@@ -1331,16 +1386,15 @@
                "*"
              );
            }, 3000);
          }else {
          } else {
          }
        })
        .catch((e) => {
            _this.$notify({
              title: "安装失败",
              message: e.data,
              type: "warning",
            });
          _this.$notify({
            title: "安装失败",
            message: e.data,
            type: "warning",
          });
          if (action == "upgrade") {
            app.upgradeLoading = false;
          } else {
@@ -1384,7 +1438,7 @@
      let _this = this;
      this.$confirm("确定要卸载该应用吗?", "提示")
        .then(() => {
      _this.productDetailVisible = false
          _this.productDetailVisible = false;
          app.unloadLoading = true;
          removeApp({ appId: app.id })
@@ -1416,7 +1470,7 @@
    },
    actSdkOrApp(item, type = "sdk") {
      this.checkDetail(item, 'inactive')
      this.checkDetail(item, "inactive");
      this.actType = type;
      this.actId = item.id;
      this.actStep = 0;
@@ -1424,9 +1478,9 @@
      this.activedSdkOrApp = this.newActInfo();
    },
    cancelActivate(){
      this.showInputCode= false
      this.activeCode = ""
    cancelActivate() {
      this.showInputCode = false;
      this.activeCode = "";
    },
    newActInfo() {
      return {
@@ -1454,21 +1508,21 @@
    },
    actived() {
      let _this = this;
      if (this.activeCode.trim()=="") {
      if (this.activeCode.trim() == "") {
        this.$notify({
          type: "error",
          message: "激活码不能为空",
        });
        return
        return;
      }
      if (this.actType == "sdk") {
        //激活算法
        actPageAlg(this.actId, this.activeCode)
          .then((res) => {
            if (res.data.isSuccess) {
              this.productDetailVisible = false
              this.productDetailVisible = false;
              _this.activedSdkOrApp = res.data.successMsg;
              this.showActivateSuccess=true
              this.showActivateSuccess = true;
              _this.actStep++;
              _this.getUnActivedList();
              _this.getAllSdk();
@@ -1487,9 +1541,9 @@
        actApp(this.actId, this.activeCode)
          .then((res) => {
            if (res.data.isSuccess) {
              this.productDetailVisible = false
              this.productDetailVisible = false;
              _this.activedSdkOrApp = res.data.successMsg;
              this.showActivateSuccess=true
              this.showActivateSuccess = true;
              _this.actStep++;
              _this.getUnActivedAppList();
              _this.getAllApps();
@@ -1547,11 +1601,14 @@
          });
        });
    },
    openApp(){
      let message = 'toOpenApp?' + this.productDetail.productBaseId;
      window.parent.postMessage({
        msg: message
      }, "*")
    openApp() {
      let message = "toOpenApp?" + this.productDetail.productBaseId;
      window.parent.postMessage(
        {
          msg: message,
        },
        "*"
      );
    },
    onFileAdded(f) {
@@ -1579,27 +1636,26 @@
          //算法软件 已安装其中包含待升级 未安装
          item.installed ? installedList.push(obj) : unInstalledList.push(obj);
          item.isUpgrade ? hasNewVersionList.push(obj): null
          item.isUpgrade ? hasNewVersionList.push(obj) : null;
        });
      }
      this.installedList = installedList;
      this.notInstalledList = unInstalledList;
      this.hasNewVersionSdk = hasNewVersionList;
    },
    unloadSDKinWin(){
      let appToUnload
      let sdkToUnload
      if (this.productDetail.productTypeName=="应用") {
        appToUnload= this.installedApps.find((item)=>{
          return item.id == this.productDetail.productBaseId
        })
        this.unLoad(appToUnload)
      }else{
          sdkToUnload= this.installedList.find((item)=>{
          return item.id == this.productDetail.productBaseId
        })
        this.unLoadSdk(sdkToUnload)
    unloadSDKinWin() {
      let appToUnload;
      let sdkToUnload;
      if (this.productDetail.productTypeName == "应用") {
        appToUnload = this.installedApps.find((item) => {
          return item.id == this.productDetail.productBaseId;
        });
        this.unLoad(appToUnload);
      } else {
        sdkToUnload = this.installedList.find((item) => {
          return item.id == this.productDetail.productBaseId;
        });
        this.unLoadSdk(sdkToUnload);
      }
    },
    //卸载算法
@@ -1607,17 +1663,17 @@
      let _this = this;
      this.$confirm("确定要卸载该算法吗?", "提示")
        .then(() => {
      _this.productDetailVisible = false
          _this.productDetailVisible = false;
          sdk.unloadLoading = true;
          removeSdk({ sdkId: sdk.id })
            .then((res) => {
              if (res && res.success) {
                sdk.unloadLoading = false;
                this.$notify({
                title: "成功",
                message: "卸载完成",
                type: "success",
              });
                  title: "成功",
                  message: "卸载完成",
                  type: "success",
                });
                _this.getAllSdk();
                window.parent.postMessage(
                  {
@@ -1636,73 +1692,70 @@
          console.log(e);
        });
    },
    upgradeSDKinWin(){
    upgradeSDKinWin() {
      this.isUpgrading = !this.isUpgrading;
      let _this = this;
      if (this.productDetail.productTypeName=="应用") {
      installApp({ path: this.productDetail.productBaseId})
        .then((res) => {
          if (res && res.success) {
         this.$notify({
          title: "成功",
          message: "升级完成",
          type: "success",
        });
        this.needToUpgradeInWin=false
        this.productDetail.isUpgrade = false
        this.isUpgrading = !this.isUpgrading;
          }
        })
        .catch((e) => {
      if (this.productDetail.productTypeName == "应用") {
        installApp({ path: this.productDetail.productBaseId })
          .then((res) => {
            if (res && res.success) {
              this.$notify({
                title: "成功",
                message: "升级完成",
                type: "success",
              });
              this.needToUpgradeInWin = false;
              this.productDetail.isUpgrade = false;
              this.isUpgrading = !this.isUpgrading;
            }
          })
          .catch((e) => {
            _this.$notify({
              title: "升级失败",
              message: e.data,
              type: "warning",
            });
             this.isUpgrading = !this.isUpgrading;
        });
            this.isUpgrading = !this.isUpgrading;
          });
      // 开启自动刷新
      this.appUpgreading = true;
      }else{
        downloadSdk({path:this.productDetail.productBaseId}).then((res)=>{
          this.needToUpgradeInWin=false
        this.productDetail.isUpgrade = false
        this.isUpgrading = !this.isUpgrading;
        this.$notify({
          title: "成功",
          message: "升级完成",
          type: "success",
        });
      }).catch((err)=>{
        this.$notify({
          title: "升级失败",
          message: err.data,
          type: "warning",
        });
        this.isUpgrading = !this.isUpgrading;
      })
      this.sdkUpgreading = true;
        // 开启自动刷新
        this.appUpgreading = true;
      } else {
        downloadSdk({ path: this.productDetail.productBaseId })
          .then((res) => {
            this.needToUpgradeInWin = false;
            this.productDetail.isUpgrade = false;
            this.isUpgrading = !this.isUpgrading;
            this.$notify({
              title: "成功",
              message: "升级完成",
              type: "success",
            });
          })
          .catch((err) => {
            this.$notify({
              title: "升级失败",
              message: err.data,
              type: "warning",
            });
            this.isUpgrading = !this.isUpgrading;
          });
        this.sdkUpgreading = true;
      }
    },
    downloadSdkInSide(){
    downloadSdkInSide() {
      this.downloadItem = this.productDetail.productBaseId;
      this.isUpgrading = true
      this.isUpgrading = true;
      downloadSdk({ path: this.productDetail.productBaseId })
        .then((rsp) => {
          this.productDetailVisible = false
          this.productDetailVisible = false;
          this.downloadItem = "";
          this.$notify({
            type: "success",
            message: "算法已安装"
            message: "算法已安装",
          });
      this.isUpgrading=false
          this.isUpgrading = false;
        })
        .catch((err) => {
          this.$notify({
@@ -1710,12 +1763,13 @@
            message: err.data,
          });
          this.downloadItem = "";
      this.isUpgrading=false
          this.isUpgrading = false;
        });
      // 开启自动刷新
      this.sdkUpgreading = true;
    },
    donwload(item,typ) {
    donwload(item, typ) {
      item.upgradeLoading = true;
      this.downloadItem = item.id;
@@ -1726,7 +1780,7 @@
          this.downloadItem = "";
          this.$notify({
            type: "success",
            message: typ==1? "算法安装成功":"算法升级成功"
            message: typ == 1 ? "算法安装成功" : "算法升级成功",
          });
        })
        .catch((err) => {
@@ -1801,9 +1855,8 @@
    height: 100%;
  }
  .product-detail-dialog {
    .dialog-title{
          font-size: 13px;
    .dialog-title {
      font-size: 13px;
    }
    .el-dialog {
      width: 50%;
@@ -1812,36 +1865,35 @@
    }
    .el-dialog__header {
      text-align: center;
          padding: 6px;
      padding: 6px;
      .el-dialog__headerbtn {
          position: absolute;
             top: 5px;
        position: absolute;
        top: 5px;
          right: 20px;
          padding: 0;
          background: transparent;
          outline: none;
          cursor: pointer;
          font-size: 20px;
        right: 20px;
        padding: 0;
        background: transparent;
        outline: none;
        cursor: pointer;
        font-size: 20px;
      }
    }
    .el-dialog__body {
      background-color: rgba(222, 225, 230, 1);
          padding: 8px 3px;
      .button-group{
      padding: 8px 3px;
      .button-group {
        position: absolute;
               top: 3px;
        top: 3px;
            left:6px;
                left: 10px;
      .el-button--small {
        padding: 5px 12px;
    }
        button{
        left: 6px;
        left: 10px;
        .el-button--small {
          padding: 5px 12px;
        }
        button {
          font-size: 18px;
        line-height: 12px;
          line-height: 12px;
        }
      }
    }
@@ -1857,20 +1909,19 @@
          height: 330px;
          border-radius: 2px;
          .banner {
        text-align: center;
        margin-top: 3px;
           video {
            text-align: center;
            margin-top: 3px;
            video {
              margin: 0px auto;
              margin-top: 23px;
            margin: 0px auto;
                 margin-top: 23px;
            width: 443px;
          height: 277px;
          }
          img{
                max-width: 90%;
                     margin-top: 28px;
          }
              width: 443px;
              height: 277px;
            }
            img {
              max-width: 90%;
              margin-top: 28px;
            }
          }
        }
        .top-right {
@@ -1883,34 +1934,33 @@
          border-radius: 2px;
          overflow: hidden;
          .summary {
                height: 120px;
            height: 120px;
                margin: 5px 5px 0 5px;
            margin: 5px 5px 0 5px;
            .icon {
             margin: 0 10px;
                margin-top: 8px;
              margin: 0 10px;
              margin-top: 8px;
              float: left;
              .baseImg{
         max-width: 106px;
    max-height: 106px;
              .baseImg {
                max-width: 106px;
                max-height: 106px;
              }
            }
            .right-desc {
              float: left;
              position: absolute;
                 left: 140px;
              left: 140px;
              .name {
                    font-size: 28px;
                font-size: 28px;
                margin-bottom: 5px;
                text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
          width: 250px;
                white-space: nowrap;
                overflow: hidden;
                width: 250px;
              }
              .tags {
                margin-bottom: 10px;
@@ -1919,55 +1969,50 @@
                }
              }
            }
          }
           .jihuo-input{
             margin-left: 10px;
             margin-bottom: 10px;
              .el-input{
                float: left;
                width: 63%;
                margin-bottom: 8px;
                margin-right: 10px;
              }
              el-button{
                float: left;
              }
          .jihuo-input {
            margin-left: 10px;
            margin-bottom: 10px;
            .el-input {
              float: left;
              width: 63%;
              margin-bottom: 8px;
              margin-right: 10px;
            }
            el-button {
              float: left;
            }
          }
          .product-intruduction {
            height: 200px;
               margin-top: 3px;
            margin-top: 3px;
            .part-title {
              display: block;
                  line-height: 20px;
              line-height: 20px;
              font-size: 16px;
              margin-left: 24px;
              border-bottom: 3px solid #3d68e1;
              width: fit-content;
                 height: 26px;
            margin-bottom: 8px;
              height: 26px;
              margin-bottom: 8px;
            }
            .text {
                height: 156px;
              height: 156px;
              overflow: auto;
              padding: 0 15px 0px 15px;
              .single-desc {
                   margin-bottom: 10px;
                        font-size: 13px;
                margin-bottom: 10px;
                font-size: 13px;
              }
            }
          }
        }
      }
      .box-bottom {
            margin-top: 8px;
        margin-top: 8px;
        height: 240px;
        .bot-left {
@@ -1984,24 +2029,22 @@
            margin-left: 24px;
            border-bottom: 3px solid #3d68e1;
            width: fit-content;
               margin-bottom: 10px;
            margin-bottom: 10px;
              height: 33px;
            height: 33px;
          }
          .list-zone {
            overflow: auto;
                height: 190px;
                padding: 0 20px;
            height: 190px;
            padding: 0 20px;
            .list-item {
              .desc {
                background-color: rgba(242, 242, 242, 1.3);
                      margin: 5px 12px 0 12px;
                    font-size: 12px;
                        line-height: 18px;
                margin: 5px 12px 0 12px;
                font-size: 12px;
                line-height: 18px;
              }
               margin-bottom: 12px;
              margin-bottom: 12px;
            }
          }
        }
@@ -2021,13 +2064,12 @@
            border-bottom: 3px solid #3d68e1;
            width: fit-content;
            margin-bottom: 5px;
                height: 33px;
            height: 33px;
          }
          .item-zone {
            overflow: auto;
            height: 225px;
              padding: 0px 12px;
            padding: 0px 12px;
            .item {
              height: 165px;
@@ -2046,26 +2088,25 @@
                img {
                  max-width: 60px;
                  max-height: 60px;
                      position: absolute;
                top: 20%;
                left: 26%;
                  position: absolute;
                  top: 20%;
                  left: 26%;
                }
                .icon-name {
                 text-align: center;
                position: absolute;
                top: 61%;
                   left: 12%;
            width: 100px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
              font-size: 13px;
                  text-align: center;
                  position: absolute;
                  top: 61%;
                  left: 12%;
                  width: 100px;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                  overflow: hidden;
                  font-size: 13px;
                }
              }
              .look-button {
                position: absolute;
                      left: 30%;
                left: 30%;
                top: 76%;
              }
@@ -2228,8 +2269,7 @@
            max-width: 200px;
            .mask {
              width: 100%;
              .el-button + .el-button {
                margin-left: 0 !important;
              }
@@ -2478,7 +2518,7 @@
        flex-wrap: wrap;
        justify-content: center;
        top: 0;
        .bot-btn {
          flex: 1;
        }
@@ -2752,42 +2792,40 @@
    }
  }
}
.active-Dial{
  .el-dialog{
.active-Dial {
  .el-dialog {
    min-width: 400px;
  }
  .dialog-active{
          .desc {
          padding: 0 30px;
          margin-bottom: 30px;
          li {
            border-bottom: 1px solid #eee;
            height: 45px;
            line-height: 45px;
            font-size: 14px;
            &:last-child {
              border-bottom: none;
            }
            label {
              display: inline-block;
              width: 90px;
              padding-left: 14px;
              font-weight: bold;
            }
          }
  .dialog-active {
    .desc {
      padding: 0 30px;
      margin-bottom: 30px;
      li {
        border-bottom: 1px solid #eee;
        height: 45px;
        line-height: 45px;
        font-size: 14px;
        &:last-child {
          border-bottom: none;
        }
        .text-right {
          padding-right: 30px;
          text-align: right;
          .tip {
            color: #999;
            line-height: 38px;
          }
        label {
          display: inline-block;
          width: 90px;
          padding-left: 14px;
          font-weight: bold;
        }
      }
    }
    .text-right {
      padding-right: 30px;
      text-align: right;
      .tip {
        color: #999;
        line-height: 38px;
      }
    }
  }
}
}
</style>