From 158b3a1e2964f5c0283a247ae7dbe88adc077bc0 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 10 Oct 2021 23:44:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=94=BB=E5=B8=83=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/index.vue | 36 ++++++++++--------- .../components/canvas/components/Toolbar.vue | 21 ++++++++--- .../src/views/panel/SubjectSetting/index.vue | 24 ++++++------- 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 0440f50e0e..276a746f31 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -1007,7 +1007,7 @@ export default { handler(newVal, oldVla) { // console.log('newVal:' + JSON.stringify(newVal) + ';oldVla:' + JSON.stringify(oldVla)) // 初始化时componentData 加载可能出现慢的情况 此时重新初始化一下matrix - if (this.lastComponentDataLength === 0 && newVal.length > 0) { + if (newVal.length !== this.lastComponentDataLength) { this.lastComponentDataLength = newVal.length this.initMatrix() } @@ -1676,23 +1676,25 @@ export default { }) }, startMoveIn() { - const moveInItemInfo = this.$store.state.dragComponentInfo - this.addItemBox(moveInItemInfo) - // console.log('startMoveIn:') - const vm = this - // e.preventDefault(); - if (!this.infoBox) { - this.infoBox = {} + if (this.canvasStyleData.auxiliaryMatrix) { + const moveInItemInfo = this.$store.state.dragComponentInfo + this.addItemBox(moveInItemInfo) + console.log('startMoveIn:') + const vm = this + // e.preventDefault(); + if (!this.infoBox) { + this.infoBox = {} + } + const infoBox = this.infoBox + + infoBox.moveItem = moveInItemInfo + infoBox.moveItemIndex = this.yourList.length - 1 + + infoBox.oldX = 1 // 实际对象原始X位置 + infoBox.oldY = 1 + infoBox.oldSizeX = moveInItemInfo.sizex + infoBox.oldSizeY = moveInItemInfo.sizey } - const infoBox = this.infoBox - - infoBox.moveItem = moveInItemInfo - infoBox.moveItemIndex = this.yourList.length - 1 - - infoBox.oldX = 1 // 实际对象原始X位置 - infoBox.oldY = 1 - infoBox.oldSizeX = moveInItemInfo.sizex - infoBox.oldSizeY = moveInItemInfo.sizey } } } diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 37a74de395..c400d1f7cc 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -13,10 +13,21 @@