forked from github/dataease
fix(视图-透视表): 修复主维度为空时使用排序导致视图渲染失败
This commit is contained in:
parent
c62a1b5fdd
commit
cb237f246e
@ -319,13 +319,13 @@ function customCalcFunc(query, data, totalCfgMap) {
|
|||||||
const result = minBy(data, n => {
|
const result = minBy(data, n => {
|
||||||
return n[query[EXTRA_FIELD]]
|
return n[query[EXTRA_FIELD]]
|
||||||
})
|
})
|
||||||
return result[query[EXTRA_FIELD]]
|
return result?.[query[EXTRA_FIELD]]
|
||||||
}
|
}
|
||||||
case 'MAX': {
|
case 'MAX': {
|
||||||
const result = maxBy(data, n => {
|
const result = maxBy(data, n => {
|
||||||
return n[query[EXTRA_FIELD]]
|
return n[query[EXTRA_FIELD]]
|
||||||
})
|
})
|
||||||
return result[query[EXTRA_FIELD]]
|
return result?.[query[EXTRA_FIELD]]
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return data.reduce((p, n) => {
|
return data.reduce((p, n) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user