From 7a8198b7c790a5cacc44f53e740cabf0bd9e8a85 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 13 Oct 2021 14:19:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=97=B6=E5=85=A8=E5=B1=8F=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?scroll=E6=97=B6=20=E6=A0=B7=E5=BC=8F=E7=BB=84=E4=BB=B6=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8E=BB=E6=8E=89=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=89=8D=E6=AE=B5=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/index.vue | 2 +- frontend/src/views/panel/edit/index.vue | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/index.vue b/frontend/src/components/canvas/index.vue index 201d42e639..d8c3d139af 100644 --- a/frontend/src/components/canvas/index.vue +++ b/frontend/src/components/canvas/index.vue @@ -35,7 +35,7 @@ import Toolbar from '@/components/Toolbar' import { deepCopy } from '@/utils/utils' import { mapState } from 'vuex' import generateID from '@/utils/generateID' -import { listenGlobalKeyDown } from '@/utils/shortcutKey' +// import { listenGlobalKeyDown } from '@/utils/shortcutKey' export default { // eslint-disable-next-line vue/no-unused-components diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 73bd7eb040..a96046c3fd 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -104,8 +104,9 @@ @dragover="handleDragOver" @mousedown="handleMouseDown" @mouseup="deselectCurComponent" + @scroll="canvasScroll" > - + @@ -188,7 +189,7 @@ import bus from '@/utils/bus' import Editor from '@/components/canvas/components/Editor/index' import { deepCopy } from '@/components/canvas/utils/utils' import componentList from '@/components/canvas/custom-component/component-list' // 左侧列表数据 -import { listenGlobalKeyDown } from '@/components/canvas/utils/shortcutKey' +// import { listenGlobalKeyDown } from '@/components/canvas/utils/shortcutKey' import { mapState } from 'vuex' import { uuid } from 'vue-uuid' import Toolbar from '@/components/canvas/components/Toolbar' @@ -345,7 +346,7 @@ export default { this.init(this.$store.state.panel.panelInfo.id) // this.restore() // 全局监听按键事件 - listenGlobalKeyDown() + // listenGlobalKeyDown() this.$store.commit('setCurComponent', { component: null, index: null }) this.$store.commit('clearLinkageSettingInfo', false) @@ -654,7 +655,8 @@ export default { const canvasHeight = document.getElementById('canvasInfo').offsetHeight const canvasWidth = document.getElementById('canvasInfo').offsetWidth this.outStyle.height = canvasHeight - this.outStyle.width = canvasWidth + // 临时处理 确保每次restore 有会更新 + this.outStyle.width = canvasWidth + (Math.random() * 0.000001) // console.log(canvasHeight + '--' + canvasWidth) }) }