Commit d3b15d6e authored by zhengjiangtao's avatar zhengjiangtao

线条样式修改

parent ad2086ff
......@@ -274,7 +274,7 @@ class TopologyComponent extends Component {
),
goObj(go.Panel, 'Spot',
goObj(go.Shape, 'Rectangle',
{ fill: 'lightgreen', stroke: null, width: 1, height: 1 }),
{ fill: 'lightgreen', stroke: 'red', width: 1, height: 1 }),
goObj(go.Picture,
{
margin: 0,
......@@ -290,7 +290,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: new go.Spot(0, 0.5, -2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, -17, -16) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, -17, -16) },
new go.Binding('portId', 'left_1')
),
goObj(go.Shape,
......@@ -298,7 +298,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: new go.Spot(0, 0.5, -2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, -17, -10) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, -17, -10) },
new go.Binding('portId', 'left_2')
),
goObj(go.Shape,
......@@ -306,7 +306,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: new go.Spot(0, 0.5, -2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, -17, -4) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, -17, -4) },
new go.Binding('portId', 'left_3')
),
goObj(go.Shape,
......@@ -314,7 +314,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: new go.Spot(0, 0.5, -2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, -17, 2) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, -17, 2) },
new go.Binding('portId', 'left_4')
),
goObj(go.Shape,
......@@ -322,7 +322,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: new go.Spot(0, 0.5, -2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, -17, 8) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, -17, 8) },
new go.Binding('portId', 'left_5')
),
goObj(go.Shape,
......@@ -330,7 +330,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: new go.Spot(1, 0.5, 2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, 14, -16) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, 14, -16) },
new go.Binding('portId', 'right_1')
),
goObj(go.Shape,
......@@ -338,7 +338,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: new go.Spot(1, 0.5, 2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, 14, -10) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, 14, -10) },
new go.Binding('portId', 'right_2')
),
goObj(go.Shape,
......@@ -346,7 +346,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: new go.Spot(1, 0.5, 2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, 14, -4) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, 14, -4) },
new go.Binding('portId', 'right_3')
),
goObj(go.Shape,
......@@ -354,7 +354,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: new go.Spot(1, 0.5, 2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, 14, 2) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, 14, 2) },
new go.Binding('portId', 'right_4')
),
goObj(go.Shape,
......@@ -362,7 +362,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: new go.Spot(1, 0.5, 2, 0)
},
{ width: 6, height: 6, portId: '',fill: null,stroke: null,alignment: new go.Spot(1, 1, 14, 8) },
{ width: 6, height: 6, portId: '',fill: 'red',stroke: null,alignment: new go.Spot(1, 1, 14, 8) },
new go.Binding('portId', 'right_5')
)
),
......@@ -560,8 +560,8 @@ class TopologyComponent extends Component {
this.diagram.linkTemplate =
goObj(go.Link,
{
fromEndSegmentLength: 40, //设置箭头后线长度
toEndSegmentLength: 40, //设置箭头后线长度
fromEndSegmentLength: 20, //设置箭头后线长度
toEndSegmentLength: 20, //设置箭头后线长度
adjusting: go.Link.Stretch,
curve: go.Link.JumpGap,
corner: 2
......
......@@ -314,6 +314,27 @@ class VirtualCloudPlatform extends Component {
this.initTopologyData(selectedKeys[0], '');
}
handetopologyData =(topologyData) =>{
let pointdatas = topologyData.nodeData || [];
let newNodeData = [];
console.log(pointdatas)
pointdatas.map(e => {
if(e && e.ports && null !== e.ports){
var jsonObj = JSON.parse(e.ports);
let item = {...e, ...jsonObj};
newNodeData.push(item)
}else if(e){
let item = e;
newNodeData.push(item)
}
})
topologyData.nodeData = newNodeData;
return topologyData;
}
render() {
const { treeData, selectedKeys, expandedKeys, isTreeDisplay, totalCount, selectedRowKeys, pagination, isChecked } = this.state;
......@@ -328,7 +349,9 @@ class VirtualCloudPlatform extends Component {
this.mapView = true;
}
}
const { topologyData } = this.state;
debugger
let { topologyData } = this.state;
let newtopologyData= this.handetopologyData(topologyData)
const { tableData, isTableDisplay, pHeight, activeView } = this.state;
console.log(topologyData);
return (
......@@ -377,7 +400,7 @@ class VirtualCloudPlatform extends Component {
</div>
<div className="net-topo-content">
<TopologyComponent
topologyData={topologyData}
topologyData={newtopologyData}
//nodeSelectionLinkChanged={this.nodeSelectionLinkChanged}
nodeSelectionChanged={this.nodeSelectionChanged}
nodeChange={this.nodeChange}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment