From 1b2a2c24d5140b5496c8a224e64003f6b96d5405 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 8 Oct 2024 17:19:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E5=B1=8F=E5=B9=95=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=BD=AC=E5=8F=98=E5=AF=BC=E8=87=B4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=A4=A7=E5=B1=8F=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=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 | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 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 7c7901eaaf..277c5c1bd7 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -126,6 +126,9 @@ const baseComponentData = computed(() => ) const canvasStyle = computed(() => { let style = {} + if (isMainCanvas(canvasId.value) && !isDashboard()) { + style['overflowY'] = 'hidden !important' + } if (canvasStyleData.value && canvasStyleData.value.width && isMainCanvas(canvasId.value)) { style = { ...getCanvasStyle(canvasStyleData.value), @@ -236,30 +239,10 @@ const resetLayout = () => { } }) } - -const restorePre = () => { - if (previewCanvas.value) { - //div容器获取tableBox.value.clientWidth - let canvasWidth = previewCanvas.value.clientWidth - let canvasHeight = previewCanvas.value.clientHeight - scaleWidthPoint.value = (canvasWidth * 100) / canvasStyleData.value.width - scaleHeightPoint.value = (canvasHeight * 100) / canvasStyleData.value.height - scaleMin.value = isDashboard() - ? Math.floor(Math.min(scaleWidthPoint.value, scaleHeightPoint.value)) - : scaleWidthPoint.value - if (dashboardActive.value) { - cellWidth.value = canvasWidth / pcMatrixCount.value.x - cellHeight.value = canvasHeight / pcMatrixCount.value.y - scaleMin.value = isMainCanvas(canvasId.value) ? scaleMin.value * 1.2 : outerScale.value * 100 - } - renderReady.value = true - } -} const restore = () => { if (isReport.value) { return } - restorePre() resetLayout() } @@ -403,7 +386,9 @@ const filterBtnShow = computed( const datasetParamsInit = item => { customDatasetParamsRef.value?.optInit(item) } - +const dataVPreview = computed( + () => dvInfo.value.type === 'dataV' && canvasId.value === 'canvas-main' +) defineExpose({ restore }) @@ -414,7 +399,7 @@ defineExpose({ :id="domId" class="canvas-container" :style="canvasStyle" - :class="{ 'de-download-custom': downloadStatus }" + :class="{ 'de-download-custom': downloadStatus, 'datav-preview': dataVPreview }" ref="previewCanvas" @mousedown="handleMouseDown" > @@ -487,4 +472,8 @@ defineExpose({ .fix-button { position: fixed !important; } + +.datav-preview { + overflow-y: hidden !important; +}