(function(){
    X.pageLogic['personalsettingsedit'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback; //选择后执行的回调
            var data = parms.extData;//获取到上层弹窗传的数据
            layui.form.render();
            if(data){
                layui.form.val('personalsettingseditexample', {
                    "show_name": data.show_name // "name": "value"
                    ,"desc": data.desc
                    ,"is_show":(data.is_show)? 1 : 0
                });
            }
            $(document).off('click','.personalsettingsedit-qd').on('click','.personalsettingsedit-qd',function(){
                var arr = layui.form.val('personalsettingseditexample');
                arr['event_name'] = data.name;
                X.api("data_mana/event_edit","post",arr,function(d){
                    layer.msg("修改成功");
                    me.callback && me.callback(d);
                    layer.closeAll();
                })
            })

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