Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AmosBankView
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bank
AmosBankView
Commits
8bbe9f7d
Commit
8bbe9f7d
authored
Jul 08, 2020
by
zhengjiangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网络拓扑图增加标签
parent
2c31a02e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
TopologyComponent.js
src/view/bank/netTopology/TopologyComponent.js
+41
-0
No files found.
src/view/bank/netTopology/TopologyComponent.js
View file @
8bbe9f7d
...
@@ -35,6 +35,19 @@ class TopologyComponent extends Component {
...
@@ -35,6 +35,19 @@ class TopologyComponent extends Component {
}
}
}
}
//设置高度
setEllipseWidth
=
v
=>
{
let
width
=
v
===
'CCPC'
?
780
:
720
;
return
width
;
};
setMargin
=
v
=>
{
let
width
=
v
===
'CCPC'
?
new
go
.
Margin
(
-
25
,
680
,
0
,
0
)
:
new
go
.
Margin
(
-
25
,
610
,
0
,
0
);
return
width
;
};
// this function is the Node.dragComputation, to limit the movement of the parts
// this function is the Node.dragComputation, to limit the movement of the parts
stayInFixedArea
=
(
part
,
pt
,
gridpt
)
=>
{
stayInFixedArea
=
(
part
,
pt
,
gridpt
)
=>
{
let
diagram
=
part
.
diagram
;
let
diagram
=
part
.
diagram
;
...
@@ -221,6 +234,32 @@ class TopologyComponent extends Component {
...
@@ -221,6 +234,32 @@ class TopologyComponent extends Component {
},
},
));
));
this
.
diagram
.
nodeTemplateMap
.
add
(
'Shape'
,
goObj
(
go
.
Node
,
'Vertical'
,
new
go
.
Binding
(
'position'
,
'loc'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
goObj
(
go
.
Shape
,
'Rectangle'
,
{
name
:
'SHAPE'
,
fill
:
'#5BE3FF'
,
stroke
:
'#5BE3FF'
,
strokeWidth
:
1
,
width
:
500
,
height
:
24
},
new
go
.
Binding
(
'width'
,
'text'
,
v
=>
this
.
setEllipseWidth
(
v
))
),
goObj
(
go
.
TextBlock
,
'无'
,
{
stroke
:
'#fff'
,
font
:
'bold 18px Microsoft YaHei UI'
},
new
go
.
Binding
(
'text'
),
new
go
.
Binding
(
'margin'
,
'text'
,
v
=>
this
.
setMargin
(
v
),
))
)
);
this
.
diagram
.
nodeTemplateMap
.
add
(
'Picture'
,
this
.
diagram
.
nodeTemplateMap
.
add
(
'Picture'
,
goObj
(
go
.
Node
,
'Vertical'
,
goObj
(
go
.
Node
,
'Vertical'
,
{
{
...
@@ -336,6 +375,8 @@ class TopologyComponent extends Component {
...
@@ -336,6 +375,8 @@ class TopologyComponent extends Component {
this
.
diagram
.
model
=
new
go
.
GraphLinksModel
(
nodeData
,
linkData
);
this
.
diagram
.
model
=
new
go
.
GraphLinksModel
(
nodeData
,
linkData
);
}
}
render
()
{
render
()
{
const
{
className
,
style
,
topologyData
}
=
this
.
props
;
const
{
className
,
style
,
topologyData
}
=
this
.
props
;
const
{
nodeData
=
[]
}
=
topologyData
||
{};
const
{
nodeData
=
[]
}
=
topologyData
||
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment