|
@@ -73,28 +73,39 @@ function b_afterLogin(flag){
|
|
function initRelation(){
|
|
function initRelation(){
|
|
if(isLogined){
|
|
if(isLogined){
|
|
$(".entrelation").height(500);
|
|
$(".entrelation").height(500);
|
|
- $.post("/member/getRelation",{regNo:regNo,entName:entName},function(r){
|
|
|
|
- if(r.flag == false){
|
|
|
|
- $("#entrelation-nologin").addClass("hide");
|
|
|
|
- $("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
|
|
|
|
- $("#entrelation-infovis").hide();
|
|
|
|
- $(".entrelation").css("height","auto");
|
|
|
|
- }else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.relation.links) == "undefined" || r.relation.links.length == 0 || typeof(r.relation.nodes) == "undefined" || r.relation.nodes.length <= 1)){
|
|
|
|
- $("#entrelation-limit,#entrelation-nologin").addClass("hide");
|
|
|
|
- relation = "";
|
|
|
|
- $("#entrelation-infovis").hide();
|
|
|
|
- $("#entrelation-findnull").removeClass("hide");
|
|
|
|
- $(".entrelation").css("height","auto");
|
|
|
|
- }else{
|
|
|
|
- $("#entrelation-limit,#entrelation-nologin").addClass("hide");
|
|
|
|
- loadJS("/js/d3.v3.min.js",function(){
|
|
|
|
- loadJS("/js/geometry.js",function(){
|
|
|
|
- loadJS("/js/relation.js",function(){
|
|
|
|
- relation = new Relation(legcerNo,regNo,r.relation);
|
|
|
|
- relation.init();
|
|
|
|
|
|
+ var relationNoData = function(){
|
|
|
|
+ $("#entrelation-limit,#entrelation-nologin").addClass("hide");
|
|
|
|
+ relation = "";
|
|
|
|
+ $("#entrelation-infovis").hide();
|
|
|
|
+ $("#entrelation-findnull").removeClass("hide");
|
|
|
|
+ $(".entrelation").css("height","auto");
|
|
|
|
+ }
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "/member/getRelation",
|
|
|
|
+ method: "post",
|
|
|
|
+ data: {regNo:regNo,entName:entName},
|
|
|
|
+ success: function(r){
|
|
|
|
+ if(r.flag == false){
|
|
|
|
+ $("#entrelation-nologin").addClass("hide");
|
|
|
|
+ $("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
|
|
|
|
+ $("#entrelation-infovis").hide();
|
|
|
|
+ $(".entrelation").css("height","auto");
|
|
|
|
+ }else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.relation.links) == "undefined" || r.relation.links.length == 0 || typeof(r.relation.nodes) == "undefined" || r.relation.nodes.length <= 1)){
|
|
|
|
+ relationNoData();
|
|
|
|
+ }else{
|
|
|
|
+ $("#entrelation-limit,#entrelation-nologin").addClass("hide");
|
|
|
|
+ loadJS("/js/d3.v3.min.js",function(){
|
|
|
|
+ loadJS("/js/geometry.js",function(){
|
|
|
|
+ loadJS("/js/relation.js",function(){
|
|
|
|
+ relation = new Relation(legcerNo,regNo,r.relation);
|
|
|
|
+ relation.init();
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(){
|
|
|
|
+ relationNoData();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|