From 02b999f414eba7479e46dc6741200a8bcb28edaf Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 2 Jul 2024 14:53:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=AA=E8=A1=A8=E6=9D=BF=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E5=92=8C=E9=AB=98=E5=BA=A6=E7=BC=A9=E6=94=BE=E7=9A=84?= =?UTF-8?q?=E8=BE=83=E5=B0=8F=E5=80=BC=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=B1=8F=E5=B9=95=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E5=B0=BA=E5=AF=B8=E5=8F=98=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=A7=86=E5=9B=BE=E9=AB=98=E5=BA=A6=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E5=AF=BC=E8=87=B4=E8=A7=86=E5=9B=BE=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/DePreview.vue | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index b62d69168e..19bbcb4b81 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -80,6 +80,8 @@ const { } = toRefs(props) const domId = 'preview-' + canvasId.value const scaleWidth = ref(100) +const scaleHeight = ref(100) +const scaleMin = ref(100) const previewCanvas = ref(null) const cellWidth = ref(10) const cellHeight = ref(10) @@ -103,7 +105,7 @@ const canvasStyle = computed(() => { ? downloadStatus.value ? getDownloadStatusMainHeight() : '100%' - : changeStyleWithScale(canvasStyleData.value?.height, scaleWidth.value) + 'px' + : changeStyleWithScale(canvasStyleData.value?.height, scaleMin.value) + 'px' } } if (!dashboardActive.value) { @@ -150,18 +152,16 @@ const resetLayout = () => { let canvasWidth = previewCanvas.value.clientWidth let canvasHeight = previewCanvas.value.clientHeight scaleWidth.value = Math.floor((canvasWidth * 100) / canvasStyleData.value.width) + scaleHeight.value = Math.floor((canvasHeight * 100) / canvasStyleData.value.height) + scaleMin.value = Math.min(scaleWidth.value, scaleHeight.value) if (dashboardActive.value) { cellWidth.value = canvasWidth / pcMatrixCount.value.x cellHeight.value = canvasHeight / pcMatrixCount.value.y - scaleWidth.value = isMainCanvas(canvasId.value) - ? scaleWidth.value * 1.2 + scaleMin.value = isMainCanvas(canvasId.value) + ? scaleMin.value * 1.2 : outerScale.value * 100 } else { - changeRefComponentsSizeWithScale( - componentData.value, - canvasStyleData.value, - scaleWidth.value - ) + changeRefComponentsSizeWithScale(componentData.value, canvasStyleData.value, scaleMin.value) } } }) @@ -216,7 +216,7 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => { waterDomId, canvasId.value, dvInfo.value.selfWatermarkStatus, - scaleWidth.value / 100 + scaleMin.value / 100 ) } else { const method = personInfoApi @@ -229,7 +229,7 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => { waterDomId, canvasId.value, dvInfo.value.selfWatermarkStatus, - scaleWidth.value / 100 + scaleMin.value / 100 ) } }) @@ -339,7 +339,7 @@ defineExpose({ :style="getShapeItemShowStyle(item)" :show-position="showPosition" :search-count="searchCount" - :scale="mobileInPc ? 100 : scaleWidth" + :scale="mobileInPc ? 100 : scaleMin" :is-selector="props.isSelector" @userViewEnlargeOpen="userViewEnlargeOpen($event, item)" @onPointClick="onPointClick"