(function(){
    X.pageLogic['toptab'] = {
        init : function(parms){
            var me = this;
            var data;
            if(parms){
                this.parms = parms;
                data = parms;
            }else {
                X.api("project/","get",{},function(d){
                    data = d;
                    X.DATA['projectarr'] = d;
                    X.DATA['projectid'] = d[0]["_id"];
                    X.DATA["game"] = d[0]["game"];
                });
            }
            console.log(data);
            // 选择项目
            
            X.laytpldata("#toptab-dot",data,"#analysis-zhanwei");
            
            $(document).off('click','.selectproject').on('click','.selectproject',function(){
                var id = $(this).attr("data-id");
                var game = $(this).attr("data-game");
                $(".projecttit").html($(this).html());
                X.DATA['projectid'] = id;
                X.DATA["game"] = game;
                //侧边栏数据渲染
                X.pageLogic.dashboard.freshMenu(id);
            })

        }
    };
})();
