refactor(antd): 移除Popconfirm中已废弃的getVxePopupContainer属性

antd已支持滚动跟随,不再需要手动指定getVxePopupContainer属性。删除相关代码及工具函数,简化实现。
This commit is contained in:
dap
2026-01-15 10:07:06 +08:00
parent 448856e547
commit 884c4f39fd
22 changed files with 6 additions and 107 deletions

View File

@@ -8,59 +8,3 @@ export function getPopupContainer(node?: HTMLElement): HTMLElement {
node?.closest('form') ?? (node?.parentNode as HTMLElement) ?? document.body
);
}
/**
* VxeTable专用弹窗层
* 解决问题: https://gitee.com/dapppp/ruoyi-plus-vben5/issues/IB1DM3
* @param node 触发的元素
* @param tableId 表格ID用于区分不同表格可选
* @returns 挂载节点
*/
export function getVxePopupContainer(
node?: HTMLElement,
tableId?: string,
): HTMLElement {
if (!node) return document.body;
// 检查是否在固定列内
const isInFixedColumn =
node.closest('.vxe-table--fixed-wrapper') ||
node.closest('.vxe-table--fixed-left-wrapper') ||
node.closest('.vxe-table--fixed-right-wrapper');
// 如果在固定列内,则挂载到固定列容器
if (isInFixedColumn) {
// 优先查找表格容器及父级容器
const tableContainer =
// 查找通用固定列容器
node.closest('.vxe-table--fixed-wrapper') ||
// 查找固定列容器(左侧固定列)
node.closest('.vxe-table--fixed-left-wrapper') ||
// 查找固定列容器(右侧固定列)
node.closest('.vxe-table--fixed-right-wrapper');
// 如果指定了tableId可以查找特定ID的表格
if (tableId && tableContainer) {
const specificTable = tableContainer.closest(
`[data-table-id="${tableId}"]`,
);
if (specificTable) {
return specificTable as HTMLElement;
}
}
return tableContainer as HTMLElement;
}
/**
* 设置行高度需要特殊处理
*/
const fixedHeightElement = node.closest('td.col--cs-height');
if (fixedHeightElement) {
// 默认为hidden 显示异常
(fixedHeightElement as HTMLTableCellElement).style.overflow = 'visible';
}
// 兜底方案:使用元素的父节点或文档体
return (node.parentNode as HTMLElement) || document.body;
}