mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
feat(图表): 透视表总计支持设置为无 #9732
This commit is contained in:
@@ -32,6 +32,7 @@ watch(
|
||||
)
|
||||
|
||||
const aggregations = [
|
||||
{ name: t('chart.none'), value: 'NONE' },
|
||||
{ name: t('chart.sum'), value: 'SUM' },
|
||||
{ name: t('chart.avg'), value: 'AVG' },
|
||||
{ name: t('chart.max'), value: 'MAX' },
|
||||
|
||||
@@ -538,7 +538,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
}
|
||||
function customCalcFunc(query, data, status, chart, totalCfgMap, axisMap, customCalc) {
|
||||
if (!data?.length || !query[EXTRA_FIELD]) {
|
||||
return 0
|
||||
return '-'
|
||||
}
|
||||
const aggregation = totalCfgMap[query[EXTRA_FIELD]]?.aggregation || 'SUM'
|
||||
switch (aggregation) {
|
||||
@@ -565,6 +565,9 @@ function customCalcFunc(query, data, status, chart, totalCfgMap, axisMap, custom
|
||||
})
|
||||
return result?.[query[EXTRA_FIELD]]
|
||||
}
|
||||
case 'NONE': {
|
||||
return '-'
|
||||
}
|
||||
case 'CUSTOM': {
|
||||
const val = getCustomCalcResult(query, axisMap, chart, status, customCalc || {})
|
||||
if (val === '') {
|
||||
|
||||
Reference in New Issue
Block a user