From 79422ea95ba3e572f72fc8544e7ab84186aa3706 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 6 May 2024 17:09:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=BB=9A=E5=8A=A8=E6=97=B6=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=88=97=E5=AE=BD=E8=A1=A8=E6=A0=BC=E4=BC=9A=E9=94=99=E4=BD=8D?= =?UTF-8?q?=20#8810?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/views/chart/chart/table/table-info.js | 8 ++------ .../src/views/chart/components/ChartComponentS2.vue | 10 ++++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/frontend/src/views/chart/chart/table/table-info.js b/core/frontend/src/views/chart/chart/table/table-info.js index 25d24da3e9..1956b930b7 100644 --- a/core/frontend/src/views/chart/chart/table/table-info.js +++ b/core/frontend/src/views/chart/chart/table/table-info.js @@ -230,9 +230,7 @@ export function baseTableInfo(container, chart, action, tableData, pageInfo, vue // right click s2.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(s2, event, meta)) // column resize - if (size.tableColumnMode === 'field') { - s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event)) - } + s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event)) // theme const customTheme = getCustomTheme(chart) s2.setThemeCfg({ theme: customTheme }) @@ -436,9 +434,7 @@ export function baseTableNormal(container, chart, action, tableData, vueCom, res // right click s2.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(s2, event, meta)) // column resize - if (size.tableColumnMode === 'field') { - s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event)) - } + s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event)) // theme const customTheme = getCustomTheme(chart) s2.setThemeCfg({ theme: customTheme }) diff --git a/core/frontend/src/views/chart/components/ChartComponentS2.vue b/core/frontend/src/views/chart/components/ChartComponentS2.vue index 00634dac36..c2124fdfd2 100644 --- a/core/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/core/frontend/src/views/chart/components/ChartComponentS2.vue @@ -577,12 +577,18 @@ export default { this.remarkCfg = getRemark(this.chart) }, columnResize(resizeColumn) { + // 从头开始滚动 + this.myChart.facet.timer?.stop() + this.$nextTick(this.initScroll) if (!this.inScreen) { - // 预览/全屏预览不保存 + // 预览/全屏预览不保存宽度 + return + } + const size = JSON.parse(this.chart.customAttr).size + if (size.tableColumnMode !== 'field') { return } const fieldId = resizeColumn.info.meta.field - const size = JSON.parse(this.chart.customAttr).size const containerWidth = document.getElementById(this.chartId).offsetWidth const column = size.tableFieldWidth?.find(i => i.fieldId === fieldId) let tableWidth