(function(){
    X.pageLogic['projectadmin'] = {
        init : function(){


            var data
            X.api("authority/all_role","get",{},function(d){
                // console.log(d);
                data = d;
                $(".projectadmin-list-name").html(d.sys_role[0]["title"]);
                X.laytpldata("#projectadmin-con-hz-left-list-xtong-dot",d.sys_role,".projectadmin-con-hz-left-list-xtong");
                X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d.dom_role,".projectadmin-con-hz-left-list-tit-xiangmu");
                X.laytpldata("#projectadmin-info-box-dot",d.sys_role[0]['authority'],".projectadmin-info-box");
            })
            
            $(".menu_dapax .item_kuvn").click(function(){
                $(".menu_dapax .item_kuvn").removeClass("selected___3ctlt");
                $(this).addClass("selected___3ctlt");
                var url = $(this).attr("data-url");
            })

            // $(document).on("click",".projectadmin-con-hz-left-list-con",function(){
            //     $(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
            //     $(this).addClass("selected___3ctlt");
            //     $(".projectadmin-list-name").html($(this).html());
            // })

            $(document).on("click",".systemrole-tit",function(){
                $(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
                $(this).addClass("selected___3ctlt");
                $(".projectadmin-list-name").html($(this).html());
                var index = $(this).attr("data-index");
                X.laytpldata("#projectadmin-info-box-dot",data.sys_role[index]['authority'],".projectadmin-info-box");
            })

            $(document).on("click",".roleinproject-tit",function(){
                $(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
                $(this).addClass("selected___3ctlt");
                $(".projectadmin-list-name").html($(this).html());
                var index = $(this).attr("data-index");
                X.laytpldata("#projectadmin-info-box-dot",data.dom_role[index]['authority'],".projectadmin-info-box");
            })

           
        }
    };
})();