refactor(图表): 明细表合并单元格点击事件和悬浮事件处理

This commit is contained in:
wisonic 2024-11-01 11:41:17 +08:00
parent 1d3efaaf18
commit 4d01571f28
2 changed files with 4 additions and 0 deletions

View File

@ -302,11 +302,14 @@ export class TableInfo extends S2ChartView<TableSheet> {
}
action(param)
})
// 合并的单元格直接复用数据单元格的事件
newChart.on(S2Event.MERGED_CELLS_CLICK, e => newChart.emit(S2Event.DATA_CELL_CLICK, e))
// tooltip
const { show } = tooltip
if (show) {
newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
newChart.on(S2Event.MERGED_CELLS_HOVER, event => this.showTooltip(newChart, event, meta))
}
// header resize
newChart.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, ev => resizeAction(ev))

View File

@ -75,6 +75,7 @@ export abstract class S2ChartView<P extends SpreadSheet> extends AntVAbstractCha
let field
switch (cell.cellType) {
case 'dataCell':
case 'mergedCell':
if (meta.valueField === SERIES_NUMBER_FIELD) {
content = meta.fieldValue.toString()
break