This commit is contained in:
lzp
2026-03-05 13:46:10 +08:00
parent b3051c15de
commit 232cac5805
6 changed files with 39 additions and 33 deletions

View File

@@ -26,6 +26,7 @@ export class EventManager {
}
/** 处理点击 */
handleClick(event: any) {
this.stateManager.setActiveNodeID("")
const tool = this.stateManager.tool.value
if (tool === TOOLS.TEXT) {
const { x, y, zoom } = this.vueFlow.value.viewport

View File

@@ -10,6 +10,7 @@ export interface NodesItem {
}
export class StateManager {
vueFlow: any
activeNodeID: any
nodes: any
nodes_: any
edges: any
@@ -49,6 +50,7 @@ export class StateManager {
this.historyList = ref([])
this.historyIndex = ref(0)
this.activeNodeID = ref("")
this.nodes = ref<NodesItem[]>([]);
this.nodes_ = computed(() => {
return this.nodes.value.map((node, index) => {
@@ -90,6 +92,8 @@ export class StateManager {
})
}
/** 设置激活节点 */
setActiveNodeID(id: string) { this.activeNodeID.value = id }
/** 添加节点 */
addNode(node: NodesItem) {
this.nodes.value.push(node);