(function(){
    X.pageLogic['datarightsedit'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback; //选择后执行的回调
            var data = parms.extData;//获取到上层弹窗传的数据
            //
            
            if(data){
                $(".datarightsedit-txt-input").html(data.owner_list);
            }


            $(".datarightsedit-qx").click(function(){
                layer.closeAll();
            })

            $(".datarightsedit-top-box img").click(function(){
                layer.closeAll();
            })

            $(".datarightsedit-qd").click(function(){
                var tit = $(".datarightsedit-txt-input").val();
                var owners = tit.split(",");
                X.api("authz/update_account_owner","post",{owners:owners,account_name:data.name},function(d){
                    layer.msg("创建成功");
                    layer.closeAll();
                    X.pageLogic.datarights.dataauthlist();
                })
                
            })

        }
    };
})();
