heyujie
2021-03-09 81995aada399b25e9415bf709c918125461c402d
窗口中升级产品接口更改
6个文件已修改
187 ■■■■■ 已修改文件
src/components/giantTree/zTree/ztree_v3/jquery.ztree.all.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/ai/index/App.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/analysisPower/index/App.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/panoramicView/components/LabelMark.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/panoramicView/components/RelateCamera.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/shuohuangMonitorAnalyze/components/leftNav.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/giantTree/zTree/ztree_v3/jquery.ztree.all.js
@@ -841,7 +841,7 @@
        return true;
      },
      onClickNode: function (event, node) {
        debugger
        // debugger
        var setting = data.getSetting(event.data.treeId),
          clickFlag = ((setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey)) && data.isSelectedNode(setting, node)) ? 0 : (setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey) && setting.view.selectedMulti) ? 2 : 1;
        if (tools.apply(setting.callback.beforeClick, [setting.treeId, node, clickFlag], true) == false) return true;
@@ -1675,7 +1675,7 @@
        }
      },
      selectNode: function (setting, node, addFlag) {
        debugger
        // debugger
        if (!addFlag) {
          view.cancelPreSelectedNode(setting, null, node);
        }
src/pages/ai/index/App.vue
@@ -150,7 +150,6 @@
                        </div>
                      </div>
                    </div>
                    <!-- </draggable> -->
                    <div
                      class="wrap-box"
                      v-for="item in notInstalledList"
@@ -161,12 +160,28 @@
                        v-loading="downloading && downloadItem == item.id"
                      >
                        <div class="mask">
                          <el-button
                            type="primary"
                            class="bot-btn"
                            @click="donwload(item)"
                            >安装</el-button
                          >
                           <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, 'inactive')"
                              >
                                查看详情
                              </div>
                              <div class="mask-btn">
                                <el-button
                                 @click="donwload(item)"
                                  type="primary"
                                  class="bot-btn"
                                  >安装</el-button
                                >
                              </div>
                        </div>
                        <div class="click-download" title="下载">
                          <span class="iconfont iconxiazai1"></span>
@@ -302,6 +317,7 @@
                            element-loading-background="rgba(0,0,0,.8)"
                          >
                            <div class="mask">
                              <el-button
                                size="small"
                                type="primary"
@@ -900,18 +916,21 @@
            <div class="summary">
              <div class="icon">
                <img
                  v-if="curCheckTarget.iconBlob"
                  v-if="productDetail.iconBlob"
                  class="baseImg"
                  :src="
                    curCheckTarget.iconBlob.indexOf(',') > 0
                      ? curCheckTarget.iconBlob
                      : `data:image/png;base64,${curCheckTarget.iconBlob}`
                    productDetail.iconBlob.indexOf(',') > 0
                      ? productDetail.iconBlob
                      : `data:image/png;base64,${productDetail.iconBlob}`
                  "
                  alt
                />
              </div>
              <div class="right-desc">
                <div class="name">{{ productDetail.productName }}</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">
                  <!-- <span
                  class="tag"
@@ -920,15 +939,15 @@
                >{{showNameById(id)}}</span> -->
                  <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" @click="upgradeSDKinWin" >{{
                  <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" @click="unloadSDKinWin">卸载</el-button>
                  <el-button size="small" type="primary" v-if="!isActive" @click="showInputCode=!showInputCode">下载激活</el-button>
                  <el-button size="small" type="success" v-if="!isSDKDialog" @click="openApp">打开</el-button>
                  <el-button size="small" type="success" v-if="!isSDKDialog&&isActive" @click="openApp">打开</el-button>
                </div>
               
              </div>
@@ -1261,7 +1280,7 @@
      }
        this.needToUpgradeInWin = item.isUpgrade?true:false
      this.resetStack()
      this.curCheckTarget = item;
      // this.productDetail = item;
      if (item.sdk_type===undefined) {
       this.isSDKDialog=false
      }else{
@@ -1272,6 +1291,9 @@
      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.otherProducts = res.data.randoms;
      });
@@ -1284,14 +1306,14 @@
    },
    checkInWindow(item){
      this.backStack.push([this.productDetail,this.otherProducts])
      this.backStack.push([this.productDetail, this.otherProducts])
      // debugger
      this.backDisable = false
      this.curCheckTarget = item;
      // this.productDetailVisible = true;
      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]
@@ -1301,7 +1323,9 @@
            flag=true
          }
        }
        this.needToUpgradeInWin = true
        this.needToUpgradeInWin = flag
          _this.productDetail.isUpgrade = flag
        _this.otherProducts = res.data.randoms;
      });
    },
