fix(图表): 透视表数值维度排序错误 #16321

This commit is contained in:
wisonic-s
2025-06-17 21:40:09 +08:00
committed by GitHub
parent 6bc9ce27bf
commit 1b090cdc58

View File

@@ -309,6 +309,9 @@ export class TablePivot extends S2ChartView<PivotSheet> {
// 根据配置动态决定排序顺序
uniqueValues.sort((a, b) => {
if ([2, 3, 4].includes(valueFieldMap[f]?.deType)) {
return sortMethod === 'ASC' ? a - b : b - a
}
if (!a && !b) {
return 0
}
@@ -345,6 +348,9 @@ export class TablePivot extends S2ChartView<PivotSheet> {
const uniqueValues = [...new Set(fieldValues)]
// 根据配置动态决定排序顺序
uniqueValues.sort((a, b) => {
if ([2, 3, 4].includes(valueFieldMap[f]?.deType)) {
return sortMethod === 'ASC' ? a - b : b - a
}
if (!a && !b) {
return 0
}