diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index d1d7985f77..a86c21239e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -1464,6 +1464,16 @@ export function configMergeCells(chart: Chart, options: S2Options) { } }) }) + if (showIndex) { + const indexMergedCells = mergedCellsInfo.filter(cells => cells[0].colIndex === 1) + indexMergedCells.forEach(cells => { + const tmpCells = cloneDeep(cells) + tmpCells.forEach(cell => { + cell.colIndex = 0 + }) + mergedCellsInfo.unshift(tmpCells) + }) + } options.mergedCellsInfo = mergedCellsInfo options.mergedCell = (sheet, cells, meta) => { return new CustomMergedCell(sheet, cells, meta) @@ -1486,4 +1496,4 @@ class CustomMergedCell extends MergedCell { lineHeight: cellTheme.horizontalBorderWidth, }) } -} \ No newline at end of file +}