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
6afe093c
Commit
6afe093c
authored
Aug 01, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed shareholder structure -- frank
parent
9e9aa1ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
organization-full-chart.ctrl.js
...ure/organizationFullChart/organization-full-chart.ctrl.js
+68
-0
No files found.
atms-web/src/main/webapp/app/admin/infrastructure/organizationFullChart/organization-full-chart.ctrl.js
View file @
6afe093c
...
...
@@ -18,6 +18,11 @@ infrastructureModule.controller('organizationFullChartController', ['$scope', '$
OrgChart
.
templates
.
myTemplate
.
minus
=
'<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect>'
+
'<line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>'
;
OrgChart
.
templates
.
myTemplate
.
nodeMenuButton
=
'<g style="cursor:pointer;" transform="matrix(1,0,0,1,93,15)" control-node-menu-id="{id}">'
+
'<rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect>'
+
'<line x1="0" y1="0" x2="0" y2="10" stroke-width="2" stroke="#0890D3" />'
+
'<line x1="7" y1="0" x2="7" y2="10" stroke-width="2" stroke="#0890D3" />'
+
'<line x1="14" y1="0" x2="14" y2="10" stroke-width="2" stroke="#0890D3" /></g>'
;
$scope
.
chart
=
new
OrgChart
(
document
.
getElementById
(
"tree"
),
{
template
:
"myTemplate"
,
...
...
@@ -25,6 +30,9 @@ infrastructureModule.controller('organizationFullChartController', ['$scope', '$
menu
:
{
png
:
{
text
:
"Export PNG"
}
},
nodeMenu
:
{
png
:
{
text
:
"Export PNG"
}
},
linkBinding
:
{
link_field_0
:
"percent"
},
...
...
@@ -130,7 +138,67 @@ infrastructureModule.controller('organizationFullChartController', ['$scope', '$
return
el
;
};
var
getGArray
=
function
(
nodeId
,
gArray
)
{
var
nodeSelector
=
"svg>g[node-id='"
+
nodeId
+
"']"
;
var
linkSelector
=
"svg>g[link-id*='"
+
nodeId
+
"']"
;
var
secondLinkSelector
=
"svg>g[second-link-id*='"
+
nodeId
+
"']"
;
var
nodeG
=
$
(
nodeSelector
);
var
linkGs
=
$
(
linkSelector
);
var
secondLinkGs
=
$
(
secondLinkSelector
);
gArray
.
push
(
nodeG
);
if
(
linkGs
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
linkGs
.
length
;
i
++
)
{
var
linkG
=
linkGs
[
i
];
var
link_id
=
linkG
.
attributes
[
0
].
value
;
var
linkGSelector
=
"svg>g[link-id='"
+
link_id
+
"']"
;
linkG
=
$
(
linkGSelector
);
var
inResut
=
_
.
find
(
gArray
,
function
(
item
)
{
return
item
.
attr
(
"link-id"
)
===
link_id
||
item
.
attr
(
"second-link-id"
)
===
link_id
;
});
if
(
inResut
)
{
continue
;
}
gArray
.
push
(
linkG
);
var
numbers
=
link_id
.
match
(
/
\d
+/g
).
map
(
Number
);
for
(
var
j
=
0
;
j
<
numbers
.
length
;
j
++
)
{
if
(
numbers
[
j
].
toString
()
!==
nodeId
)
{
getGArray
(
numbers
[
j
],
gArray
);
}
}
}
}
if
(
secondLinkGs
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
secondLinkGs
.
length
;
i
++
)
{
var
secondLinkG
=
secondLinkGs
[
i
];
var
secondLink_id
=
secondLinkG
.
attributes
[
0
].
value
;
var
secondLinkGSelector
=
"svg>g[second-link-id='"
+
secondLink_id
+
"']"
;
secondLinkG
=
$
(
secondLinkGSelector
);
var
inResut
=
_
.
find
(
gArray
,
function
(
item
)
{
return
item
.
attr
(
"link-id"
)
===
secondLink_id
||
item
.
attr
(
"second-link-id"
)
===
secondLink_id
;
});
if
(
inResut
)
{
continue
;
}
gArray
.
push
(
secondLinkG
);
var
numbers
=
secondLink_id
.
match
(
/
\d
+/g
).
map
(
Number
);
for
(
var
j
=
0
;
j
<
numbers
.
length
;
j
++
)
{
if
(
numbers
[
j
].
toString
()
!==
nodeId
)
{
getGArray
(
numbers
[
j
],
gArray
);
}
}
}
}
};
var
exportStart
=
function
(
sender
,
options
,
svg
)
{
var
nodeId
=
options
.
options
.
nodeId
;
var
gArray
=
[];
getGArray
(
nodeId
,
gArray
);
$
(
"svg>g"
).
remove
();
for
(
var
i
=
0
;
i
<
gArray
.
length
;
i
++
)
{
$
(
"svg"
).
append
(
gArray
[
i
]);
}
var
svg
=
$
(
'svg'
)[
0
].
outerHTML
;
console
.
log
(
"svg"
,
svg
);
canvg
(
document
.
getElementById
(
'canvas'
),
svg
);
...
...
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