|
@@ -378,7 +378,7 @@ export default {
|
|
handleData(data) {
|
|
handleData(data) {
|
|
data.forEach((v, k) => {
|
|
data.forEach((v, k) => {
|
|
v.id = v.id.toString();
|
|
v.id = v.id.toString();
|
|
- v.type = 'circle';
|
|
|
|
|
|
+ v.type = 'flow-circle';
|
|
v.size=[60],
|
|
v.size=[60],
|
|
v.name = (v.flat_duration.toFixed(2)).toString()+'ms'
|
|
v.name = (v.flat_duration.toFixed(2)).toString()+'ms'
|
|
v.collapsed = false;
|
|
v.collapsed = false;
|
|
@@ -491,6 +491,8 @@ export default {
|
|
// rate
|
|
// rate
|
|
// } = cfg;
|
|
// } = cfg;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
const {
|
|
const {
|
|
name = '',
|
|
name = '',
|
|
// variableName,
|
|
// variableName,
|
|
@@ -919,9 +921,7 @@ export default {
|
|
getContent: (e) => {
|
|
getContent: (e) => {
|
|
const outDiv = document.createElement('div');
|
|
const outDiv = document.createElement('div');
|
|
//outDiv.style.padding = '0px 0px 20px 0px';
|
|
//outDiv.style.padding = '0px 0px 20px 0px';
|
|
- console.log(e.item.getModel(),'e.item.getModel()')
|
|
|
|
const nodeName = e.item.getModel().name;
|
|
const nodeName = e.item.getModel().name;
|
|
- console.log(nodeName,'nodeName')
|
|
|
|
let formatedNodeName = '';
|
|
let formatedNodeName = '';
|
|
if(nodeName != undefined){
|
|
if(nodeName != undefined){
|
|
|
|
|
|
@@ -997,7 +997,6 @@ export default {
|
|
});
|
|
});
|
|
//点击线 edge:click
|
|
//点击线 edge:click
|
|
graph.on("name-edge-button:click", (evt) => {
|
|
graph.on("name-edge-button:click", (evt) => {
|
|
- console.log(evt)
|
|
|
|
let _this = this;
|
|
let _this = this;
|
|
this.networkQuery.parent_span_id='';
|
|
this.networkQuery.parent_span_id='';
|
|
this.networkQuery.span_id = '';
|
|
this.networkQuery.span_id = '';
|
|
@@ -1028,22 +1027,15 @@ export default {
|
|
let optList = this.handleData(res.data.OPT_STATUS);
|
|
let optList = this.handleData(res.data.OPT_STATUS);
|
|
let newOptList = this.buildNestedTree(optList);
|
|
let newOptList = this.buildNestedTree(optList);
|
|
|
|
|
|
- console.log(optList,'optList这块数据是添加决策树需要的字段');
|
|
|
|
-
|
|
|
|
- console.log(newOptList,'newOptList 这块是转成数形结构')
|
|
|
|
-
|
|
|
|
newFirstNode.children = newOptList;
|
|
newFirstNode.children = newOptList;
|
|
|
|
|
|
- console.log(newFirstNode,'firstNode children,赋于新的值')
|
|
|
|
|
|
|
|
let firstList =[newFirstNode];
|
|
let firstList =[newFirstNode];
|
|
|
|
|
|
let resultList = this.addDataToTree(firstList,newLastNode)
|
|
let resultList = this.addDataToTree(firstList,newLastNode)
|
|
|
|
|
|
- console.log(resultList,'这是在末尾添加数据')
|
|
|
|
topoData = resultList[0]
|
|
topoData = resultList[0]
|
|
|
|
|
|
- console.log(topoData,'this.topoData')
|
|
|
|
|
|
|
|
// _this.$emit('changeNetwork',this.topoData);
|
|
// _this.$emit('changeNetwork',this.topoData);
|
|
this.networkOpen = true;
|
|
this.networkOpen = true;
|
|
@@ -1182,6 +1174,7 @@ export default {
|
|
{
|
|
{
|
|
shapeType: 'flow-rect',
|
|
shapeType: 'flow-rect',
|
|
draw(cfg, group) {
|
|
draw(cfg, group) {
|
|
|
|
+ console.log(cfg,'自定义节点------')
|
|
// const {
|
|
// const {
|
|
// name = '',
|
|
// name = '',
|
|
// variableName,
|
|
// variableName,
|
|
@@ -1193,7 +1186,6 @@ export default {
|
|
// status,
|
|
// status,
|
|
// rate
|
|
// rate
|
|
// } = cfg;
|
|
// } = cfg;
|
|
-
|
|
|
|
const {
|
|
const {
|
|
name = '',
|
|
name = '',
|
|
// variableName,
|
|
// variableName,
|
|
@@ -1473,6 +1465,74 @@ export default {
|
|
'rect',
|
|
'rect',
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ G6.registerNode(
|
|
|
|
+ 'flow-circle',
|
|
|
|
+ {
|
|
|
|
+ shapeType: 'flow-circle',
|
|
|
|
+ draw(cfg, group) {
|
|
|
|
+ const {
|
|
|
|
+ span_name,
|
|
|
|
+ label,
|
|
|
|
+ span_category,
|
|
|
|
+ } = cfg;
|
|
|
|
+ console.log(cfg,'cfg=========圆形节点')
|
|
|
|
+ const radius = (60 / 2) - 2;
|
|
|
|
+ const circleBoxlenght = cfg.size;
|
|
|
|
+ const circle = group.addShape('circle', {
|
|
|
|
+ attrs: {
|
|
|
|
+ x: 0,
|
|
|
|
+ y: 0,
|
|
|
|
+ r: radius,
|
|
|
|
+ fill: '#F0F4FE',
|
|
|
|
+ stroke: '#6B94F7',
|
|
|
|
+ lineWidth:2,
|
|
|
|
+ },
|
|
|
|
+ name: 'circle-shape',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ group.addShape('text', {
|
|
|
|
+ attrs: {
|
|
|
|
+ x: 0,
|
|
|
|
+ y: 0,
|
|
|
|
+ text:label,
|
|
|
|
+ fill:"#333",
|
|
|
|
+ fontSize:12,
|
|
|
|
+ textAlign: 'center', // 文本居中
|
|
|
|
+ textBaseline: 'middle', // 文本垂直居中
|
|
|
|
+ // fill: cfg.color, // 节点颜色
|
|
|
|
+ },
|
|
|
|
+ name: 'label-shape',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ group.addShape('text', {
|
|
|
|
+ attrs: {
|
|
|
|
+ x: 0,
|
|
|
|
+ y: radius + 20,
|
|
|
|
+ text:span_name,
|
|
|
|
+ fill:"#333",
|
|
|
|
+ fontSize:12,
|
|
|
|
+ textAlign: 'center', // 文本居中
|
|
|
|
+ },
|
|
|
|
+ name: 'span-name-shape',
|
|
|
|
+ });
|
|
|
|
+ group.addShape('text', {
|
|
|
|
+ attrs: {
|
|
|
|
+ x: 0,
|
|
|
|
+ y: radius + 40,
|
|
|
|
+ text:span_category,
|
|
|
|
+ fill:"#333",
|
|
|
|
+ fontSize:12,
|
|
|
|
+ textAlign: 'center', // 文本居中
|
|
|
|
+ },
|
|
|
|
+ name: 'span-category-shape',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return circle; // 返回创建的圆形
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 'circle',
|
|
|
|
+ );
|
|
|
|
+
|
|
G6.registerEdge(
|
|
G6.registerEdge(
|
|
'flow-cubic',
|
|
'flow-cubic',
|
|
{
|
|
{
|
|
@@ -1538,7 +1598,6 @@ export default {
|
|
const nodeName = e.item.getModel().name;
|
|
const nodeName = e.item.getModel().name;
|
|
const item = e.item.getModel()
|
|
const item = e.item.getModel()
|
|
const detail= item.detail
|
|
const detail= item.detail
|
|
- console.log(item,'item,提示')
|
|
|
|
if(item.detail != undefined){
|
|
if(item.detail != undefined){
|
|
let html = ''
|
|
let html = ''
|
|
for (let key in detail) {
|
|
for (let key in detail) {
|