|
@@ -795,6 +795,7 @@ export default {
|
|
|
// cursor: 'pointer',
|
|
|
// },
|
|
|
// });
|
|
|
+ const visible = cfg.sourceNode._cfg.model.span_id == 'UNKNOWN SPAN ID' || cfg.targetNode._cfg.model.span_id == '' ? false : true;
|
|
|
group.addShape('image', {
|
|
|
attrs: {
|
|
|
x: midPoint.x - 8,
|
|
@@ -805,7 +806,7 @@ export default {
|
|
|
cursor: 'pointer',
|
|
|
// opacity: 1,
|
|
|
},
|
|
|
- visible: cfg.sourceNode._cfg.model.parent_span_id == '' ? false : true,
|
|
|
+ visible,
|
|
|
name: 'name-edge-button',
|
|
|
})
|
|
|
// // must be assigned in G6 3.3 and later versions. it can be any string you want, but should be unique in a custom item type
|
|
@@ -995,12 +996,14 @@ export default {
|
|
|
});
|
|
|
//点击线 edge:click
|
|
|
graph.on("name-edge-button:click", (evt) => {
|
|
|
- let _this = this;
|
|
|
this.networkQuery.parent_span_id='';
|
|
|
this.networkQuery.span_id = '';
|
|
|
let topoData = {};
|
|
|
let itemData = evt.item._cfg.model;
|
|
|
let {source,target} = itemData;
|
|
|
+ // source 是前面一个节点的span_id
|
|
|
+ // target 是后面一个节点的span_id
|
|
|
+
|
|
|
let firstNode = evt.item._cfg.sourceNode._cfg.model;
|
|
|
let newFirstNode = Object.assign({},firstNode);
|
|
|
newFirstNode.children=[];
|