From d1d156c4dd0cbe31edbec64aee27ae1bd868bba7 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 22 Dec 2021 16:36:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=96=B0=E7=BB=84=E4=BB=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E6=9C=80=E5=BA=95=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/ComponentWrapper.vue | 6 +++++- .../canvas/components/Editor/MobileCheckBar.vue | 4 ++-- frontend/src/store/index.js | 12 +++++++----- frontend/src/views/panel/edit/ComponentWaitItem.vue | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index 7a8799376a..7bcaac1c3e 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -148,7 +148,11 @@ export default { height: '100%' } } else { - return getStyle(style, ['top', 'left', 'width', 'height', 'rotate']) + if (this.terminal === 'pc') { + return getStyle(style, ['top', 'left', 'width', 'height', 'rotate']) + } else { + return getStyle(style, ['top', 'left', 'width', 'height', 'rotate', 'fontSize']) + } } }, diff --git a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue index 8f248b0219..9e9b10f45d 100644 --- a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue +++ b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue @@ -38,11 +38,11 @@ export default { this.element.style.width = 1600 this.element.style.height = 300 this.element.style.left = 0 - this.element.style.top = 0 + this.element.style.top = 6000 this.element.sizex = 6 this.element.sizey = 4 this.element.x = 1 - this.element.y = 1 + this.element.y = 200 this.element.auxiliaryMatrix = true this.$store.commit('addComponent', { component: this.element }) } else { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 403d57fa8f..3ddfc261d3 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -149,11 +149,13 @@ const data = { } }, setShapeStyle({ curComponent, canvasStyleData, curCanvasScale }, { top, left, width, height, rotate }) { - if (top || top === 0) curComponent.style.top = (top / curCanvasScale.scalePointHeight) + 0.0000001 - if (left || left === 0) curComponent.style.left = (left / curCanvasScale.scalePointWidth) + 0.0000001 - if (width || width === 0) curComponent.style.width = (width / curCanvasScale.scalePointWidth + 0.0000001) - if (height || height === 0) curComponent.style.height = (height / curCanvasScale.scalePointHeight) + 0.0000001 - if (rotate || rotate === 0) curComponent.style.rotate = rotate + if (curComponent) { + if (top || top === 0) curComponent.style.top = (top / curCanvasScale.scalePointHeight) + 0.0000001 + if (left || left === 0) curComponent.style.left = (left / curCanvasScale.scalePointWidth) + 0.0000001 + if (width || width === 0) curComponent.style.width = (width / curCanvasScale.scalePointWidth + 0.0000001) + if (height || height === 0) curComponent.style.height = (height / curCanvasScale.scalePointHeight) + 0.0000001 + if (rotate || rotate === 0) curComponent.style.rotate = rotate + } }, setShapeSingleStyle({ curComponent }, { key, value }) { diff --git a/frontend/src/views/panel/edit/ComponentWaitItem.vue b/frontend/src/views/panel/edit/ComponentWaitItem.vue index 3da0513283..44db19a94a 100644 --- a/frontend/src/views/panel/edit/ComponentWaitItem.vue +++ b/frontend/src/views/panel/edit/ComponentWaitItem.vue @@ -71,7 +71,7 @@ export default { return { padding: '5px', display: 'inline-block', - width: '33.3333%' + width: '33%' } }, ...mapState([