src/pages/desktop/index/components/DFrame.vue
@@ -107,37 +107,48 @@
      this.$store.commit('desktop/refreshFrame', this.data);
    },
    minFrame(data, e) {
      debugger
      //if(data.name=='cameraVideo'||data.name=='search'||data.name=='library'||data.name=='cameraAccess'||data.name=='dataStack'){
        //let shotSrc = canvas.toDataURL();
        this.$store.commit('desktop/addMinDock', {
          id: this.data.id,
          src: this.data.icon,
          alt: this.data.title,
          type: "3",
          //screenshot: shotSrc
        });
        return false;
      //}
      //找到当前的iframe
      let curIframe = Array.from(document.querySelectorAll('iframe')).find(iframe => iframe.src.indexOf(data.url) >= 0);
      //保存当前应用快照
      html2canvas(curIframe.contentWindow.document.body, {
        dpi: window.devicePixelRatio * 4,
        logging: true, //查看html2canvas内部执行流程
        removeContainer: true,
        imageTimeout: 0,
        useCORS: true, //开启跨域配置
        //allowTaint: true
      }).then(canvas => {
        let shotSrc = canvas.toDataURL();
        this.$store.commit('desktop/addMinDock', {
          id: this.data.id,
          src: this.data.icon,
          alt: this.data.title,
          type: "3",
          screenshot: shotSrc
        });
      }).catch(e=>{
        console.log(e);
        this.$store.commit('desktop/addMinDock', {
          id: this.data.id,
          src: this.data.icon,
          alt: this.data.title,
          type: "3",
          screenshot: ''
        });
      });
      return false;
      // html2canvas(curIframe.contentWindow.document.body, {
      //   dpi: window.devicePixelRatio * 4,
      //   logging: true, //查看html2canvas内部执行流程
      //   removeContainer: true,
      //   imageTimeout: 0,
      //   useCORS: true, //开启跨域配置
      //   //allowTaint: true
      // }).then(canvas => {
      //   let shotSrc = canvas.toDataURL();
      //   this.$store.commit('desktop/addMinDock', {
      //     id: this.data.id,
      //     src: this.data.icon,
      //     alt: this.data.title,
      //     type: "3",
      //     screenshot: shotSrc
      //   });
      // }).catch(e=>{
      //   console.log(e);
      //   this.$store.commit('desktop/addMinDock', {
      //     id: this.data.id,
      //     src: this.data.icon,
      //     alt: this.data.title,
      //     type: "3",
      //     screenshot: ''
      //   });
      // });
      //return false;
      //this.refreshDock();
    },
    refreshDock: function () {
@@ -240,6 +251,7 @@
  border-top: 1px solid #d0d0d0;
  border-left: 1px solid #d0d0d0;
  border-right: 1px solid #d0d0d0;
}
.iframe-mask{
  position: absolute;
@@ -327,6 +339,7 @@
  height: calc(100% - 30px);
  border-radius: 0 0 4px 4px;
  background-color: #fff;
}
.d-frame-content iframe {