Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
7ec45fab
Commit
7ec45fab
authored
Jul 18, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add demo for orgChart -- frank
parent
2541060b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
script.js
atms-web/src/main/webapp/dist/script.js
+33
-28
No files found.
atms-web/src/main/webapp/dist/script.js
View file @
7ec45fab
(
function
(
$
)
{
$
(
function
()
{
var
westData
=
{
'name'
:
'Cayman 1 LP'
,
'wins'
:
'1'
,
'children'
:
[
{
'name'
:
'Cayman 2 Limited'
,
'wins'
:
'2'
,
'children'
:
[
{
'name'
:
'BVI 1 Limited'
,
'wins'
:
'3'
,
},
{
'name'
:
'Hong Kong 1 Limited'
,
'wins'
:
'4'
}
]
}
]
};
$
(
function
()
{
var
westData
=
{
'name'
:
'Cayman 1 LP'
,
'wins'
:
'1'
,
'children'
:
[
{
'name'
:
'Cayman 2 Limited'
,
'wins'
:
'2'
,
'children'
:
[
{
'name'
:
'BVI 1 Limited'
,
'wins'
:
'3'
,
},
{
'name'
:
'Hong Kong 1 Limited'
,
'wins'
:
'4'
}
]
}
]
};
var
ocWest
=
$
(
'#chart-western'
).
orgchart
({
'data'
:
westData
,
'nodeContent'
:
'name'
,
'direction'
:
't2b'
,
'createNode'
:
function
(
$node
,
data
)
{
if
(
data
.
wins
===
"1"
)
$node
.
children
(
'.title'
).
html
(
'<img src="A.png" style="width:100%">'
);
else
$node
.
children
(
'.title'
).
html
(
'<img src="2.png" style="width:100%">'
);
}
var
ocWest
=
$
(
'#chart-western'
).
orgchart
({
'data'
:
westData
,
'nodeContent'
:
'name'
,
'direction'
:
't2b'
,
'createNode'
:
function
(
$node
,
data
)
{
if
(
data
.
wins
===
"1"
)
{
$node
.
children
(
'.title'
).
html
(
'<img src="A.png" style="width:100%">'
);
$node
.
hide
();
}
else
$node
.
children
(
'.title'
).
html
(
'<img src="2.png" style="width:100%">'
);
},
'initCompleted'
:
function
(
$chart
)
{
console
.
log
(
$chart
);
$chart
.
children
().
children
(
'.lines'
).
hide
();
}
});
});
});
})(
jQuery
);
\ No newline at end of file
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