Merge pull request #7922 from dataease/pr@dev-v2@fix_pivot_null_main_dimension_sort

fix(视图-透视表): 修复主维度为空时使用排序导致视图渲染失败
This commit is contained in:
wisonic-s 2024-01-30 17:46:44 +08:00 committed by GitHub
commit 7c7d38be24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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) => {