From fd4ce737683da8a6e916ab29d973a68a445a8a80 Mon Sep 17 00:00:00 2001 From: biubiukam Date: Wed, 15 Jul 2026 04:48:52 +0800 Subject: [PATCH 1/2] fix: hide row series number in aggregation rows --- ...able-row-series-number-aggregation.test.ts | 39 +++++++++++++++++++ packages/vtable/src/ListTable.ts | 6 +++ 2 files changed, 45 insertions(+) create mode 100644 packages/vtable/__tests__/options/listTable-row-series-number-aggregation.test.ts diff --git a/packages/vtable/__tests__/options/listTable-row-series-number-aggregation.test.ts b/packages/vtable/__tests__/options/listTable-row-series-number-aggregation.test.ts new file mode 100644 index 000000000..188afc922 --- /dev/null +++ b/packages/vtable/__tests__/options/listTable-row-series-number-aggregation.test.ts @@ -0,0 +1,39 @@ +// @ts-nocheck +import { ListTable, TYPES } from '../../src'; +import { createDiv } from '../dom'; + +global.__VERSION__ = 'none'; + +describe('ListTable row series number with aggregation', () => { + const container = createDiv(); + container.style.width = '600px'; + container.style.height = '400px'; + + const table = new ListTable(container, { + records: [{ value: 1 }, { value: 2 }], + columns: [ + { + field: 'value', + title: 'Value', + aggregation: { + aggregationType: TYPES.AggregationType.SUM + } + } + ], + rowSeriesNumber: { + title: 'No.' + } + }); + + afterAll(() => { + table.release(); + }); + + test('does not display a series number in the aggregation row', () => { + const aggregationRow = table.rowCount - 1; + + expect(table.internalProps.layoutMap.isAggregation(0, aggregationRow)).toBe(true); + expect(table.getCellValue(0, aggregationRow)).toBe(''); + expect(table.getCellOriginValue(0, aggregationRow)).toBe(''); + }); +}); diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index 070c74ee6..e029b739c 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -579,6 +579,9 @@ export class ListTable extends BaseTable implements ListTableAPI { const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row); return title; } + if (table.internalProps.layoutMap.isAggregation(col, row)) { + return ''; + } let value; if ((this.internalProps as ListTableProtected).groupBy) { const record = table.getCellRawRecord(col, row); @@ -629,6 +632,9 @@ export class ListTable extends BaseTable implements ListTableAPI { const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row); return title; } + if (table.internalProps.layoutMap.isAggregation(col, row)) { + return ''; + } const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row); return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount; } else if (table.internalProps.layoutMap.isHeader(col, row)) { From 993a8d1ff7dc69f5b37d218619a5da07f9952349 Mon Sep 17 00:00:00 2001 From: biubiukam Date: Wed, 15 Jul 2026 04:50:35 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...13-aggregation-series-number_2026-07-14-20-50.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/fix-issue-5213-aggregation-series-number_2026-07-14-20-50.json diff --git a/common/changes/@visactor/vtable/fix-issue-5213-aggregation-series-number_2026-07-14-20-50.json b/common/changes/@visactor/vtable/fix-issue-5213-aggregation-series-number_2026-07-14-20-50.json new file mode 100644 index 000000000..13a5b655a --- /dev/null +++ b/common/changes/@visactor/vtable/fix-issue-5213-aggregation-series-number_2026-07-14-20-50.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: hide row series number in aggregation rows", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "biukam.w@gmail.com" +} \ No newline at end of file