diff --git a/vue/src/system/GraphDemo.vue b/vue/src/system/GraphDemo.vue index fe1b291..d7be885 100644 --- a/vue/src/system/GraphDemo.vue +++ b/vue/src/system/GraphDemo.vue @@ -864,10 +864,10 @@ export default { // 比如如果你有高亮定时器,这里 clearTimeout }, formatData(data) { + if (!this._graph) return; this._graph.stopLayout(); this.clearGraphState(); - // === 1. 构建 nodeId → label 映射 === const nodeIdToEnLabel = {}; data.nodes.forEach(node => { @@ -922,7 +922,6 @@ export default { nodes: updatedNodes, edges: updatedEdges }; - this.buildNodeLabelMap(updatedNodes); this.updateGraph(updatedData) this.buildCategoryIndex(); @@ -1195,7 +1194,7 @@ export default { console.log(e) const edge = items[0]; // 当前悬停的边 if (!edge) return ''; - const data=items[0].data + const data = items[0].data const sourceId = edge.source; const targetId = edge.target;