(function(){
    X.pageLogic['userattradmin'] = {
        init : function(){
            var me = this;
            me.userattradminlist(); 
            layui.table.on('tool(userattradmintest)', function(obj){
                var data = obj.data;
                if(obj.event === 'edit'){
                    data['cat'] = 'user'
                    X.parametersopen(data,"eventattradminedit",'auto',function(){
                      me.userattradminlist();  
                    })
                }
            })


        },
        userattradminlist : function(){
            X.laytabledata("#userattradmin-table","data_mana/attr_list",[[
                {field:'name', title: '属性名', sort: true}
                ,{field:'show_name', title: '显示名'}
                ,{field:'data_type', title: '数据类型', sort: true,templet:function(d){
                    if(d.data_type == "string"){
                        return '文本'
                    }else if(d.data_type == "ip"){
                        return 'ip'
                    }else if(d.data_type == "int"){
                        return '数值'
                    }else if(d.data_type == "float"){
                        return '浮点型'
                    }else if(d.data_type == "datetime"){
                        return '时间'
                    }else if(d.data_type == "array"){
                        return '数组'
                    }
                }}
                ,{field:'city', title: '单位'}
                ,{field:'is_show', title: '显示状态', minWidth: 100,templet:function(d){
                    if(d.is_show){
                        return '显示'
                    }else {
                        return '<span style="color: #acbad0">隐藏</span>'
                    }
                }}
                ,{field:'attr_type', title: '属性类型', sort: true}
                ,{field:'score', title: '维度表', sort: true}
                ,{fixed: 'right', title:'操作', toolbar: '#userattradminbarDemo', width:80}
            ]]
            ,"&cat=user");
        }



    };
})();
