|
@@ -76,7 +76,6 @@ Relation.prototype.init = function(){
|
|
thisClass.redrawflag=true;
|
|
thisClass.redrawflag=true;
|
|
setTimeout(thisClass.redraw,1000);
|
|
setTimeout(thisClass.redraw,1000);
|
|
}
|
|
}
|
|
- firstresize=false;
|
|
|
|
});
|
|
});
|
|
if(document.getElementById("entrelation-infovis")){
|
|
if(document.getElementById("entrelation-infovis")){
|
|
document.getElementById("entrelation-infovis").oncontextmenu=function(){return false;};
|
|
document.getElementById("entrelation-infovis").oncontextmenu=function(){return false;};
|
|
@@ -84,24 +83,25 @@ Relation.prototype.init = function(){
|
|
$("#entrelation-fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));
|
|
$("#entrelation-fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));
|
|
///////////////////////关系网实例////////////////////////////
|
|
///////////////////////关系网实例////////////////////////////
|
|
var htmls="<div style='position:absolute;top:0px;' class='legend'>";
|
|
var htmls="<div style='position:absolute;top:0px;' class='legend'>";
|
|
- htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #ff9800;'></div><span style='margin-left: 20px;'>本企业</span></div>";
|
|
|
|
- htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #cddc39;opacity:0.5;'></div><span style='margin-left: 12px;'>其他企业</span></div>";
|
|
|
|
- htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #2196f3;'></div><span style='margin-left: 25px;'>个人</span></div>";
|
|
|
|
- htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;margin-bottom: 10px;'><div style='background-color: #cecece;'></div><span style='margin-left: 5px;'>注吊销企业</span></div>";
|
|
|
|
- htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cecece;'>→</span><span style=''>投资关系(股东→企业)</span></div>";
|
|
|
|
- htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cd93d7;'>→</span><span style=''>法定代表人</span></div>";
|
|
|
|
|
|
+ htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #ff9800;opacity: 0.8;'></div><span style='margin-left: 20px;color: #ffffff;'>本企业</span></div>";
|
|
|
|
+ htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #ABE6DB;'></div><span style='margin-left: 12px;'>其他企业</span></div>";
|
|
|
|
+ htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #2196f3;'></div><span style='margin-left: 25px;color: #ffffff;'>个人</span></div>";
|
|
|
|
+ htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;margin-bottom: 10px;'><div style='background-color: #afafaf;'></div><span style='margin-left: 5px;color: #ffffff;'>注吊销企业</span></div>";
|
|
|
|
+ htmls= htmls+ "<div style='position: relative;'><span style='position: absolute;top: 7.5px;width: 25px;height: 5px;background-color: #e2e2e2;'></span><span style='position: absolute;left: 25px;top: 4px;border-top: 6px solid transparent;border-bottom: 6px solid transparent;border-left: 12px solid #e2e2e2;'></span><span style='margin-left: 45px;'>投资关系(股东→企业)</span></div>";
|
|
|
|
+ htmls= htmls+ "<div style='position: relative;'><span style='position: absolute;top: 7.5px;width: 25px;height: 5px;background-color: #cd93d7;'></span><span style='position: absolute;left: 25px;top: 4px;border-top: 6px solid transparent;border-bottom: 6px solid transparent;border-left: 12px solid #cd93d7;'></span><span style='margin-left: 45px;'>法定代表人</span></div>";
|
|
//htmls= htmls+ "<div style='margin:10px 0px;' class='hidden-sm hidden-xs'><span class='text-muted'>提示:点击鼠标右键可以删除不想看的节点。</span></div>";
|
|
//htmls= htmls+ "<div style='margin:10px 0px;' class='hidden-sm hidden-xs'><span class='text-muted'>提示:点击鼠标右键可以删除不想看的节点。</span></div>";
|
|
htmls= htmls+"</div>"
|
|
htmls= htmls+"</div>"
|
|
$("#entrelation").append(htmls);
|
|
$("#entrelation").append(htmls);
|
|
try{
|
|
try{
|
|
this.dataProcess();
|
|
this.dataProcess();
|
|
- this.makeRelation();
|
|
|
|
|
|
+ this.makeRelation();
|
|
}catch(e){}
|
|
}catch(e){}
|
|
}
|
|
}
|
|
Relation.prototype.pattern = function(){
|
|
Relation.prototype.pattern = function(){
|
|
if(this.modleFlag){
|
|
if(this.modleFlag){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ var thisClass = this;
|
|
d3.selectAll("text").each(function (p){
|
|
d3.selectAll("text").each(function (p){
|
|
if(p.type == "ce" || p.type == "e"){
|
|
if(p.type == "ce" || p.type == "e"){
|
|
$(this).text(p.shortText);
|
|
$(this).text(p.shortText);
|
|
@@ -110,11 +110,14 @@ Relation.prototype.pattern = function(){
|
|
this.modleFlag = true;
|
|
this.modleFlag = true;
|
|
this.makeTextBg();
|
|
this.makeTextBg();
|
|
this.makeTitle();
|
|
this.makeTitle();
|
|
|
|
+ this.tick();
|
|
|
|
+ this.force.tick();
|
|
}
|
|
}
|
|
Relation.prototype.verbosemode = function(){
|
|
Relation.prototype.verbosemode = function(){
|
|
if(!this.modleFlag){
|
|
if(!this.modleFlag){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ var thisClass = this;
|
|
d3.selectAll("text").each(function (p){
|
|
d3.selectAll("text").each(function (p){
|
|
if(p.type == "ce" || p.type == "e"){
|
|
if(p.type == "ce" || p.type == "e"){
|
|
$(this).text(p.text);
|
|
$(this).text(p.text);
|
|
@@ -123,6 +126,8 @@ Relation.prototype.verbosemode = function(){
|
|
this.modleFlag = false;
|
|
this.modleFlag = false;
|
|
this.makeTextBg();
|
|
this.makeTextBg();
|
|
this.makeTitle();
|
|
this.makeTitle();
|
|
|
|
+ this.tick();
|
|
|
|
+ this.force.tick();
|
|
}
|
|
}
|
|
Relation.prototype.dataProcess = function(){
|
|
Relation.prototype.dataProcess = function(){
|
|
var reg = new RegExp(/(有限公司|有限责任公司|股份有限公司|总公司|分公司|公司|事务所|合伙企业)$|\(.*\)|\(.*\)/g);
|
|
var reg = new RegExp(/(有限公司|有限责任公司|股份有限公司|总公司|分公司|公司|事务所|合伙企业)$|\(.*\)|\(.*\)/g);
|
|
@@ -146,7 +151,7 @@ Relation.prototype.dataProcess = function(){
|
|
text = text.replace(reg,"");
|
|
text = text.replace(reg,"");
|
|
}
|
|
}
|
|
if(text.length > 2){//再替换开头
|
|
if(text.length > 2){//再替换开头
|
|
- //text = this.filterEntName(text);
|
|
|
|
|
|
+ text = this.filterEntName(text);
|
|
}
|
|
}
|
|
if(text.length > 2){//小于两个字符不生效
|
|
if(text.length > 2){//小于两个字符不生效
|
|
nodeObj.shortText = text;
|
|
nodeObj.shortText = text;
|
|
@@ -293,11 +298,11 @@ Relation.prototype.filterEntName = function(text){
|
|
for(var c in citys){//市
|
|
for(var c in citys){//市
|
|
var c_name = citys[c].n;
|
|
var c_name = citys[c].n;
|
|
if(this.replaceStart(c_name)){
|
|
if(this.replaceStart(c_name)){
|
|
- this.replaceAreas(citys[c].s);
|
|
|
|
|
|
+ //this.replaceAreas(citys[c].s);
|
|
return true;
|
|
return true;
|
|
- }else if(this.replaceAreas(citys[c].s)){
|
|
|
|
|
|
+ }/*else if(this.replaceAreas(citys[c].s)){
|
|
return true;
|
|
return true;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -313,9 +318,9 @@ Relation.prototype.filterEntName = function(text){
|
|
};
|
|
};
|
|
for(var p in provinces){//省
|
|
for(var p in provinces){//省
|
|
var p_name = provinces[p].n;
|
|
var p_name = provinces[p].n;
|
|
- if(this.allProvinces.indexOf(p_name) == -1){
|
|
|
|
|
|
+ /*if(this.allProvinces.indexOf(p_name) == -1){
|
|
continue;
|
|
continue;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
if(this.replaceStart(p_name)){
|
|
if(this.replaceStart(p_name)){
|
|
this.replaceCity(provinces[p].s);
|
|
this.replaceCity(provinces[p].s);
|
|
break;
|
|
break;
|
|
@@ -650,10 +655,10 @@ Relation.prototype.makeRelation = function(){
|
|
.enter();
|
|
.enter();
|
|
this.lines = gs.append("path")
|
|
this.lines = gs.append("path")
|
|
.style("fill", function(p){
|
|
.style("fill", function(p){
|
|
- return (p.type=="cp" || p.isLegal)?"#cd93d7":"#cecece";
|
|
|
|
|
|
+ return (p.type=="cp" || p.isLegal)?"#cd93d7":"#e2e2e2";
|
|
})
|
|
})
|
|
.style("stroke", function(p){
|
|
.style("stroke", function(p){
|
|
- return (p.type=="cp" || p.isLegal)?"#cd93d7":"#cecece";
|
|
|
|
|
|
+ return (p.type=="cp" || p.isLegal)?"#cd93d7":"#e2e2e2";
|
|
})
|
|
})
|
|
.attr("stroke-width",function (e,i){
|
|
.attr("stroke-width",function (e,i){
|
|
return e.linkVal;
|
|
return e.linkVal;
|
|
@@ -699,8 +704,8 @@ Relation.prototype.makeRelation = function(){
|
|
thisClass.removeNode(this);
|
|
thisClass.removeNode(this);
|
|
});
|
|
});
|
|
this.nodes.append("rect")
|
|
this.nodes.append("rect")
|
|
- .attr("rx", 5)
|
|
|
|
- .attr("ry", 5)
|
|
|
|
|
|
+ .attr("rx", 2)
|
|
|
|
+ .attr("ry", 2)
|
|
.attr('height', function(p){
|
|
.attr('height', function(p){
|
|
if(p.type == "ce"){
|
|
if(p.type == "ce"){
|
|
return 25;
|
|
return 25;
|
|
@@ -710,25 +715,20 @@ Relation.prototype.makeRelation = function(){
|
|
})
|
|
})
|
|
.attr("fill", function(p){
|
|
.attr("fill", function(p){
|
|
if(p.type == "e" && (p.opstate == "11" || p.opstate == "07")){
|
|
if(p.type == "e" && (p.opstate == "11" || p.opstate == "07")){
|
|
- return "#cecece";
|
|
|
|
|
|
+ return "#afafaf";
|
|
}
|
|
}
|
|
- return p.type=="p"?"#2196f3":p.type=="ce"?"#ff9800":"#cddc39";
|
|
|
|
|
|
+ return p.type=="p"?"#2196f3":p.type=="ce"?"#ff9800":"#ABE6DB";
|
|
})
|
|
})
|
|
.attr("stroke", function(p){
|
|
.attr("stroke", function(p){
|
|
if(p.type == "e" && (p.opstate == "11" || p.opstate == "07")){
|
|
if(p.type == "e" && (p.opstate == "11" || p.opstate == "07")){
|
|
- return "#cecece";
|
|
|
|
- }
|
|
|
|
- return p.type=="p"?"#2196f3":p.type=="ce"?"#ff9800":"#cddc39";
|
|
|
|
- }).style("opacity",function(p){
|
|
|
|
- if(p.type=="e" && (p.opstate != "11" || p.opstate != "07")){
|
|
|
|
- return "0.5";
|
|
|
|
|
|
+ return "#afafaf";
|
|
}
|
|
}
|
|
- return "1";
|
|
|
|
- });
|
|
|
|
|
|
+ return p.type=="p"?"#2196f3":p.type=="ce"?"#ff9800":"#ABE6DB";
|
|
|
|
+ });
|
|
this.makeTitle();
|
|
this.makeTitle();
|
|
this.nodes.append('text')
|
|
this.nodes.append('text')
|
|
.text(function(d){
|
|
.text(function(d){
|
|
- if(this.modleFlag){
|
|
|
|
|
|
+ if(thisClass.modleFlag){
|
|
return d.shortText;
|
|
return d.shortText;
|
|
}else{
|
|
}else{
|
|
return d.text;
|
|
return d.text;
|
|
@@ -748,6 +748,12 @@ Relation.prototype.makeRelation = function(){
|
|
return "14px";
|
|
return "14px";
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ .style("fill",function(p){
|
|
|
|
+ if(p.type == "e" && (p.opstate == "11" || p.opstate == "07")){
|
|
|
|
+ return "#ffffff";
|
|
|
|
+ }
|
|
|
|
+ return p.type=="p"?"#ffffff":p.type=="ce"?"#ffffff":"auto";
|
|
|
|
+ })
|
|
.on("click",function (d,i){
|
|
.on("click",function (d,i){
|
|
if(!dragstatus && d.type == "e"){
|
|
if(!dragstatus && d.type == "e"){
|
|
window.open("/enterpriseInfoByRegNO/"+d.name+".html");
|
|
window.open("/enterpriseInfoByRegNO/"+d.name+".html");
|
|
@@ -766,9 +772,6 @@ Relation.prototype.makeTitle = function(){
|
|
title = d.text;
|
|
title = d.text;
|
|
}
|
|
}
|
|
var regcap = d.regcap;
|
|
var regcap = d.regcap;
|
|
- if(d.type == "ce"){
|
|
|
|
- console.info(d);
|
|
|
|
- }
|
|
|
|
if(regcap > 0){
|
|
if(regcap > 0){
|
|
var lenRegcap = (regcap + "").length;
|
|
var lenRegcap = (regcap + "").length;
|
|
if(lenRegcap > 4 && (regcap + "").indexOf(".") > -1 && (lenRegcap - (regcap + "").indexOf(".")) > 4){
|
|
if(lenRegcap > 4 && (regcap + "").indexOf(".") > -1 && (lenRegcap - (regcap + "").indexOf(".")) > 4){
|