(function(){
    X.pageLogic['roleeditname'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback;
            var data = parms.extData;

            $(document).off('click','.modifyname-qd').on('click','.modifyname-qd',function(){
                console.log(111);
                var txt = $(".modifyname-txt").val();
                X.api("authz/edit_role","post",{role_id:data['id'],name:txt,desc:""},function(d){
                    console.log(d);
                    layer.closeAll(0);
                    me.callback && me.callback();
                })
            });

            $(document).off('click','.modifyname-qx').on('click','.modifyname-qx',function(){
                layer.closeAll();
            });

            $(document).off('click','.modifyname-cha').on('click','.modifyname-cha',function(){
                layer.closeAll();
            });

        }
    };
})();