From d1ff1c7d19976ac5197a6096294845cdc93eb803 Mon Sep 17 00:00:00 2001 From: wjgogogo <906626481@qq.com> Date: Thu, 7 Dec 2023 16:39:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20seriesNumberHeader=20=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E4=BD=BF=E7=94=A8=20=20custom=20row=20cell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/s2-core/src/facet/header/row.ts | 7 ++++++- packages/s2-core/src/facet/header/series-number.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/s2-core/src/facet/header/row.ts b/packages/s2-core/src/facet/header/row.ts index 7c4e2b172a..a8a975b99a 100644 --- a/packages/s2-core/src/facet/header/row.ts +++ b/packages/s2-core/src/facet/header/row.ts @@ -54,9 +54,14 @@ export class RowHeader extends BaseHeader { return this; } + protected getCustomRowCell() { + const { spreadsheet } = this.headerConfig; + return spreadsheet?.facet?.cfg?.rowCell; + } + protected layout() { const { data, spreadsheet } = this.headerConfig; - const rowCell = spreadsheet?.facet?.cfg?.rowCell; + const rowCell = this.getCustomRowCell(); each(data, (item: Node) => { if (this.rowCellInRect(item) && item.height !== 0) { let cell: S2CellType; diff --git a/packages/s2-core/src/facet/header/series-number.ts b/packages/s2-core/src/facet/header/series-number.ts index 09f541735b..61ec5dd461 100644 --- a/packages/s2-core/src/facet/header/series-number.ts +++ b/packages/s2-core/src/facet/header/series-number.ts @@ -46,6 +46,7 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader { : node.height; sNode.width = seriesNumberWidth; sNode.rowIndex = node.rowIndex; + sNode.spreadsheet = spreadsheet; sNode.isLeaf = true; seriesNodes.push(sNode); }); @@ -84,4 +85,8 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader { frozenRow, ); } + + protected override getCustomRowCell() { + return null; + } }