Commit d3b15d6e authored by zhengjiangtao's avatar zhengjiangtao

线条样式修改

parent ad2086ff
...@@ -274,7 +274,7 @@ class TopologyComponent extends Component { ...@@ -274,7 +274,7 @@ class TopologyComponent extends Component {
), ),
goObj(go.Panel, 'Spot', goObj(go.Panel, 'Spot',
goObj(go.Shape, 'Rectangle', goObj(go.Shape, 'Rectangle',
{ fill: 'lightgreen', stroke: null, width: 1, height: 1 }), { fill: 'lightgreen', stroke: 'red', width: 1, height: 1 }),
goObj(go.Picture, goObj(go.Picture,
{ {
margin: 0, margin: 0,
...@@ -290,7 +290,7 @@ class TopologyComponent extends Component { ...@@ -290,7 +290,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0), fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: 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') new go.Binding('portId', 'left_1')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -298,7 +298,7 @@ class TopologyComponent extends Component { ...@@ -298,7 +298,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0), fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: 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') new go.Binding('portId', 'left_2')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -306,7 +306,7 @@ class TopologyComponent extends Component { ...@@ -306,7 +306,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0), fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: 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') new go.Binding('portId', 'left_3')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -314,7 +314,7 @@ class TopologyComponent extends Component { ...@@ -314,7 +314,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0), fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: 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') new go.Binding('portId', 'left_4')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -322,7 +322,7 @@ class TopologyComponent extends Component { ...@@ -322,7 +322,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(0, 0.5, -2, 0), fromSpot: new go.Spot(0, 0.5, -2, 0),
toSpot: 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') new go.Binding('portId', 'left_5')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -330,7 +330,7 @@ class TopologyComponent extends Component { ...@@ -330,7 +330,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0), fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: 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') new go.Binding('portId', 'right_1')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -338,7 +338,7 @@ class TopologyComponent extends Component { ...@@ -338,7 +338,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0), fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: 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') new go.Binding('portId', 'right_2')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -346,7 +346,7 @@ class TopologyComponent extends Component { ...@@ -346,7 +346,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0), fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: 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') new go.Binding('portId', 'right_3')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -354,7 +354,7 @@ class TopologyComponent extends Component { ...@@ -354,7 +354,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0), fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: 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') new go.Binding('portId', 'right_4')
), ),
goObj(go.Shape, goObj(go.Shape,
...@@ -362,7 +362,7 @@ class TopologyComponent extends Component { ...@@ -362,7 +362,7 @@ class TopologyComponent extends Component {
fromSpot: new go.Spot(1, 0.5, 2, 0), fromSpot: new go.Spot(1, 0.5, 2, 0),
toSpot: 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') new go.Binding('portId', 'right_5')
) )
), ),
...@@ -560,8 +560,8 @@ class TopologyComponent extends Component { ...@@ -560,8 +560,8 @@ class TopologyComponent extends Component {
this.diagram.linkTemplate = this.diagram.linkTemplate =
goObj(go.Link, goObj(go.Link,
{ {
fromEndSegmentLength: 40, //设置箭头后线长度 fromEndSegmentLength: 20, //设置箭头后线长度
toEndSegmentLength: 40, //设置箭头后线长度 toEndSegmentLength: 20, //设置箭头后线长度
adjusting: go.Link.Stretch, adjusting: go.Link.Stretch,
curve: go.Link.JumpGap, curve: go.Link.JumpGap,
corner: 2 corner: 2
......
...@@ -314,6 +314,27 @@ class VirtualCloudPlatform extends Component { ...@@ -314,6 +314,27 @@ class VirtualCloudPlatform extends Component {
this.initTopologyData(selectedKeys[0], ''); 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() { render() {
const { treeData, selectedKeys, expandedKeys, isTreeDisplay, totalCount, selectedRowKeys, pagination, isChecked } = this.state; const { treeData, selectedKeys, expandedKeys, isTreeDisplay, totalCount, selectedRowKeys, pagination, isChecked } = this.state;
...@@ -328,7 +349,9 @@ class VirtualCloudPlatform extends Component { ...@@ -328,7 +349,9 @@ class VirtualCloudPlatform extends Component {
this.mapView = true; this.mapView = true;
} }
} }
const { topologyData } = this.state; debugger
let { topologyData } = this.state;
let newtopologyData= this.handetopologyData(topologyData)
const { tableData, isTableDisplay, pHeight, activeView } = this.state; const { tableData, isTableDisplay, pHeight, activeView } = this.state;
console.log(topologyData); console.log(topologyData);
return ( return (
...@@ -377,7 +400,7 @@ class VirtualCloudPlatform extends Component { ...@@ -377,7 +400,7 @@ class VirtualCloudPlatform extends Component {
</div> </div>
<div className="net-topo-content"> <div className="net-topo-content">
<TopologyComponent <TopologyComponent
topologyData={topologyData} topologyData={newtopologyData}
//nodeSelectionLinkChanged={this.nodeSelectionLinkChanged} //nodeSelectionLinkChanged={this.nodeSelectionLinkChanged}
nodeSelectionChanged={this.nodeSelectionChanged} nodeSelectionChanged={this.nodeSelectionChanged}
nodeChange={this.nodeChange} 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