2026-02-26 11:45:32 +08:00
|
|
|
export class FlowManager {
|
|
|
|
|
stateManager: any
|
|
|
|
|
vueFlow: any
|
|
|
|
|
constructor(options) {
|
|
|
|
|
this.stateManager = options.stateManager;
|
|
|
|
|
this.vueFlow = options.vueFlow
|
|
|
|
|
}
|
|
|
|
|
setZoom(zoom: number) {
|
|
|
|
|
this.stateManager.zoom.value = zoom
|
|
|
|
|
this.vueFlow.value.zoomTo(zoom)
|
|
|
|
|
}
|
2026-02-27 11:43:27 +08:00
|
|
|
getLastNode() {
|
|
|
|
|
const lastNode = this.stateManager.getLastNode()
|
|
|
|
|
if (lastNode?.id) {
|
|
|
|
|
return this.vueFlow.value.getNode(lastNode.id)
|
|
|
|
|
}
|
|
|
|
|
return null;
|
2026-02-26 11:45:32 +08:00
|
|
|
}
|
2026-02-27 11:43:27 +08:00
|
|
|
|
2026-02-26 11:45:32 +08:00
|
|
|
}
|