From f9a0ec3d202060e6721c0ec4d5761806e49d7b55 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 15 Sep 2021 18:11:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=87=AA=E5=8A=A8=E8=BF=9B=E8=A1=8C=E6=97=A0=E9=99=90?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=EF=BC=8C=E5=8F=96=E6=B6=88=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E5=B0=BA=E5=AF=B8=E8=AE=BE=E7=BD=AE=EF=BC=8C=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=B8=BA=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 2 +- .../canvas/components/Editor/Preview.vue | 27 ++++++++++++------- .../canvas/components/Editor/index.vue | 12 ++++++--- .../components/canvas/components/Toolbar.vue | 14 +--------- frontend/src/store/index.js | 3 +++ frontend/src/views/panel/edit/index.vue | 3 +-- .../src/views/panel/list/PanelViewShow.vue | 2 +- 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index af6a34ce39..2a8f91e95c 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -610,7 +610,7 @@ export default { const rect = this.$el.parentNode.getBoundingClientRect() this.parentX = rect.x this.parentY = rect.y - return [Math.round(parseFloat(style.getPropertyValue('width'), 10)), Math.round(parseFloat(style.getPropertyValue('height'), 10))] + return [Math.round(parseFloat(style.getPropertyValue('width'), 10)), 100000] } if (typeof this.parent === 'string') { const parentNode = document.querySelector(this.parent) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 05800834fe..e73b426c00 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -110,12 +110,16 @@ export default { } } } - if (this.canvasStyleData.selfAdaption) { - style = { - overflow: 'hidden', - ...style - } - } + // if (this.canvasStyleData.selfAdaption) { + // style = { + // overflow: 'hidden', + // ...style + // } + // } + // style = { + // overflow-x :'hidden', + // ...style + // } return style }, // 此处单独计算componentData的值 不放入全局mapState中 @@ -168,10 +172,13 @@ export default { const canvasWidth = document.getElementById('canvasInfoTemp').offsetWidth this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)// 获取宽度比 this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)// 获取高度比 - if (this.showType === 'width') { - this.scaleHeight = this.scaleWidth - this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px' - } + + this.scaleHeight = this.scaleWidth + // this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px' + // if (this.showType === 'width') { + // this.scaleHeight = this.scaleWidth + // this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px' + // } this.handleScaleChange() }, resetID(data) { diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index ca686fc356..fdc534aa08 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -12,7 +12,7 @@ @mousedown="handleMouseDown" > - + @@ -216,10 +216,10 @@ export default { width: 80, height: 20 }, - // 矩阵数量 默认 12 * 24 + // 矩阵数量 默认 128 * 72 matrixCount: { - x: 24, - y: 72 + x: 80, + y: 45 }, customStyleHistory: null, showDrag: true, @@ -555,6 +555,9 @@ export default { if (this.canvasStyleData.matrixCount) { this.matrixCount = this.canvasStyleData.matrixCount } + // 1.3 版本重新设计仪表板定位方式,基准画布宽高为 1600*900 宽度自适应当前画布获取缩放比例scaleWidth + // 高度缩放比例scaleHeight = scaleWidth 基础矩阵为128*72 矩阵原始宽度12.5*12.5 矩阵高度可以调整 + if (this.outStyle.width && this.outStyle.height) { // 矩阵计算 if (!this.canvasStyleData.selfAdaption) { @@ -642,6 +645,7 @@ export default { position: relative; /*background: #fff;*/ margin: auto; + overflow-x: hidden; background-size:100% 100% !important; /*transform-style:preserve-3d;*/ .lock { diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index e316e0a2f0..c87a5a95d3 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -17,18 +17,6 @@ {{ $t('panel.matrix_design') }} - -
- - {{ $t('panel.canvas_self_adaption') }} -
- -
- {{ $t('panel.canvas_size') }} - - * - -
@@ -383,7 +371,7 @@ export default { float: right; height: 35px; line-height: 35px; - min-width: 900px; + min-width: 500px; /*background: #fff;*/ /*border-bottom: 1px solid #ddd;*/ diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 46370c74d9..ae045bcd1c 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -79,6 +79,9 @@ const data = { }, setCanvasStyle(state, style) { + if (style) { + style['selfAdaption'] = true + } state.canvasStyleData = style }, diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 683ee0bef9..8575355a59 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -96,7 +96,6 @@
diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index f6490ca8dc..e3f5385e06 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -56,7 +56,7 @@
- +