修改测试bug

This commit is contained in:
guanj
2026-06-08 18:34:49 +08:00
parent 4f907a80c4
commit 03d302ded8
133 changed files with 3991 additions and 3442 deletions

View File

@@ -30,11 +30,27 @@ export async function selectTreeNode(
) {
if (!node) return false
const treeInstance = await waitForSingleTreeRef(treRef)
treeInstance?.setCurrentKey(node.id)
if (!treeInstance) return false
await nextTick()
expandTreeNodePath(treeInstance, node.id)
treeInstance.setCurrentKey(node.id)
options?.onSelect?.(node)
return true
}
/** 展开到目标节点的全部祖先,保证深层节点可见 */
export function expandTreeNodePath(treeInstance: any, nodeId: string) {
const target = treeInstance.getNode?.(nodeId)
if (!target) return
let parent = target.parent
while (parent && parent.level > 0) {
parent.expanded = true
parent = parent.parent
}
}
export function bootstrapWithTemplate(
template: boolean,
loadFn: () => void,