From e9bd3bfdfc5cf8b783aa9682e7a3d72d9c45b2fb Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sat, 9 Oct 2021 22:36:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=94=BB=E6=9D=BF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/EditBar.vue | 32 +++++++++++++------ .../canvas/components/Editor/PGrid.vue | 4 +-- .../canvas/components/Editor/index.vue | 6 ++-- frontend/src/store/index.js | 4 +-- frontend/src/views/panel/edit/index.vue | 2 ++ frontend/src/views/panel/list/PanelList.vue | 1 + 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/EditBar.vue b/frontend/src/components/canvas/components/Editor/EditBar.vue index 7b6529a0af..e1de137fc3 100644 --- a/frontend/src/components/canvas/components/Editor/EditBar.vue +++ b/frontend/src/components/canvas/components/Editor/EditBar.vue @@ -15,10 +15,10 @@ - + - + @@ -61,13 +61,16 @@ export default { return { componentType: null, linkageActiveStatus: false, - auxiliaryMatrix: false, editFilter: [ 'view', 'custom' - ] + ], + timer: null } }, + mounted() { + this.createTimer() + }, computed: { existLinkage() { let linkageFiltersCount = 0 @@ -85,9 +88,6 @@ export default { linkageInfo() { return this.targetLinkageInfo[this.element.propValue.viewId] }, - mounted() { - this.auxiliaryMatrix = this.$store.state.curComponent.auxiliaryMatrix - }, ...mapState([ 'menuTop', 'menuLeft', @@ -101,7 +101,23 @@ export default { 'curCanvasScale' ]) }, + beforeDestroy() { + this.destroyTimer() + }, methods: { + createTimer() { + if (!this.timer) { + this.timer = setInterval(() => { + console.log('t=' + this.curComponent.auxiliaryMatrix) + }, 5000) + } + }, + destroyTimer() { + if (this.timer) { + clearInterval(this.timer) + this.timer = null + } + }, showViewDetails() { this.$emit('showViewDetails') }, @@ -112,14 +128,12 @@ export default { this.curComponent.style.width = this.curComponent.sizex * this.curCanvasScale.matrixStyleOriginWidth this.curComponent.style.height = this.curComponent.sizey * this.curCanvasScale.matrixStyleOriginHeight this.curComponent.auxiliaryMatrix = false - this.auxiliaryMatrix = false } else { this.curComponent.x = Math.round(this.curComponent.style.left / this.curCanvasScale.matrixStyleOriginWidth) + 1 this.curComponent.y = Math.round(this.curComponent.style.top / this.curCanvasScale.matrixStyleOriginHeight) + 1 this.curComponent.sizex = Math.round(this.curComponent.style.width / this.curCanvasScale.matrixStyleOriginWidth) this.curComponent.sizey = Math.round(this.curComponent.style.height / this.curCanvasScale.matrixStyleOriginHeight) this.curComponent.auxiliaryMatrix = true - this.auxiliaryMatrix = true } this.$store.state.styleChangeTimes++ bus.$emit('auxiliaryMatrixChange') diff --git a/frontend/src/components/canvas/components/Editor/PGrid.vue b/frontend/src/components/canvas/components/Editor/PGrid.vue index dab615d575..ac819304d7 100644 --- a/frontend/src/components/canvas/components/Editor/PGrid.vue +++ b/frontend/src/components/canvas/components/Editor/PGrid.vue @@ -1,9 +1,9 @@