Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
060a1194
Commit
060a1194
authored
Apr 09, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gojs
parent
328e4b3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
17 deletions
+45
-17
index.vue
pages/go/tree/index.vue
+45
-17
logo.png
pages/go/tree/logo.png
+0
-0
logo.png
static/static/logo.png
+0
-0
No files found.
pages/go/tree/index.vue
View file @
060a1194
...
...
@@ -87,12 +87,16 @@ export default {
let
$
=
go
.
GraphObject
.
make
;
this
.
go
=
$
(
go
.
Diagram
,
"card"
,
{
"undoManager.isEnabled"
:
true
,
// enable Ctrl-Z to undo and Ctrl-Y to redo
layout
:
$
(
go
.
TreeLayout
,
// specify a Diagram.layout that arranges trees
{
angle
:
90
,
layerSpacing
:
35
}
)
// layout: $(
// go.TreeLayout, // specify a Diagram.layout that arranges trees
// { angle: 90, layerSpacing: 35 }
// ),
// nodeSelectionAdornmentTemplate:
// $(go.Adornment, "Auto",
// $(go.Shape, "Rectangle", { fill: "red", stroke: "red" ,strokeWidth:2}),
// )
});
var
myModel
=
$
(
go
.
TreeModel
);
// in the model data, each node is represented by a JavaScript object:
...
...
@@ -105,16 +109,39 @@ export default {
"Hi,henq"
,
{
margin
:
12
,
stroke
:
"#fff"
,
font
:
"bold 16px '宋体'"
},
new
go
.
Binding
(
"text"
,
"name"
)
),{
contextClick
:(
e
,
obj
)
=>
{
),
{
contextClick
:
(
e
,
obj
)
=>
{
// alert(obj.data.key+":"+obj.data.name);
console
.
warn
(
"info"
,
e
,
obj
)
this
.
onContextmenu
(
e
.
event
,
obj
.
data
)
console
.
warn
(
"info"
,
e
,
obj
);
this
.
onContextmenu
(
e
.
event
,
obj
.
data
);
},
doubleClick
:
(
e
,
obj
)
=>
{
doubleClick
:
(
e
,
obj
)
=>
{
alert
(
321
);
}
}
},
angle
:
45
,
// mouseEnter:(e,obj)=>{
// console.warn(e,obj);
// if(obj.part){
// obj.part.fill="red"
// }
// }
// mouseEnter: function(e, obj) {
// console.log(obj)
// obj.background = "green";
// obj.stroke = "dodgerblue";
// obj.toolTip="hello henq!"
// },
// mouseLeave: function(e, obj) {
// obj.background = "orange";
// obj.opacity = 1;
// obj.strokeWidth = 2;
// obj.stroke = "gray";
// }
},
new
go
.
Binding
(
"background"
,
"isSelected"
,(
v
)
=>
{
return
v
?
"green"
:
"red"
}).
ofObject
()
);
this
.
go
.
linkTemplate
=
$
(
go
.
Link
,
...
...
@@ -122,8 +149,9 @@ export default {
$
(
go
.
Shape
,
{
strokeWidth
:
1
,
stroke
:
"#ddd"
})
);
// the link shape
myModel
.
nodeDataArray
=
this
.
data
;
//
myModel.nodeDataArray = this.data;
this
.
go
.
model
=
myModel
;
this
.
go
.
add
(
$
(
go
.
Part
,
"Table"
,
$
(
go
.
Picture
,{
source
:
"/static/logo.png"
,
margin
:
10
,
column
:
1
})))
},
svg
()
{
this
.
show
=
!
this
.
show
;
...
...
@@ -134,9 +162,9 @@ export default {
maxSize
:
new
go
.
Size
(
1200
,
NaN
)
});
console
.
log
(
this
.
$refs
.
svg
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
document
.
getElementById
(
"svg"
).
appendChild
(
svg
);
})
})
;
}
},
onContextmenu
(
event
,
a
)
{
...
...
@@ -208,11 +236,11 @@ export default {
background-color: white;
top: 150px;
left: 0;
rect{
rect
{
// fill:wheat;
cursor: pointer;
}
rect:hover{
rect:hover
{
fill: tomato;
}
}
...
...
pages/go/tree/logo.png
0 → 100644
View file @
060a1194
15 KB
static/static/logo.png
0 → 100644
View file @
060a1194
15 KB
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