Commit 9e9aa1ec authored by frank.xa.zhang's avatar frank.xa.zhang

fixed shareholder structure -- frank

parent a38a84c1
......@@ -31,15 +31,6 @@ infrastructureModule.controller('organizationFullChartController', ['$scope', '$
nodeBinding: {
field_0: "name"
},
// nodes: [
// {id: 5, pid: 4, name: "Subsidary1", percent: "100%"},
// {id: 6, pid: 4, name: "Subsidary2", percent: "100%"},
// {id: 1, name: "Shareholder1", percent: "100%", spids: []},
// {id: 2, name: "Shareholder2", percent: "100%"},
// {id: 3, name: "Shareholder3", percent: "100%"},
// {id: 4, pid: 1, spids: [2, 3], name: "Comapny", percent: ""}
//
// ],
nodes: nodesCotent,
onExportStart: exportStart,
onClick: click,
......@@ -130,86 +121,6 @@ infrastructureModule.controller('organizationFullChartController', ['$scope', '$
}
$(linkSelector + ">g>text").text(percent + "%");
}
// nodesCotentValue = [
// {id: 5, pid: 4, name: "Subsidary1", percent: "100%"},
// {id: 6, pid: 4, name: "Subsidary2", percent: "100%"},
// {id: 1, name: "Shareholder1", percent: "100%", spids: []},
// {id: 2, name: "Shareholder2", percent: "100%"},
// {id: 3, name: "Shareholder3", percent: "100%"},
// {id: 4, pid: 1, spids: [2, 3], name: "Comapny", percent: ""}
// ];
// middleNode = {id: 4, pid: 1, spids: [2, 3], name: "Comapny", percent: "100%"};
// if (middleNode && middleNode.id > 0) {
// //check if there are more than 1 sub node,need change x coordinate
// var subNodes = _.filter(nodesCotentValue, function (item) {
// return item.id > middleNode.id;
// });
//
// var beforeNodes = _.filter(nodesCotentValue, function (item) {
// return item.id < middleNode.id;
// });
// var haveMoreThanOneNode = false;
// if (subNodes.length > 1) {
// haveMoreThanOneNode = true;
// }
//
// var y = beforeNodes.length > 0 && subNodes.length > 0 ? 346 : 166;
// for (var iii = 0; iii < subNodes.length; iii++) {
// var value = 80 + 220 * iii;
// var nodeSelector = "svg>g[link-id='[" + middleNode.id + "][" + subNodes[iii].id + "]']";
// $(nodeSelector + ">g").attr("transform", "matrix(1,0,0,1," + value + "," + y + ") rotate(0)");
// $(nodeSelector + ">g>text").text(subNodes[iii].percent + "%");
// }
//
// var middleNodeSelector = "svg>g[node-id=" + middleNode.id + "]>rect";
// var polygon = makeSVG('polygon', {"points": '100,0 0,100 200,100', style: "fill:#ffff;stroke:#000;stroke-width:1", height: 115, width: 250});
// $(middleNodeSelector).css("fill", "transparent").css("stroke-width", 0).after(polygon);
//
// var node = _.find(nodesCotentValue, function (item) {
// return item.id === 1;
// });
// var linkSelector = "svg>g[link-id='[1][" + middleNode.id + "]']";
// var linkXValue = 80;
// if (haveMoreThanOneNode) {
// linkXValue = linkXValue + 110;
// }
//
// $(linkSelector + ">g").attr("transform", "matrix(1,0,0,1," + linkXValue + ",166) rotate(0)");
// var linkSelectorG = linkSelector + ">g";
// var linkSelectorGText = linkSelectorG + ">text";
// $(linkSelectorGText).text(node.percent + "%");
// if (middleNode.id > 2) {
// var count = 0;
// for (var i = 2; i < middleNode.id; i++) {
// var subNode = _.find(nodesCotentValue, function (item) {
// return item.id === i;
// });
// var nodeSelector = "svg>g[second-link-id='[" + middleNode.id + "][" + i + "]']";
// var value = 0;
// var value2 = 0;
// if (haveMoreThanOneNode) {
// value = 320 + 110 + 220 * count;
// value2 = 100 + 110;
// } else {
// value = 320 + 220 * count;
// value2 = 100;
// }
// $(nodeSelector + ">path").attr("stroke", "#000");
// $(nodeSelector + ">path").attr("d", "M" + value2 + ",180 L" + value2 + ",160 L" + value + ",160 L" + value + ",102");
// count++;
// var val2 = value - 20;
// var rateG = makeSVG('g', {"transform": "matrix(1,0,0,1," + val2 + ",128) rotate(0)"});
// $(nodeSelector + ">path").after(rateG);
// var nodeSelectorG = nodeSelector + ">g";
// var rateText = makeSVG('text', {"text-anchor": "middle", "fill": "#aeaeae", "width": "290", "x": "0", "y": "0", "style": "font-size:10px"});
// $(nodeSelectorG).append(rateText);
// var nodeSelectorGText = nodeSelectorG + ">text";
// $(nodeSelectorGText).text(subNode.percent + "%");
// }
// }
// }
};
var makeSVG = function (tag, attrs) {
......
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