Skip to content

Commit fcf2086

Browse files
committed
fix: 删除从 store 中获取 params,历史遗留
1 parent 7aebdbe commit fcf2086

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

packages/s2-core/src/sheet-type/spread-sheet.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,6 @@ export abstract class SpreadSheet extends EE {
325325
public setDataCfg(dataCfg: S2DataConfig) {
326326
this.store.set('originalDataCfg', dataCfg);
327327
const newDataCfg = clone(dataCfg);
328-
const lastSortParam = this.store.get('sortParam');
329-
const { sortParams } = newDataCfg;
330-
newDataCfg.sortParams = [].concat(lastSortParam || [], sortParams || []);
331328
this.dataCfg = getSafetyDataConfig(newDataCfg);
332329
// clear value ranger after each updated data cfg
333330
clearValueRangeState(this);

packages/s2-react/src/components/sheets/interface.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ThemeCfg,
1313
ViewMeta,
1414
LayoutResult,
15-
TableSortParams,
1615
SortParams,
1716
} from '@antv/s2';
1817
import React from 'react';
@@ -99,7 +98,7 @@ export interface BaseSheetComponentProps {
9998
header?: HeaderCfgProps;
10099
onLoad?: () => void;
101100
onDestroy?: () => void;
102-
onListSortChange?: (params: TableSortParams | SortParams) => void;
101+
onSortChange?: (params: SortParams) => void;
103102
onRowColLayout?: (rows: LayoutRow[], cols: LayoutCol[]) => void;
104103
onAfterHeaderLayout?: (layoutResult: LayoutResult) => void;
105104
onCollapseRows?: (collapsedRows: Record<string, boolean>) => void;

packages/s2-react/src/hooks/useEvents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export function useEvents(props: BaseSheetComponentProps) {
119119
},
120120

121121
// ============== sort ====================
122-
[S2Event.RANGE_SORT]: (value: TableSortParams | SortParams) => {
123-
props.onListSortChange?.(value);
122+
[S2Event.RANGE_SORT]: (value: SortParams) => {
123+
props.onSortChange?.(value);
124124
},
125125
};
126126

0 commit comments

Comments
 (0)