feat(web): 使用vite重新组织前端代码
This commit is contained in:
95
gringotts-frontend/pages/index/tab-user.js
Normal file
95
gringotts-frontend/pages/index/tab-user.js
Normal file
@@ -0,0 +1,95 @@
|
||||
import {apiGet, crudCommonOptions, mappingField, userRoleMapping, userStateMapping} from '../../components/constants.js'
|
||||
import {userCheckDialog} from "../../components/user/dialog-user-check.js";
|
||||
import {userAdministratorRegisterDialog} from "../../components/user/dialog-user-register.js";
|
||||
|
||||
export function tabUser() {
|
||||
return {
|
||||
visibleOn: '${role === "ADMINISTRATOR"}',
|
||||
title: '用户管理',
|
||||
icon: 'fa fa-user',
|
||||
body: [
|
||||
{
|
||||
id: '9200849e-a8e9-4752-b4fc-ae52dc46a205',
|
||||
type: 'crud',
|
||||
api: apiGet('${base}/user_management/list'),
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
{
|
||||
type: 'action',
|
||||
icon: 'fa fa-plus',
|
||||
tooltip: '新增账号',
|
||||
...userAdministratorRegisterDialog(),
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
name: 'username',
|
||||
label: '邮箱',
|
||||
},
|
||||
{
|
||||
label: '角色',
|
||||
width: 120,
|
||||
...mappingField('role', userRoleMapping)
|
||||
},
|
||||
{
|
||||
label: '账号状态',
|
||||
width: 80,
|
||||
...mappingField('state', userStateMapping)
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
width: 150,
|
||||
type: 'tpl',
|
||||
tpl: '${DATETOSTR(createTime)}'
|
||||
},
|
||||
{
|
||||
label: '更新时间',
|
||||
width: 150,
|
||||
type: 'tpl',
|
||||
tpl: '${DATETOSTR(updateTime)}'
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
width: 100,
|
||||
type: 'operation',
|
||||
fixed: 'right',
|
||||
className: 'nowrap',
|
||||
buttons: [
|
||||
{
|
||||
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}'),
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user