3
This commit is contained in:
+88
-189
@@ -18,202 +18,101 @@ define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
table: 'user',
|
||||
}
|
||||
});
|
||||
|
||||
console.log(Config)
|
||||
var table = $("#table");
|
||||
var columns = [
|
||||
{checkbox: true},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
filter: "number",
|
||||
sortable: true // 是否排序
|
||||
},
|
||||
// {
|
||||
// title: "角色",
|
||||
// field: "role_id",
|
||||
// formatter:function(v,row){
|
||||
// return row.role ? row.role.name : '用户';
|
||||
// },
|
||||
// filter: "select",
|
||||
// filterOption:"roleOption",
|
||||
// visible: false,
|
||||
// },
|
||||
{
|
||||
title: "昵称",
|
||||
field: "nickname"
|
||||
},
|
||||
{
|
||||
title: "头像",
|
||||
field: "avatar",
|
||||
formatter: function (v,d) {
|
||||
return '<img src="'+encodeURI(d['avatar'])+'" style="max-width:32px;max-height:32px;" alt="" />'
|
||||
},
|
||||
visible: false
|
||||
},
|
||||
// {
|
||||
// title: "等级",
|
||||
// field: "level",
|
||||
// visible: false,
|
||||
// },
|
||||
// {
|
||||
// title: "生日",
|
||||
// field: "birthday",
|
||||
// visible: false,
|
||||
// },
|
||||
// {
|
||||
// title: "后缀",
|
||||
// field: "decimal_part",
|
||||
// //visible: false,
|
||||
// },
|
||||
];
|
||||
var currencys = ['money','score','currency1','currency2','currency3','currency4','currency5','currency6','currency7','currency8','currency9'];
|
||||
for (let i = 0; i < currencys.length; i++) {
|
||||
if(Config.allow_currencys.indexOf(currencys[i])!==-1){
|
||||
columns.push({
|
||||
title: __(currencys[i]),
|
||||
field: currencys[i],
|
||||
formatter:Table.api.formatter.number,
|
||||
//sortable: true,
|
||||
//visible: false,
|
||||
});
|
||||
}
|
||||
};
|
||||
columns.push({
|
||||
title: "注册时间",
|
||||
field: "createTime",
|
||||
formatter:function(v,row){
|
||||
return Table.api.formatter.datetime(parseInt(v/1000));
|
||||
},
|
||||
filter:'datetime'
|
||||
});
|
||||
columns.push({
|
||||
title: "状态",
|
||||
field: "status",
|
||||
formatter: Table.api.formatter.switch
|
||||
});
|
||||
columns.push({
|
||||
field: 'operate', title: '操作',
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
text:"团队",
|
||||
name:"team",
|
||||
icon:"mdi mdi-account-group-outline",
|
||||
classname:"btn btn-xs btn-info btn-dialog",
|
||||
url:'/app/admin/user/team'
|
||||
}
|
||||
]
|
||||
});
|
||||
var tableOptions = {
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
commonSearch: false,
|
||||
search: false,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
filter: "number",
|
||||
sortable: true // 是否排序
|
||||
},
|
||||
{
|
||||
title: "推荐人",
|
||||
field: "parent_id",
|
||||
formatter:function(v,row){
|
||||
return row.referrer ? row.referrer.username : '';
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "分组",
|
||||
field: "group",
|
||||
formatter:function(v,row){
|
||||
for (let i = 0; i < Config.groupList.length; i++) {
|
||||
if(Config.groupList[i].value == v){
|
||||
return Config.groupList[i].label;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
filter: "select",
|
||||
filterOption:"groupOption",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "角色",
|
||||
field: "role_id",
|
||||
formatter:function(v,row){
|
||||
return row.role ? row.role.name : '用户';
|
||||
},
|
||||
filter: "select",
|
||||
filterOption:"roleOption",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "用户名",
|
||||
field: "username",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "昵称",
|
||||
field: "nickname",
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'domain',
|
||||
title: '域名',
|
||||
filter: "string",
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
title: "头像",
|
||||
field: "avatar",
|
||||
formatter: function (v,d) {
|
||||
return '<img src="'+encodeURI(d['avatar'])+'" style="max-width:32px;max-height:32px;" alt="" />'
|
||||
},
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
title: "邮箱",
|
||||
field: "email",
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
title: "手机",
|
||||
field: "mobile",
|
||||
visible: false
|
||||
},
|
||||
// {
|
||||
// title: "等级",
|
||||
// field: "level",
|
||||
// visible: false,
|
||||
// },
|
||||
// {
|
||||
// title: "生日",
|
||||
// field: "birthday",
|
||||
// visible: false,
|
||||
// },
|
||||
// {
|
||||
// title: "后缀",
|
||||
// field: "decimal_part",
|
||||
// //visible: false,
|
||||
// },
|
||||
{
|
||||
title: "调研币",
|
||||
field: "money",
|
||||
formatter:Table.api.formatter.number,
|
||||
sortable: true,
|
||||
//visible: false,
|
||||
},
|
||||
{
|
||||
title: "积分",
|
||||
field: "score",
|
||||
sortable: true,
|
||||
visible: false,
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "调研豆",
|
||||
field: "currency1",
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "可领取",
|
||||
field: "currency6",
|
||||
sortable: true,
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "待分配",
|
||||
field: "currency7",
|
||||
sortable: true,
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "已分配",
|
||||
field: "currency8",
|
||||
sortable: true,
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "未通过",
|
||||
field: "currency9",
|
||||
sortable: true,
|
||||
formatter:Table.api.formatter.number
|
||||
},
|
||||
{
|
||||
title: "登录时间",
|
||||
field: "last_time",
|
||||
formatter:Table.api.formatter.datetime,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "登录ip",
|
||||
field: "last_ip",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "注册时间",
|
||||
field: "join_time",
|
||||
formatter:Table.api.formatter.datetime,
|
||||
filter:'datetime'
|
||||
},
|
||||
{
|
||||
title: "注册ip",
|
||||
field: "join_ip",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
field: "created_at",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
field: "updated_at",
|
||||
formatter:Table.api.formatter.datetime,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
field: "status",
|
||||
formatter: Table.api.formatter.switch
|
||||
},
|
||||
{
|
||||
field: 'operate', title: '操作',
|
||||
table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
text:"团队",
|
||||
name:"team",
|
||||
icon:"mdi mdi-account-group-outline",
|
||||
classname:"btn btn-xs btn-info btn-dialog",
|
||||
url:'/app/admin/user/team'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
columns: [columns]
|
||||
};
|
||||
// 初始化表格
|
||||
table.bootstrapTable(tableOptions);
|
||||
|
||||
Reference in New Issue
Block a user