CN-1548 feat: 修复关系图临时节点不对的问题

This commit is contained in:
chenjinsong
2024-06-14 15:48:23 +08:00
parent 01d83c4b4a
commit 0ed9327db5
2 changed files with 506 additions and 203 deletions

View File

@@ -753,10 +753,12 @@ export default {
}
},
cleanTempItems () {
let { nodes, links } = this.graph.graphData()
nodes = nodes.filter(n => n.type !== nodeType.tempNode)
links = links.filter(l => l.level !== 3)
this.graph.graphData({ nodes, links })
const { nodes, links } = this.graph.graphData()
const newNodes = nodes.filter(n => n.type !== nodeType.tempNode)
const newLinks = links.filter(l => l.level !== 3)
if (newNodes.length !== nodes.length || newLinks.length !== links.length) {
this.graph.graphData({ nodes: newNodes, links: newLinks })
}
},
async generateInitialData (clickNode) {
const nodes = []
@@ -812,6 +814,7 @@ export default {
}
nodes.push(...listNodes, ...entityNodes)
}
this.rightBox.node = rootNode
return {
nodes,
links
@@ -939,7 +942,7 @@ export default {
const rightBox = ref({
mode: 'detail', // list | detail
show: false,
show: true,
node: null,
loading: true
})