fix(web): workflow bug

This commit is contained in:
zhaoying
2025-12-22 20:01:10 +08:00
parent 9f7bafe7fb
commit cd325fe198
4 changed files with 18 additions and 8 deletions

View File

@@ -138,6 +138,15 @@ export const useWorkflowGraph = ({
})
graphRef.current.addEdges(edgeList.filter(vo => vo !== null))
}
// 初始化完成后,将节点展示在可视区域内
if (nodes.length > 0 || edges.length > 0) {
setTimeout(() => {
if (graphRef.current) {
graphRef.current.centerContent()
}
}, 200)
}
}
const saveState = () => {