Skip to content

Commit

Permalink
fix: 去除可选
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Oct 19, 2023
1 parent 131ead6 commit 150f116
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions packages/s2-core/src/common/interface/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ export interface Total {
/**
* 是否显示总计
*/
showGrandTotals: boolean;
showGrandTotals?: boolean;

/**
*是否显示小计
*/
showSubTotals:
showSubTotals?:
| boolean
| {
/** 当子维度个数 <=1 时,仍然展示小计:默认 true */
Expand All @@ -177,17 +177,17 @@ export interface Total {
* 小计的汇总维度
* @example subTotalsDimensions: ['province']
*/
subTotalsDimensions: string[];
subTotalsDimensions?: string[];

/**
* 总计布局位置,默认是下或右
*/
reverseGrandTotalsLayout: boolean;
reverseGrandTotalsLayout?: boolean;

/**
* 小计布局位置,默认是下或右
*/
reverseSubTotalsLayout: boolean;
reverseSubTotalsLayout?: boolean;

/**
* 总计展示名
Expand All @@ -208,8 +208,8 @@ export interface Total {
* 但是内部配置我倾向于仍然按照字段所属维度区,即配置的row,代表的是行维度而不是行小计
*/
export interface Totals {
row?: Partial<Total>;
col?: Partial<Total>;
row?: Total;
col?: Total;
}

export interface Sort {
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/sheet-type/spread-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export abstract class SpreadSheet extends EE {
/**
* 获取当前维度对应的汇总配置
*/
public getTotalsConfig(dimension: string): Partial<Total> {
public getTotalsConfig(dimension: string): Total {
const { totals } = this.options;
const { rows } = this.dataSet.fields;

Expand Down

0 comments on commit 150f116

Please sign in to comment.