refactor(图表): 明细表合并单元格序号列处理

This commit is contained in:
wisonic 2024-11-01 14:34:58 +08:00
parent a7966d9415
commit 68749291c9

View File

@ -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)