From 6015f84f8767891d7460c91f2ea27504570ade35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:26:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=95=B0=E5=80=BC=E6=A0=BC=E5=BC=8F=E9=80=82?= =?UTF-8?q?=E9=85=8D=20(#17608)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dashboard/DbCanvasAttr.vue | 3 +++ .../data-visualization/CanvasAttr.vue | 3 +++ .../views/chart/components/js/formatter.ts | 26 ++++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue index 4c4bc85890..355f92d795 100644 --- a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue +++ b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue @@ -74,6 +74,9 @@ const themeAttrChange = (custom, property, value) => { }) } useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + if (viewInfo.type === 'rich-text') { + useEmitt().emitter.emit('calcData-' + viewId, viewInfo) + } } catch (e) { console.warn('themeAttrChange-error') } diff --git a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue index 13660149df..4a5fc0a786 100644 --- a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue +++ b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue @@ -83,6 +83,9 @@ const themeAttrChange = (custom, property, value) => { }) } useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + if (viewInfo.type === 'rich-text') { + useEmitt().emitter.emit('calcData-' + viewId, viewInfo) + } } catch (e) { console.warn('themeAttrChange-error') } diff --git a/core/core-frontend/src/views/chart/components/js/formatter.ts b/core/core-frontend/src/views/chart/components/js/formatter.ts index 729407f5e0..57aa895e14 100644 --- a/core/core-frontend/src/views/chart/components/js/formatter.ts +++ b/core/core-frontend/src/views/chart/components/js/formatter.ts @@ -299,13 +299,25 @@ export const formatterViewInfo = (viewInfo, value) => { viewInfo['customAttr']['label']['totalFormatter'], value ) - viewInfo['customAttr']['tooltip']['tooltipFormatter'] = merge( - viewInfo['customAttr']['tooltip']['tooltipFormatter'], - value - ) - viewInfo['customAttr']['tooltip']['seriesTooltipFormatter'].forEach(function (item) { - item['formatterCfg'] = merge(item['formatterCfg'], value) - }) + if ( + ![ + 'table-info', + 'table-normal', + 'table-pivot', + 'stock-line', + 'bullet-graph', + 'percentage-bar-stack-horizontal' + ].includes(viewInfo.type) + ) { + viewInfo['customAttr']['tooltip']['tooltipFormatter'] = merge( + viewInfo['customAttr']['tooltip']['tooltipFormatter'], + value + ) + viewInfo['customAttr']['tooltip']['seriesTooltipFormatter'].forEach(function (item) { + item['formatterCfg'] = merge(item['formatterCfg'], value) + }) + } + //customStyle viewInfo['customStyle']['xAxis']['axisLabelFormatter'] = merge( viewInfo['customStyle']['xAxis']['axisLabelFormatter'],