Skip to content

Commit

Permalink
refactor: 移除 todo 代码
Browse files Browse the repository at this point in the history
  • Loading branch information
wjgogogo committed Oct 25, 2024
1 parent 7f74920 commit 99bbd46
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
8 changes: 0 additions & 8 deletions packages/s2-core/src/cell/header-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,6 @@ export abstract class HeaderCell<
const { options, dataCfg } = this.spreadsheet;
const isEmptyValues = isEmpty(dataCfg.fields.values);

/**
* TODO: 自定义行列头支持组内排序
* https://github.com/antvis/S2/issues/2898
*/
if (this.meta.extra?.isCustomNode) {
return false;
}

if (options.showDefaultHeaderActionIcon && !isEmptyValues) {
const { sortParam } = this.getHeaderConfig();
const query = this.meta.query;
Expand Down
17 changes: 7 additions & 10 deletions packages/s2-core/src/facet/layout/build-gird-hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,13 @@ const buildNormalGridHierarchy = (params: GridHeaderParams) => {
}
}

// https://github.com/antvis/S2/issues/2893
if (!spreadsheet.isCustomHeaderFields()) {
addTotals({
currentField,
lastField: fields[index - 1],
isFirstField: index === 0,
fieldValues,
spreadsheet,
});
}
addTotals({
currentField,
lastField: fields[index - 1],
isFirstField: index === 0,
fieldValues,
spreadsheet,
});

const displayFieldValues = filterOutDetail(fieldValues as string[]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const buildRowTreeHierarchy = (params: TreeHeaderParams) => {
fieldValues = fieldValues.slice(0, drillItemsNum);
}

if (level === 0 && !spreadsheet.isCustomHeaderFields()) {
if (level === 0) {
addTotals(spreadsheet, currentField, fieldValues);
}

Expand Down

0 comments on commit 99bbd46

Please sign in to comment.