@@ -1389,16 +1413,8 @@
            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(
@@ -1408,10 +1424,16 @@
                "*"
              );
            }, 3000);
          }else {
          }
        })
        .catch((e) => {
          console.log(e);
            _this.$notify({
              title: "安装失败",
              message: e.data,
              type: "warning",
            });
          if (action == "upgrade") {
            app.upgradeLoading = false;
          } else {
@@ -1450,11 +1472,13 @@
      this.hasNewVersionApp = nArry;
    },
    //卸载应用
    //卸载
    unLoad(app) {
      let _this = this;
      this.$confirm("确定要卸载该应用吗?", "提示")
        .then(() => {
      _this.productDetailVisible = false
          app.unloadLoading = true;
          removeApp({ appId: app.id })
            .then((res) => {
@@ -1651,29 +1675,27 @@
      this.hasNewVersionSdk = hasNewVersionList;
    },
    unloadSDKinWin(){
      let _this = this;
      this.$confirm("确定要卸载该算法么?", "提示").then(()=>{
        _this.productDetailVisible = false
        removeSdk({sdkId:this.productDetail.productBaseId}).then((res)=>{
          _this.getAllSdk();
          window.parent.postMessage(
            {
              msg: "AppUpdate",
            },
            "*"
          );
        }).catch((err)=>{
           console.log(err);
      let appToUnload
      let sdkToUnload
      if (this.productDetail.productTypeName=="应用") {
        appToUnload= this.installedApps.find((item)=>{
          return item.id == this.productDetail.productBaseId
        })
      }).catch(()=>{
      })
        this.unLoad(appToUnload)
      }else{
          sdkToUnload= this.installedList.find((item)=>{
          return item.id == this.productDetail.productBaseId
        })
        this.unLoadSdk(sdkToUnload)
      }
    },
    //卸载算法
    unLoadSdk(sdk) {
      let _this = this;
      this.$confirm("确定要卸载该算法吗?", "提示")
        .then(() => {
      _this.productDetailVisible = false
          sdk.unloadLoading = true;
          removeSdk({ sdkId: sdk.id })
            .then((res) => {
@@ -1701,12 +1723,42 @@
      this.isUpgrading = !this.isUpgrading;
      downloadSdk({path:this.productDetail.productBaseId}).then((res)=>{
      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) => {
            _this.$notify({
              title: "升级失败",
              message: e.data,
              type: "warning",
            });
             this.isUpgrading = !this.isUpgrading;
        });
      // 开启自动刷新
      this.appUpgreading = true;
      }else{
        downloadSdk({path:this.productDetail.productBaseId}).then((res)=>{
        this.$notify({
          title: "成功",
          message: "升级完成",
          type: "success",
        });
        this.needToUpgradeInWin=false
        this.productDetail.isUpgrade = false
        this.isUpgrading = !this.isUpgrading;
      }).catch((err)=>{
        this.$notify({
@@ -1717,6 +1769,10 @@
        this.isUpgrading = !this.isUpgrading;
      })
      this.sdkUpgreading = true;
      }
    },
    donwload(item) {
@@ -1916,12 +1972,15 @@
            .right-desc {
              float: left;
              position: absolute;
             left: 145px;
                 left: 140px;
              .name {
                    font-size: 28px;
                // font-weight: bold;
                margin-bottom: 5px;
                text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
          width: 250px;
              }
              .tags {
                margin-bottom: 10px;
@@ -2076,11 +2135,11 @@
                position: absolute;
                top: 61%;
                   left: 12%;
    width: 100px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
        font-size: 13px;
            width: 100px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
              font-size: 13px;
                }
              }
@@ -2249,7 +2308,8 @@
            max-width: 200px;
            .mask {
              width: 100%;
              .el-button + .el-button {
                margin-left: 0 !important;
              }
@@ -2498,6 +2558,7 @@
        flex-wrap: wrap;
        justify-content: center;
        top: 0;
        .bot-btn {
          flex: 1;
        }
src/pages/analysisPower/index/App.vue
@@ -285,7 +285,7 @@
  methods: {
    ipSortMethod(a,b){
      console.log(a,b);
      debugger
      // debugger
      if(Number(a.ip.substr(a.ip.lastIndexOf('.')+1)) < Number(b.ip.substr(b.ip.lastIndexOf('.')+1))){
        return -1;
      }
src/pages/panoramicView/components/LabelMark.vue
@@ -297,7 +297,7 @@
  },
  methods: {
    labelOver(item) {
      debugger
      // debugger
      this.$nextTick(() => {
        item.isShow = true;
      })
@@ -399,7 +399,7 @@
      let param = new FormData();
      param.append('file', params.file)
      putPanoramaPic(param).then(res => {
        debugger
        // debugger
        //_this.panoramaPath = res.data.panoramaPath + '?' + Math.random();
        _this.getPanorama()
        _this.$parent.$refs['tracePlot'] && _this.$parent.$refs['tracePlot'].getPanorama();
src/pages/panoramicView/components/RelateCamera.vue
@@ -214,7 +214,7 @@
      })
    },
    saveRelativePolygon (item) {
      debugger
      // debugger
      if (!item.sourceObj || !item.targetObj) {
        this.$notify({
          type: 'warning',
@@ -333,7 +333,7 @@
    },
    editGroup (group) {
      debugger
      // debugger
      this.groupModelVisible = true;
      //this.$refs['groupForm'].resetFields();
      //this.groupForm = group;
src/pages/shuohuangMonitorAnalyze/components/leftNav.vue
@@ -75,7 +75,7 @@
  mounted(){
    console.log('mounted')
    window.onbeforeunload = () => {
      debugger
      // debugger
      console.log('beforeunload')
      sessionStorage.setItem('leftNavAct', this.activeIndex);
    }