Browse Source

feat:东西链路图--箭头icon 是否显示判断条件更改

liujing 11 tháng trước cách đây
mục cha
commit
f1d35bfebb
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      src/views/latency/components/TopoTree.vue

+ 5 - 2
src/views/latency/components/TopoTree.vue

@@ -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=[];