From 69d53f0bb6c4acbffe6704a06a257c364fcaa49b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 31 Dec 2021 15:34:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=8D=E5=90=8C=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=97=B6=E6=98=BE=E7=A4=BA=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Editor/ComponentWrapper.vue | 1 + .../src/components/dataease/DeOutWidget.vue | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index 1b4d51095d..86b7d657fe 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -12,6 +12,7 @@ :id="'component' + config.id" class="component-custom" :style="getComponentStyleDefault(config.style)" + style="overflow: hidden" :out-style="config.style" :element="config" :in-screen="inScreen" diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index c08686c29e..42ef2809cd 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -87,8 +87,7 @@ export default { computed: { sizeInfo() { let size - if (this.duHeight > this.inputMaxSize) { - } else if (this.duHeight > this.inputLargeSize) { + if (this.duHeight > this.inputLargeSize) { size = 'medium' } else if (this.duHeight > this.inputSmallSize) { size = 'small' @@ -101,6 +100,14 @@ export default { 'curCanvasScale' ]) }, + watch: { + element: { + handler() { + this.watchSize() + }, + deep: true + } + }, mounted() { this.watchSize() }, @@ -121,13 +128,15 @@ export default { return } const titleWidth = this.$refs.deTitle.offsetWidth - this.duHeight = height - titleWidth this.$nextTick(() => { - let min = this.element.style.fontSize * 2 + 50 + let numRange = 0 + let min = this.element.style.fontSize * 2 + 30 if (this.element.component === 'de-number-range') { - min = this.element.style.fontSize * 2 + 80 + min = this.element.style.fontSize * 2 + 55 + numRange = 25 } if (height < min) { + this.duHeight = height - numRange this.mainClass = 'condition-main-line' if (deContentContainer) { @@ -135,6 +144,7 @@ export default { deContentContainer.style.marginLeft = (titleWidth + 15) + 'px' } } else { + this.duHeight = height - titleWidth + numRange this.mainClass = '' if (deContentContainer) { deContentContainer.style.top = '2em'