Merge pull request #13059 from dataease/pr@dev-v2@refactor_table_info_merge_cells_index

refactor(图表): 明细表合并单元格序号列处理
This commit is contained in:
wisonic-s 2024-11-01 14:36:05 +08:00 committed by GitHub
commit 8b7da76ed5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)