This commit is contained in:
lzp
2026-03-03 16:16:30 +08:00
parent 30837dfd7e
commit 9817e5e0db
8 changed files with 44 additions and 14 deletions

View File

@@ -94,6 +94,14 @@ export class StateManager {
deleteNode(id: string) {
this.nodes.value = this.nodes.value.filter((node: NodesItem) => node.id !== id)
}
/** 获取节点 */
getNodeById(id: string) {
return this.nodes.value.find((node: NodesItem) => node.id === id)
}
/** 获取下级节点 */
getSubordNodeByID(id: string) {
return this.nodes.value.find((node: NodesItem) => node.data.superiorID === id)
}
getLastNode() {
return this.nodes.value[this.nodes.value.length - 1]
}