From 8483fd828f90c05487ab0f7ccbba9510e0a3745a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 25 Oct 2023 13:18:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E7=BF=BB=E9=A1=B5=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/dvMain.ts | 6 +++++- .../components/views/components/ChartComponentS2.vue | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index 88148d13b7..1ac36ccf3c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -577,7 +577,11 @@ export const dvMainStore = defineStore('dataVisualization', { } else { viewInfo[propertyInfo.custom][propertyInfo.property] = propertyInfo.value } - useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + if (['tablePageMode', 'tablePageSize'].includes(propertyInfo.subProp)) { + useEmitt().emitter.emit('calcData-' + viewId, viewInfo) + } else { + useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + } }) } else { this.componentData.forEach(component => { 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 74d072a1bc..6e0093baf9 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 @@ -108,18 +108,21 @@ const renderChartFromDialog = (viewInfo: Chart, chartDataInfo) => { chartData.value = chartDataInfo renderChart(viewInfo, false) } -const renderChart = (view: Chart, resetPageInfo: boolean) => { - if (!view) { +const renderChart = (viewInfo: Chart, resetPageInfo: boolean) => { + if (!viewInfo) { return } // view 为引用对象 需要存库 view.data 直接赋值会导致保存不必要的数据 const chart = { - ...defaultsDeep(view, cloneDeep(BASE_VIEW_CONFIG)), + ...defaultsDeep(viewInfo, cloneDeep(BASE_VIEW_CONFIG)), data: chartData.value } as ChartObj setupPage(chart, resetPageInfo) myChart?.destroy() - const chartView = chartViewManager.getChartView(view.render, view.type) as S2ChartView + const chartView = chartViewManager.getChartView( + viewInfo.render, + viewInfo.type + ) as S2ChartView myChart = chartView.drawChart({ container: containerId, chart: toRaw(chart),