From 4838df781f2706547da2008ef84dcbea25b20106 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 9 Mar 2026 17:09:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=8A=96?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/editor/index.vue | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index 1e1a7c892f..4d33b4055e 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -1983,6 +1983,30 @@ const deleteChartFieldItem = id => { fieldLoading.value = false }) } + +let directionTop = 0 +const scrollToTop = debounce(() => { + chartStyleRef.value.setScrollTop(directionTop) + directionTop = 0 +}, 10) + +const chartStyleRef = ref() +const chartStyleScroll = (val: any) => { + if (chartStyleRef.value) { + if (directionTop === 0) { + directionTop = val.scrollTop + } + if (val.scrollTop - directionTop > 0) { + // 向下滚 + directionTop = val.scrollTop - 1 + scrollToTop() + } else if (val.scrollTop === 0) { + // 向上滚 + directionTop = 1 + scrollToTop() + } + } +}