Commit 4403bb37 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed display issues -- frank

parent 0bd7d9fa
......@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.navtree.NavTreeDto;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.organization.dpo.OrgShareholderTreeDataDto;
import pwc.taxtech.atms.organization.dpo.OrganizationDirectorDto;
import pwc.taxtech.atms.organization.dpo.OrganizationHKDto;
import pwc.taxtech.atms.organization.dpo.OrganizationShareholderDto;
......@@ -179,4 +180,11 @@ public class OrganizationHKController {
// return organizationHKService.getShareholders(orgId);
// }
@RequestMapping(value = "getOrgTreeData", method = RequestMethod.GET)
public @ResponseBody
OperationResultDto<List<OrgShareholderTreeDataDto>> getOrgTreeData(@RequestParam("orgId") Long orgId) {
logger.info("POST /api/v1/orgHK/getOrgTreeData");
return organizationHKService.getOrgTreeData(orgId);
}
}
......@@ -645,4 +645,24 @@ public class OrganizationHKServiceImpl {
resultDto.setResult(true);
return resultDto;
}
public OperationResultDto<List<OrgShareholderTreeDataDto>> getOrgTreeData(Long orgId) {
OperationResultDto<List<OrgShareholderTreeDataDto>> resultDto = new OperationResultDto<>();
List<OrgShareholderTreeDataDto> orgShareholderTreeDataDtos = new ArrayList<>();
List<ShareholderDto> shareholderDtos = organizationShareholderExtMapper.selectShareholder(orgId);
return resultDto;
}
private OrgShareholderTreeDataDto buildShareTreeNode(ShareholderDto shareholderDto){
OrgShareholderTreeDataDto orgShareholderTreeDataDto = new OrgShareholderTreeDataDto();
orgShareholderTreeDataDto.setName(shareholderDto.getEntityName());
orgShareholderTreeDataDto.setPercent(shareholderDto.getVotingPercentage());
orgShareholderTreeDataDto.setLevel(1);
return orgShareholderTreeDataDto;
}
}
package pwc.taxtech.atms.organization.dpo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
@Getter
@Setter
@ToString
public class OrgShareholderTreeDataDto {
String name;
Integer level;
String percent;
List<OrgShareholderTreeDataDto> children;
}
commonModule.controller('orgShareholderStructureController', ['$scope', '$log', '$translate', function ($scope, $log, $translate) {
commonModule.controller('orgShareholderStructureController', ['$scope', '$log', '$translate', 'orgHKService', function ($scope, $log, $translate, orgHKService) {
'use strict';
var initParams = function () {
};
var init = function () {
orgHKService.getOrgTreeData($scope.selectedOrgId).success(function (res) {
});
//todo:构造数据
var westData = {
'name': 'Cayman 1 LP',
'wins': '1',
'level': '1',
'children': [
{
'name': 'Cayman 2 Limited', 'wins': '2',
'name': 'Cayman 2 Limited', 'level': '2',
'children': [
{
'name': 'BVI 1 Limited', 'wins': '3'
},
{'name': 'Hong Kong 1 Limited', 'wins': '4'}
{'name': 'BVI 1 Limited', 'level': '3'},
{'name': 'Hong Kong 1 Limited', 'level': '3'}
]
}
]
......@@ -26,7 +30,7 @@ commonModule.controller('orgShareholderStructureController', ['$scope', '$log',
'nodeContent': 'name',
'direction': 't2b',
'createNode': function ($node, data) {
if (data.wins === "1") {
if (data.level === "1") {
$node.children('.title').html('<img src="/app-resources/images/A.png" style="width:100%">');
// $node.hide();
}
......
......@@ -7,6 +7,7 @@ commonModule.directive('orgShareholderStructure', ['$log', function ($log) {
replace: true,
controller: 'orgShareholderStructureController',
scope: {
selectedOrgId: '=?'
},
link: function (scope, element) {
}
......
......@@ -47,14 +47,17 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC
attachmentDelete: function (attachmentId) {
return $http.delete('/orgHK/downloadAttachment?attachmentId=' + attachmentId, apiConfig.create());
},
getShareholders: function (orgId) {
return $http.get('/orgHk/getShareholders?orgId=' + orgId, apiConfig.create());
},
getSubsidaries: function (orgId) {
return $http.get('/orgHK/getSubsidaries?orgId=' + orgId, apiConfig.create());
},
getDirectors: function (orgId) {
return $http.get('/orgHK/getDirectors?orgId=' + orgId, apiConfig.create());
// getShareholders: function (orgId) {
// return $http.get('/orgHk/getShareholders?orgId=' + orgId, apiConfig.create());
// },
// getSubsidaries: function (orgId) {
// return $http.get('/orgHK/getSubsidaries?orgId=' + orgId, apiConfig.create());
// },
// getDirectors: function (orgId) {
// return $http.get('/orgHK/getDirectors?orgId=' + orgId, apiConfig.create());
// },
getOrgTreeData: function (orgId) {
return $http.get('/orgHK/getOrgTreeData?orgId=' + orgId, apiConfig.create());
}
}
}]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"id": "0",
"name": "Jack",
"age": 30,
"city": "New York",
"_children": [
{
"id": "1",
"name": "John",
"age": 30,
"city": "New York",
"_children": [
{
"id": "3",
"name": "Simon",
"age": 30,
"city": "New York",
"_children": [],
"_parents": []
},
{
"id": "4",
"name": "Kelly",
"age": 30,
"city": "New York",
"_children": [],
"_parents": []
}
],
"_parents": []
},
{
"id": "2",
"name": "Jane",
"age": 20,
"city": "San Francisco",
"_children": [],
"_parents": []
}
],
"_parents": [
{
"id": "5",
"name": "Eddie",
"age": 30,
"city": "New York",
"_children": [],
"_parents": []
},
{
"id": "6",
"name": "Jacob",
"age": 30,
"city": "New York",
"_children": [],
"_parents": []
}
]
}
\ No newline at end of file
This diff is collapsed.
......@@ -8,7 +8,7 @@
</head>
<body>
<div id="tree"></div>
<script src="https://balkangraph.com/js/latest/OrgChart.js"></script>
<script src="./orgchart.js"></script>
<script src="./script.js"></script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
OrgChart.templates.myTemplate = Object.assign({}, OrgChart.templates.mery);
OrgChart.templates.myTemplate.size = [400, 400];
OrgChart.templates.myTemplate.node = '<rect width="400" height="200" style="fill:rgb(255,119,48);stroke-width:3px;stroke:rgba(153,10,10,0.01)" />';
OrgChart.templates.myTemplate.ripple = {
radius: 100,
color: "#0890D3",
rect: null
};
OrgChart.templates.myTemplate.field_0 = '<text style="font-size: 24px;" fill="#ffffff" x="100" y="90" text-anchor="middle">{val}</text>';
OrgChart.templates.myTemplate.field_1 = '<text style="font-size: 16px;" fill="#ffffff" x="100" y="60" text-anchor="middle">{val}</text>';
window.onload = function () {
var chart = new OrgChart(document.getElementById("tree"), {
template: "olivia",
enableDragDrop: true,
nodeMouseClick: OrgChart.action.edit,
nodeMenu: {
details: { text: "Details" },
edit: { text: "Edit" },
add: { text: "Add" },
remove: { text: "Remove" }
},
dragDropMenu: {
addInGroup: { text: "Add in group" },
addAsChild: { text: "Add as child" }
},
nodeBinding: {
field_0: "name",
field_1: "title",
img_0: "img"
},
tags: {
Directors: {
group: true,
groupName: "Directors",
groupState: OrgChart.EXPAND,
template: "group_grey"
},
HRs: {
group: true,
groupName: "HR Team",
groupState: OrgChart.COLLAPSE,
OrgChart.templates.myTemplate.img_0 = '<clipPath id="ulaImg"><circle cx="100" cy="150" r="0"></circle></clipPath>' +
'<image preserveAspectRatio="xMidYMid slice" clip-path="url(#ulaImg)" xlink:href="{val}" x="60" y="110" width="0" height="0"></image>';
OrgChart.templates.myTemplate.link = '<path stroke="#686868" stroke-width="1px" fill="none" link-id="[{id}][{child-id}]" d="M{xa},{ya} L{xb},{yb} {xc},{yc} {xd},{yd}" />';
OrgChart.templates.myTemplate.edge = '<path stroke="#686868" stroke-width="1px" fill="none" edge-id="[{id}][{child-id}]" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>';
template: "group_grey"
},
Sales: {
group: true,
groupName: "Sales Team",
groupState: OrgChart.EXPAND,
template: "group_grey"
},
Devs: {
group: true,
groupName: "Dev Team",
groupState: OrgChart.EXPAND,
template: "group_grey"
}
},
nodes: [
{ id: 1, tags: ["Directors"], name: "Billy Moore", title: "CEO", img: "https://balkangraph.com/js/img/2.jpg" },
{ id: 2, tags: ["Directors"], name: "Marley Wilson", title: "Director", img: "https://balkangraph.com/js/img/3.jpg" },
{ id: 3, tags: ["Directors"], name: "Bennie Shelton", title: "Shareholder", img: "https://balkangraph.com/js/img/4.jpg" },
OrgChart.templates.myTemplate.plus =
'<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>'
+ '<line x1="18" y1="4" x2="18" y2="32" stroke-width="1" stroke="#aeaeae"></line>';
{ id: 4, pid: 1, name: "Billie Rose", title: "Dev Team Lead", img: "https://balkangraph.com/js/img/5.jpg" },
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>';
{ id: 5, pid: 1, tags: ["HRs"], name: "Glenn Bell", title: "HR", img: "https://balkangraph.com/js/img/10.jpg" },
{ id: 6, pid: 1, tags: ["HRs"], name: "Blair Francis", title: "HR", img: "https://balkangraph.com/js/img/11.jpg" },
OrgChart.templates.myTemplate.expandCollapseSize = 36;
{ id: 7, pid: 1, name: "Skye Terrell", title: "Manager", img: "https://balkangraph.com/js/img/12.jpg" },
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>';
{ id: 8, pid: 4, tags: ["Devs"], name: "Jordan Harris", title: "JS Developer", img: "https://balkangraph.com/js/img/6.jpg" },
{ id: 9, pid: 4, tags: ["Devs"], name: "Will Woods", title: "JS Developer", img: "https://balkangraph.com/js/img/7.jpg" },
{ id: 10, pid: 4, tags: ["Devs"], name: "Skylar Parrish", title: "node.js Developer", img: "https://balkangraph.com/js/img/8.jpg" },
{ id: 11, pid: 4, tags: ["Devs"], name: "Ashton Koch", title: "C# Developer", img: "https://balkangraph.com/js/img/9.jpg" },
OrgChart.templates.myTemplate.exportMenuButton = '<div style="position:absolute;right:{p}px;top:{p}px; width:40px;height:50px;cursor:pointer;" control-export-menu="">' +
'<hr style="background-color: #0890D3; height: 3px; border: none;">' +
'<hr style="background-color: #0890D3; height: 3px; border: none;">' +
'<hr style="background-color: #0890D3; height: 3px; border: none;"></div>';
{ id: 12, pid: 7, tags: ["Sales"], name: "Bret Fraser", title: "Sales", img: "https://balkangraph.com/js/img/13.jpg" },
{ id: 13, pid: 7, tags: ["Sales"], name: "Steff Haley", title: "Sales", img: "https://balkangraph.com/js/img/14.jpg" }
]
});
};
OrgChart.templates.myTemplate.pointer = '<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)">' +
'<g transform="matrix(0.3,0,0,0.3,-17,-17)">' +
'<polygon fill="#0890D3" points="53.004,173.004 53.004,66.996 0,120"/>' +
'<polygon fill="#0890D3" points="186.996,66.996 186.996,173.004 240,120"/>' +
'<polygon fill="#0890D3" points="66.996,53.004 173.004,53.004 120,0"/>' +
'<polygon fill="#0890D3" points="120,240 173.004,186.996 66.996,186.996"/>' +
'<circle fill="#0890D3" cx="120" cy="120" r="30"/></g></g>';
OrgChart.templates.ana.field_0 = '<text class="field_0" style="font-size: 20px;" fill="#ffffff" x="125" y="60" text-anchor="middle">{val}</text>';
var chart = new OrgChart(document.getElementById("tree"), {
enableSearch: false,
// nodeMenu: {
// add: {text: "Add"},
// edit: {text: "Edit"},
// remove: {text: "Remove"}
// },
// menu: {
// pdf: {text: "Export PDF"},
// png: {text: "Export PNG"},
// svg: {text: "Export SVG"},
// csv: {text: "Export CSV"}
// },
linkBinding: {
link_field_0: "percent"
},
nodeBinding: {
field_0: "name",
// field_1: "title",
// img_0: "img"
},
nodes: [
{id: 1, name: "Amber McKenzie", title: "CEO", img: "//balkangraph.com/js/img/1.jpg",percent:"100%"},
{id: 2, pid: 1, name: "Ava Field", title: "IT Manager", img: "//balkangraph.com/js/img/2.jpg", mobile: "0878108255",percent:"100%"},
{id: 3, pid: 1, name: "Peter Stevens", title: "HR Manager", img: "//balkangraph.com/js/img/3.jpg",percent:"100%"}
]
});
\ No newline at end of file
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