hanbaoshan
2020-08-01 84f11d4ca59f9580a7e7de5471e3eb86ea14c16b
src/pages/desktop/index/components/DFrame.vue
@@ -44,7 +44,6 @@
  },
  mounted() {
    window.addEventListener('message', e => {
      console.log(e)
      if (e.data && e.data.msg == "logout") {
        location.assign("/");
      }
@@ -62,10 +61,8 @@
      this.$store.commit('desktop/refreshFrame', this.data);
    },
    minFrame: function (data) {
      debugger
      //找到当前的iframe
      let curIframe = Array.from(document.querySelectorAll('iframe')).find(iframe => iframe.src.indexOf(data.url) >= 0);
      debugger
      //保存当前应用快照
      html2canvas(curIframe.contentWindow.document.body,{
        dpi: window.devicePixelRatio*4,
@@ -75,7 +72,6 @@
        useCORS : true //开启跨域配置
      }).then(canvas => {
        let shotSrc = canvas.toDataURL();
        debugger;
        this.$store.commit('desktop/addMinDock', {
          id: this.data.id,
          src: this.data.icon,
@@ -100,8 +96,8 @@
  },
  directives: {
    drag(el) {
      if(el.dragLock){
      if (el.dragLock) {
        return
      }
      el.onmousedown = function (e) {
@@ -122,7 +118,7 @@
      }
    },
    resize(el, binding, vnode) {
      if(el.resizeLock){
      if (el.resizeLock) {
        return;
      }
      el.onmousedown = function (e) {