| | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('message', e => { |
| | | console.log(e) |
| | | if (e.data && e.data.msg == "logout") { |
| | | location.assign("/"); |
| | | } |
| | |
| | | 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, |
| | |
| | | useCORS : true //开启跨域配置 |
| | | }).then(canvas => { |
| | | let shotSrc = canvas.toDataURL(); |
| | | debugger; |
| | | this.$store.commit('desktop/addMinDock', { |
| | | id: this.data.id, |
| | | src: this.data.icon, |
| | |
| | | }, |
| | | directives: { |
| | | drag(el) { |
| | | |
| | | if(el.dragLock){ |
| | | |
| | | if (el.dragLock) { |
| | | return |
| | | } |
| | | el.onmousedown = function (e) { |
| | |
| | | } |
| | | }, |
| | | resize(el, binding, vnode) { |
| | | if(el.resizeLock){ |
| | | if (el.resizeLock) { |
| | | return; |
| | | } |
| | | el.onmousedown = function (e) { |