fix(视图-透视表): 修复主维度为空时使用排序导致视图渲染失败

This commit is contained in:
wisonic 2024-01-30 17:40:25 +08:00
parent c62a1b5fdd
commit cb237f246e

View File

@ -319,13 +319,13 @@ function customCalcFunc(query, data, totalCfgMap) {
const result = minBy(data, n => {
return n[query[EXTRA_FIELD]]
})
return result[query[EXTRA_FIELD]]
return result?.[query[EXTRA_FIELD]]
}
case 'MAX': {
const result = maxBy(data, n => {
return n[query[EXTRA_FIELD]]
})
return result[query[EXTRA_FIELD]]
return result?.[query[EXTRA_FIELD]]
}
default: {
return data.reduce((p, n) => {