From acfc96e3d95c756d751bb2f92f9f50d15b78076d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 28 Feb 2025 15:58:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E7=94=BB=E5=B8=83=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=A4=A7=E6=AF=94=E4=BE=8B=E6=94=BE=E5=A4=A7=E6=98=AF?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E7=BB=84=E4=BB=B6=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E7=94=BB=E5=B8=83=E7=BC=96=E8=BE=91=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/data-visualization/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue index 708dfad4dc..d439d3f904 100644 --- a/core/core-frontend/src/views/data-visualization/index.vue +++ b/core/core-frontend/src/views/data-visualization/index.vue @@ -162,8 +162,8 @@ const contentStyle = computed(() => { } else { return { minWidth: '1600px', - width: width * 1.5 + 'px', - height: height * 1.5 + 'px' + width: width * scrollOffset.value + 'px', + height: height * scrollOffset.value + 'px' } } }) @@ -259,6 +259,8 @@ const initDataset = () => { }) } +const scrollOffset = computed(() => (canvasStyleData.value.scale < 150 ? 1.5 : 2)) + // 全局监听按键事件 listenGlobalKeyDown() @@ -268,8 +270,8 @@ const initScroll = () => { const { width, height } = canvasStyleData.value const mainWidth = canvasCenterRef.value.clientWidth mainHeight.value = canvasCenterRef.value.clientHeight - const scrollX = (1.5 * width - mainWidth) / 2 - const scrollY = (1.5 * height - mainHeight.value) / 2 + 20 + const scrollX = (scrollOffset.value * width - mainWidth) / 2 + const scrollY = (scrollOffset.value * height - mainHeight.value) / 2 + 20 // 设置画布初始滚动条位置 canvasOut.value.scrollTo(scrollX, scrollY) }