feat(frontend): 优化页面样式,更现代化
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
administratorOnly,
|
||||
apiGet,
|
||||
copyField,
|
||||
crudCommonOptions,
|
||||
@@ -13,71 +12,65 @@ import {userCheckDialog, userDetailDialog} from "../../components/user/dialog-us
|
||||
import {userAdministratorRegisterDialog} from "../../components/user/dialog-user-register.js";
|
||||
|
||||
export function tabUser() {
|
||||
return {
|
||||
visibleOn: administratorOnly,
|
||||
title: '用户管理',
|
||||
icon: 'fa fa-user',
|
||||
reload: true,
|
||||
body: [
|
||||
{
|
||||
type: 'crud',
|
||||
api: apiGet('${base}/user_management/list'),
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
return [
|
||||
{
|
||||
type: 'crud',
|
||||
api: apiGet('${base}/user_management/list'),
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
{
|
||||
type: 'action',
|
||||
icon: 'fa fa-plus',
|
||||
tooltip: '新增账号',
|
||||
...userAdministratorRegisterDialog(),
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
copyField(
|
||||
'username',
|
||||
'邮箱',
|
||||
undefined,
|
||||
undefined,
|
||||
userDetailDialog(),
|
||||
),
|
||||
mappingField('role', '角色', userRoleMapping, 120),
|
||||
mappingField('state', '账号状态', userStateMapping),
|
||||
timeField('createdTime', '创建时间'),
|
||||
timeField('lastLoginTime', '上次登陆时间'),
|
||||
operationField('操作', undefined, [
|
||||
{
|
||||
type: 'action',
|
||||
icon: 'fa fa-plus',
|
||||
tooltip: '新增账号',
|
||||
...userAdministratorRegisterDialog(),
|
||||
visibleOn: "${state === 'CHECKING'}",
|
||||
label: '审核',
|
||||
icon: 'fa fa-fingerprint',
|
||||
level: 'primary',
|
||||
size: 'xs',
|
||||
...userCheckDialog(),
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
copyField(
|
||||
'username',
|
||||
'邮箱',
|
||||
undefined,
|
||||
undefined,
|
||||
userDetailDialog(),
|
||||
),
|
||||
mappingField('role', '角色', userRoleMapping, 120),
|
||||
mappingField('state', '账号状态', userStateMapping),
|
||||
timeField('createdTime', '创建时间'),
|
||||
timeField('lastLoginTime', '上次登陆时间'),
|
||||
operationField('操作', undefined, [
|
||||
{
|
||||
visibleOn: "${state === 'CHECKING'}",
|
||||
label: '审核',
|
||||
icon: 'fa fa-fingerprint',
|
||||
level: 'primary',
|
||||
size: 'xs',
|
||||
...userCheckDialog(),
|
||||
},
|
||||
{
|
||||
visibleOn: "${state === 'NORMAL' && role !== 'ADMINISTRATOR'}",
|
||||
label: '禁用',
|
||||
icon: 'fa fa-ban',
|
||||
level: 'danger',
|
||||
size: 'xs',
|
||||
confirmText: '确认禁用账号${username}?',
|
||||
confirmTitle: '禁用账号',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/user_management/disable/${username}'),
|
||||
},
|
||||
{
|
||||
visibleOn: "${state === 'DISABLED' && role !== 'ADMINISTRATOR'}",
|
||||
label: '启用',
|
||||
icon: 'fa fa-check',
|
||||
level: 'success',
|
||||
size: 'xs',
|
||||
confirmText: '确认启用账号${username}?',
|
||||
confirmTitle: '启用账号',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/user_management/enable/${username}'),
|
||||
}
|
||||
]),
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
visibleOn: "${state === 'NORMAL' && role !== 'ADMINISTRATOR'}",
|
||||
label: '禁用',
|
||||
icon: 'fa fa-ban',
|
||||
level: 'danger',
|
||||
size: 'xs',
|
||||
confirmText: '确认禁用账号${username}?',
|
||||
confirmTitle: '禁用账号',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/user_management/disable/${username}'),
|
||||
},
|
||||
{
|
||||
visibleOn: "${state === 'DISABLED' && role !== 'ADMINISTRATOR'}",
|
||||
label: '启用',
|
||||
icon: 'fa fa-check',
|
||||
level: 'success',
|
||||
size: 'xs',
|
||||
confirmText: '确认启用账号${username}?',
|
||||
confirmTitle: '启用账号',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/user_management/enable/${username}'),
|
||||
}
|
||||
]),
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user