heyujie
2021-03-05 3613f5414bef610d8486c01eea3a795d62dabb16
跨aap打开新app
2个文件已修改
77 ■■■■ 已修改文件
src/pages/ai/index/App.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/desktop/index/components/ToolsEntry.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/ai/index/App.vue
@@ -920,7 +920,7 @@
                >{{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" >软件</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" >{{
@@ -928,7 +928,7 @@
                  }}</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(productDetail.productBaseId)">打开</el-button>
                  <el-button size="small" type="success" v-if="!isSDKDialog" @click="openApp">打开</el-button>
                </div>
               
              </div>
@@ -1284,7 +1284,7 @@
    },
    checkInWindow(item){
      this.backStack.push(this.productDetail)
      this.backStack.push([this.productDetail,this.otherProducts])
      // debugger
      this.backDisable = false
      this.curCheckTarget = item;
@@ -1292,10 +1292,9 @@
      let _this = this;
      getAppDetail({ id: item.id }).then((res) => {
        _this.productDetail = res.data.detail;
        // debugger
        this.actId = _this.productDetail.productBaseId
        let flag=false
       const allNeedToNew = [...this.hasNewVersionSdk,...hasNewVersionApp]
       const allNeedToNew = [...this.hasNewVersionSdk,...this.hasNewVersionApp]
        for (let i = 0; i < allNeedToNew.length; i++) {
          const item = allNeedToNew[i];
          if (item.id == _this.productDetail.productBaseId) {
@@ -1313,10 +1312,11 @@
      // forwardDisable:false,
      return
      }
      console.log(this.backStack);
   this.forwardStack.push(this.productDetail)
   this.productDetail =  this.backStack.pop()
   this.forwardStack.push([this.productDetail,this.otherProducts])
   let item = this.backStack.pop()
   this.productDetail =  item[0]
   this.otherProducts = item[1]
  this.forwardDisable=false
 if (this.backStack.length ==0) {
        this.backDisable = true
@@ -1328,11 +1328,13 @@
        this.forwardDisable=true
        return
      }
      console.log(this.backStack);
        this.backStack.push(this.productDetail)
        this.backStack.push([this.productDetail,this.otherProducts])
        this.backDisable=false
      this.productDetail=this.forwardStack.pop()
        let item = this.forwardStack.pop()
        this.productDetail = item[0]
        this.otherProducts = item[1]
      if (this.forwardStack.length==0) {
        this.forwardDisable=true
      }
@@ -1365,7 +1367,6 @@
          }
        })
        .catch((e) => {
          console.log(e);
          this.isInstall = false;
          this.$message({
            type: "error",
@@ -1373,10 +1374,7 @@
          });
        });
    },
    openAPP(id){
      debugger
      bus.$emit('open-app',id)
    },
    downloadApp(app, action) {
      if (action == "upgrade") {
        app.upgradeLoading = true;
@@ -1613,7 +1611,12 @@
          });
        });
    },
    openApp(){
      let message = 'toOpenApp?'+this.productDetail.productBaseId;
      window.parent.postMessage({
        msg: message
      }, "*")
    },
    onFileAdded(f) {
      this.patchUpdateStatus = "";
src/pages/desktop/index/components/ToolsEntry.vue
@@ -88,7 +88,6 @@
      ],
      //rowSize: 3,
      badgeNum: 0,
      curDock: {}
    }
  },
  computed: {
@@ -139,18 +138,15 @@
          let params = msg.substring(7);
          this.addFrameByName("search", params)
        }
        if (msg.indexOf("toOpenApp") >= 0) {
          let id = msg.substring(10);
          console.log(id);
          this.addFrameByID(id)
        }
      }
    });
    this.$nextTick( () =>{
       bus.$on("open-app", (val)=> {
        debugger
        const cur = this.stateDocks.find( (item)=> {
          return item.id == val
        })
        this.dockClick(cur)
        this.curDock = cur
    })
    })
  },
  methods: {
    chunk (arr, size) {
@@ -218,7 +214,6 @@
      dockMask.style.width = dockItems.length * 60 + 40 + 'px';
    },
    addFrameByName (name, params) {
      let dock = null;
      this.$store.state.desktop.docks.forEach(app => {
        if (app.name === name) {
@@ -244,13 +239,22 @@
        url: dock.url,
        screenshot: ''
      });
    },
    addFrameByID (id, params) {
      let dock = null;
      let toClose = null
      this.$store.state.desktop.docks.forEach(app => {
        if (app.id == id) {
          dock = app;
        }
        if(app.name=="algorithmManage"){
          toClose = app
        }
      });
      this.dockClick(dock)
    }
  },
  watch:{
    curDock:function (val) {
      this.dockClick(val)
    }
  },
  }
};
</script>