(function(){
    X.pageLogic['addeventattradmin'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback; //选择后执行的回调
            var data = parms.extData;//获取到上层弹窗传的数据
            layui.form.render();

            $(".eventattradminedit-but-box .eventattradminedit-qx").click(function(){
                layer.closeAll();
            });
        
            $(document).off('click','.eventattradminedit-but-box .eventattradminedit-qd').on('click','.eventattradminedit-but-box .eventattradminedit-qd',function(){
                var fromdata = layui.form.val("eventattradmineditexample");

               X.api('data_mana/add_attr',"post",{new_attribute: fromdata['eventname'], data_type:fromdata.addevent ,cat:data,state:'add'},function(d){
                   me.callback && me.callback(d);
                   layer.closeAll();
                   layer.msg('添加成功');
               })
            })

        }
    };
})();
