diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts index 68daaaa7b..ad6f81765 100644 --- a/packages/vtable/src/core/BaseTable.ts +++ b/packages/vtable/src/core/BaseTable.ts @@ -291,6 +291,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.cellTextOverflows = {}; internalProps.focusedTable = false; internalProps.theme = themes.of(options.theme ?? themes.DEFAULT); //原来在listTable文件中 + internalProps.theme.isPivot = this.isPivotTable(); if (container) { //先清空 @@ -303,6 +304,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { this.options = options; internalProps.theme = themes.of(options.theme ?? themes.DEFAULT); + internalProps.theme.isPivot = this.isPivotTable(); internalProps.bodyHelper = new BodyHelper(this); internalProps.headerHelper = new HeaderHelper(this); @@ -2006,6 +2008,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.stick.changedCells.clear(); internalProps.theme = themes.of(options.theme ?? themes.DEFAULT); + internalProps.theme.isPivot = this.isPivotTable(); this.scenegraph.updateStageBackground(); // this._updateSize(); //设置是否自动撑开的配置 @@ -2536,6 +2539,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { } set theme(theme: TableTheme) { this.internalProps.theme = themes.of(theme ?? themes.DEFAULT); + this.internalProps.theme.isPivot = this.isPivotTable(); this.options.theme = theme; } /** @@ -2544,6 +2548,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { updateTheme(theme: ITableThemeDefine) { const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row }; this.internalProps.theme = themes.of(theme ?? themes.DEFAULT); + this.internalProps.theme.isPivot = this.isPivotTable(); this.options.theme = theme; this.scenegraph.updateComponent(); this.scenegraph.updateStageBackground(); diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts index c008bc0ad..7fcf49c1e 100644 --- a/packages/vtable/src/themes/theme.ts +++ b/packages/vtable/src/themes/theme.ts @@ -86,6 +86,8 @@ export class TableTheme implements ITableThemeDefine { private _checkboxStyle: RequiredTableThemeDefine['checkboxStyle'] | null = null; private _textPopTipStyle: RequiredTableThemeDefine['textPopTipStyle'] | null = null; + isPivot: boolean = false; + constructor(obj: PartialTableThemeDefine | ITableThemeDefine, superTheme: ITableThemeDefine) { this.internalTheme = { obj, @@ -377,7 +379,7 @@ export class TableTheme implements ITableThemeDefine { {}, this.defaultStyle, superTheme.rowHeaderStyle, - obj.rowHeaderStyle ?? obj.headerStyle + obj.rowHeaderStyle ?? (this.isPivot ? null : obj.headerStyle) // not for pivot ); this._rowHeader = this.getStyle(header); }