From 5c5ba0cb0e8ba4048356b5af5af88ee672461324 Mon Sep 17 00:00:00 2001 From: wisonic-s <51065359+wisonic-s@users.noreply.github.com> Date: Tue, 11 Mar 2025 16:48:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=8F=E8=A7=86=E8=A1=A8=E5=88=97=E5=B0=8F=E8=AE=A1=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=B1=87=E6=80=BB=E6=9C=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=9B=BE=E8=A1=A8=E6=B8=B2=E6=9F=93=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20(#15281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/table/TableTotalSelector.vue | 2 +- .../components/js/panel/charts/table/table-pivot.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue index b87d8c83e8..6b00e478db 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue @@ -470,7 +470,7 @@ onMounted(() => { {{ t('chart.total_pos_top') }} diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index 41c36e075a..dfeda71b63 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -724,8 +724,8 @@ function customCalcFunc(query, data, status, chart, totalCfgMap, axisMap, custom } case 'CUSTOM': { const val = getCustomCalcResult(query, axisMap, chart, status, customCalc || {}) - if (val === '') { - return val + if (val === '' || val === undefined) { + return '-' } return parseFloat(val) } @@ -820,7 +820,7 @@ function getTreeCustomCalcResult(query, axisMap, status: TotalStatus, customCalc if (status.isRowTotal && status.isColSubTotal) { const { colSubInRowTotal } = customCalc const colLevel = getSubLevel(query, col) - const { data } = colSubInRowTotal?.[colLevel] + const data = colSubInRowTotal?.[colLevel]?.data const colPath = getTreePath(query, col) let val if (colPath.length && colSubInRowTotal) { @@ -858,7 +858,7 @@ function getTreeCustomCalcResult(query, axisMap, status: TotalStatus, customCalc } return val } - return NaN + return '-' } function getGridCustomCalcResult(query, axisMap, status: TotalStatus, customCalc) { @@ -932,7 +932,7 @@ function getGridCustomCalcResult(query, axisMap, status: TotalStatus, customCalc if (status.isRowTotal && status.isColSubTotal) { const { colSubInRowTotal } = customCalc const colLevel = getSubLevel(query, col) - const { data } = colSubInRowTotal?.[colLevel] + const data = colSubInRowTotal?.[colLevel]?.data const colPath = getTreePath(query, col) let val if (colPath.length && colSubInRowTotal) {