Merge pull request #9513 from dataease/pr@dev@fix_table_pivot_calc_field_error

fix(视图): 修复透视表使用计算字段导致渲染失败
This commit is contained in:
wisonic-s 2024-05-07 17:34:53 +08:00 committed by GitHub
commit 700e8d9760
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1058,7 +1058,7 @@ function customCalcFunc(query, data, totalCfgMap) {
if (!data?.length || !query[EXTRA_FIELD]) {
return 0
}
const aggregation = totalCfgMap[query[EXTRA_FIELD]].aggregation
const aggregation = totalCfgMap[query[EXTRA_FIELD]]?.aggregation ?? 'SUM'
switch (aggregation) {
case 'SUM': {
return data.reduce((p, n) => {