mirror of
https://github.com/dataease/dataease.git
synced 2026-05-21 12:45:37 +08:00
fix(图表): 修复透视表列小计自定义汇总未定义导致图表渲染失败 (#15281)
This commit is contained in:
@@ -470,7 +470,7 @@ onMounted(() => {
|
||||
<el-radio-group
|
||||
:effect="themes"
|
||||
v-model="state.tableTotalForm.row.reverseSubLayout"
|
||||
:disabled="chart.xAxis.length < 2"
|
||||
:disabled="chart.xAxis.length < 2 || state.basicStyleForm.tableLayoutMode === 'tree'"
|
||||
@change="changeTableTotal('row')"
|
||||
>
|
||||
<el-radio :effect="themes" :label="true">{{ t('chart.total_pos_top') }}</el-radio>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user