fix
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
:style="{ '--custom-cursor': stateManager.cursor.value }"
|
:style="{ '--custom-cursor': stateManager.cursor.value }"
|
||||||
>
|
>
|
||||||
<template v-for="v in nodeTypes" :key="v" #[`node-${v}`]="node">
|
<template v-for="v in nodeTypes" :key="v" #[`node-${v}`]="node">
|
||||||
<node
|
<!-- <node
|
||||||
:type="v"
|
:type="v"
|
||||||
:stateManager="stateManager"
|
:stateManager="stateManager"
|
||||||
:node="node"
|
:node="node"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
@bring-to-font="bringToFont(node.id)"
|
@bring-to-font="bringToFont(node.id)"
|
||||||
@send-to-back="sendToBack(node.id)"
|
@send-to-back="sendToBack(node.id)"
|
||||||
/>
|
/>
|
||||||
</node>
|
</node> -->
|
||||||
</template>
|
</template>
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,9 +58,7 @@ export class StateManager {
|
|||||||
this.activeNodeID = ref("")
|
this.activeNodeID = ref("")
|
||||||
this.nodes = ref<NodesItem[]>([]);
|
this.nodes = ref<NodesItem[]>([]);
|
||||||
this.nodes_ = computed(() => {
|
this.nodes_ = computed(() => {
|
||||||
console.log(1)
|
|
||||||
return this.nodes.value.map((node, index) => {
|
return this.nodes.value.map((node, index) => {
|
||||||
console.log(2)
|
|
||||||
const obj = node;
|
const obj = node;
|
||||||
const superiorID = node.data.superiorID;
|
const superiorID = node.data.superiorID;
|
||||||
const isSuperior = this.nodes.value.some((v) => v.id === superiorID)
|
const isSuperior = this.nodes.value.some((v) => v.id === superiorID)
|
||||||
@@ -74,14 +72,12 @@ export class StateManager {
|
|||||||
} else {// 其他情况-没有上级 没有下级
|
} else {// 其他情况-没有上级 没有下级
|
||||||
obj.type = NODE_TYPE.ALONE;
|
obj.type = NODE_TYPE.ALONE;
|
||||||
}
|
}
|
||||||
console.log(22)
|
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.edges = computed(() => {
|
this.edges = computed(() => {
|
||||||
const arr = []
|
const arr = []
|
||||||
console.log(3)
|
|
||||||
this.nodes.value.forEach((node, index) => {
|
this.nodes.value.forEach((node, index) => {
|
||||||
const superiorID = node.data.superiorID;
|
const superiorID = node.data.superiorID;
|
||||||
const isSuperior = this.nodes.value.some((v) => v.id === superiorID)
|
const isSuperior = this.nodes.value.some((v) => v.id === superiorID)
|
||||||
@@ -98,7 +94,6 @@ export class StateManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(4)
|
|
||||||
return arr
|
return arr
|
||||||
})
|
})
|
||||||
window.nodes = this.nodes
|
window.nodes = this.nodes
|
||||||
|
|||||||
Reference in New Issue
Block a user