From 15335392dc82e293df66bc03e7d99ea8beaccecd Mon Sep 17 00:00:00 2001 From: xueyuan Date: Fri, 10 Apr 2026 14:08:46 +0800 Subject: [PATCH] fix(table): radio cell should not render in summary row series number column When using summary rows with a radio selection column, the radio button was incorrectly rendered in the summary row, inconsistent with checkbox behavior which already has an isAggregation && isSeriesNumber guard to fall back to a text cell. Closes #4027 --- .../scenegraph/group-creater/cell-helper.ts | 67 +++++++++++++------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 76085a60d..91892380f 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -423,25 +423,54 @@ export function createCell( ); } } else if (type === 'radio') { - const createRadioCellGroup = Factory.getFunction('createRadioCellGroup') as CreateRadioCellGroup; - cellGroup = createRadioCellGroup( - null, - columnGroup, - 0, - y, - col, - row, - colWidth, - cellWidth, - cellHeight, - padding, - textAlign, - textBaseline, - table, - cellTheme, - define as RadioColumnDefine, - range - ); + const isAggregation = + 'isAggregation' in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row); + const isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row); + if (isAggregation && isSeriesNumber) { + // 合计行的行序号列不应渲染单选框,降级为普通文本单元格(与 checkbox 保持一致) + const createTextCellGroup = Factory.getFunction('createTextCellGroup') as CreateTextCellGroup; + cellGroup = createTextCellGroup( + table, + value, + columnGroup, + 0, + y, + col, + row, + colWidth, + cellWidth, + cellHeight, + padding, + textAlign, + textBaseline, + false, + undefined, + true, + cellTheme, + range, + isAsync + ); + } else { + const createRadioCellGroup = Factory.getFunction('createRadioCellGroup') as CreateRadioCellGroup; + cellGroup = createRadioCellGroup( + null, + columnGroup, + 0, + y, + col, + row, + colWidth, + cellWidth, + cellHeight, + padding, + textAlign, + textBaseline, + table, + cellTheme, + define as RadioColumnDefine, + range + ); + } } else if (type === 'switch') { const createSwitchCellGroup = Factory.getFunction('createSwitchCellGroup') as CreateSwitchCellGroup; cellGroup = createSwitchCellGroup(