feat: 官网海洋蓝波浪首页与指南分受众,并同步业务页优化 #9
@ -2046,6 +2046,7 @@
|
|||||||
};
|
};
|
||||||
removeFilterIconFromColumns();
|
removeFilterIconFromColumns();
|
||||||
syncHybridHeaders();
|
syncHybridHeaders();
|
||||||
|
applySelectedRowStyles();
|
||||||
remasureActionColumnFromDom();
|
remasureActionColumnFromDom();
|
||||||
// remasure/updateSettings 后 HOT 会按原生滚动条再次缩短 clone,需再对齐一次
|
// remasure/updateSettings 后 HOT 会按原生滚动条再次缩短 clone,需再对齐一次
|
||||||
scheduleCloneOverlaySync();
|
scheduleCloneOverlaySync();
|
||||||
@ -2443,15 +2444,14 @@
|
|||||||
const tbody = hotContainer.value.querySelector('.ht_master tbody');
|
const tbody = hotContainer.value.querySelector('.ht_master tbody');
|
||||||
if (!tbody) return;
|
if (!tbody) return;
|
||||||
|
|
||||||
|
// HOT 虚拟滚动只渲染可视区行且复用 tr,DOM 下标 ≠ 视觉行号,须按单元格坐标取行
|
||||||
const rows = tbody.querySelectorAll('tr');
|
const rows = tbody.querySelectorAll('tr');
|
||||||
rows.forEach((row, index) => {
|
rows.forEach((row) => {
|
||||||
// 移除之前的所有选中状态
|
const cell = row.querySelector('td, th') as HTMLTableCellElement | null;
|
||||||
row.classList.remove('selected-row');
|
const visualRow = cell ? hotInstance!.getCoords(cell)?.row : undefined;
|
||||||
|
const selected =
|
||||||
// 为当前选中的行添加类
|
typeof visualRow === 'number' && visualRow >= 0 && selectedRowIndicesSet.value.has(visualRow);
|
||||||
if (selectedRowIndicesSet.value.has(index)) {
|
row.classList.toggle('selected-row', selected);
|
||||||
row.classList.add('selected-row');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user