From af3c22280baa2a6e8de38dd3e7929111af2ee190 Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 4 Nov 2024 16:28:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E5=AD=98=E9=87=8F?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E4=B8=8D=E5=90=88=E5=B9=B6=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/views/components/ChartComponentS2.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index bc01240514..f063ff8c4d 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -29,6 +29,7 @@ import { deepCopy } from '@/utils/utils' import { useEmitt } from '@/hooks/web/useEmitt' import { trackBarStyleCheck } from '@/utils/canvasUtils' import { type SpreadSheet } from '@antv/s2' +import { parseJson } from '../../js/util' const dvMainStore = dvMainStoreWithOut() const { @@ -165,10 +166,19 @@ const renderChartFromDialog = (viewInfo: Chart, chartDataInfo) => { chartData.value = chartDataInfo renderChart(viewInfo, false) } +// 处理存量图表的默认值 +const handleDefaultVal = (chart: Chart) => { + const customAttr = parseJson(chart.customAttr) + // 明细表默认合并单元格,存量的不合并 + if (customAttr.tableCell.mergeCells === undefined) { + customAttr.tableCell.mergeCells = false + } +} const renderChart = (viewInfo: Chart, resetPageInfo: boolean) => { if (!viewInfo) { return } + handleDefaultVal(viewInfo) // view 为引用对象 需要存库 view.data 直接赋值会导致保存不必要的数据 actualChart = deepCopy({ ...defaultsDeep(viewInfo, cloneDeep(BASE_VIEW_CONFIG)),