mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
refactor(图表): 透视表排序逻辑优化 #13127
This commit is contained in:
parent
dfed574700
commit
e6cb218ccb
@ -213,6 +213,21 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
}
|
||||
sortParams.push(sort)
|
||||
}
|
||||
//列维度为空,行排序按照指标列来排序,取第一个有排序设置的指标
|
||||
if (!columnFields?.length) {
|
||||
const sortField = valueFields?.find(v => !['none', 'custom_sort'].includes(v.sort))
|
||||
if (sortField) {
|
||||
const sort = {
|
||||
sortFieldId: r[0],
|
||||
sortMethod: sortField.sort.toUpperCase(),
|
||||
sortByMeasure: TOTAL_VALUE,
|
||||
query: {
|
||||
[EXTRA_FIELD]: sortField.dataeaseName
|
||||
}
|
||||
}
|
||||
sortParams.push(sort)
|
||||
}
|
||||
}
|
||||
// 自定义总计小计
|
||||
const totals = [
|
||||
tableTotal.row.calcTotals,
|
||||
|
Loading…
Reference in New Issue
Block a user