var DataAnalysis = {};
$(document).ready(function(){
    // DataAnalysis.init();
    DataAnalysis.talentIdentifyPro(1);
    DataAnalysis.getCountByStreet(1);
    DataAnalysis.getLastEnterprise(1);
    DataAnalysis.talentIdentifyChange();
});

/**
 * 初始化页面
 */
DataAnalysis.init = function(){
    var ajax = new $ax(Feng.ctxPath + "/webIndex/init", function (data) {
        if(data.code==200){
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("查询失败!" + data.responseJSON.message + "!");
    });
    ajax.start();
}

/**
 * 统计过去的企业用户
 */
DataAnalysis.getLastEnterprise = function (type) {
    var ajax = new $ax(Feng.ctxPath + "/webIndex/getLastEnterprise", function (data) {
        if(data.code==200){
            Option.getLastEnterpriseOption(type,data);
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("查询失败!" + data.responseJSON.message + "!");
    });
    ajax.set("type",type);
    ajax.start();
}

/**
 * 人才认定分布图
 */
DataAnalysis.talentIdentifyPro = function(type){
    var ajax = new $ax(Feng.ctxPath + "/webIndex/talentIdentifyPro", function (data) {
        if(data.code==200){
            Option.talentIdentifyProOption(type,data);
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("查询失败!" + data.responseJSON.message + "!");
    });
    ajax.set("type",type);
    ajax.start();
}



DataAnalysis.getCountByStreet = function(type){
    var ajax = new $ax(Feng.ctxPath + "/webIndex/getCountByStreet", function (data) {
        if(data.code==200){
            Option.getCountByStreetOption(type,data);
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("查询失败!" + data.responseJSON.message + "!");
    });
    ajax.set("type",type);
    ajax.start();
}

DataAnalysis.talentIdentifyChange = function () {
    var ajax = new $ax(Feng.ctxPath + "/webIndex/getTalentIdentifyChangeByYear", function (data) {
        if(data.code==200){
            Option.talentIdentifyChangeOption(data);
        } else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("查询失败!" + data.responseJSON.message + "!");
    });
    ajax.start();
}

DataAnalysis.openTab = function (href) {
    var menu = parent.$(".navbar-static-side .J_menuItem");
    for(var key in menu){
        if(menu[key].pathname == href){
            menu[key].click();
        }
    }
}

