82 lines
2.2 KiB
JavaScript
82 lines
2.2 KiB
JavaScript
import {apiGet, horizontalFormOptions, mappingField, userRoleMapping, userStateMapping} from "../constants.js";
|
|
|
|
const dialogBody = [
|
|
{
|
|
type: 'input-email',
|
|
name: 'username',
|
|
label: '邮箱',
|
|
},
|
|
{
|
|
type: 'control',
|
|
name: 'role',
|
|
label: '角色',
|
|
body: [
|
|
mappingField('role', userRoleMapping),
|
|
]
|
|
},
|
|
{
|
|
type: 'control',
|
|
name: 'state',
|
|
label: '账号状态',
|
|
body: [
|
|
mappingField('state', userStateMapping)
|
|
]
|
|
},
|
|
{
|
|
type: 'input-datetime',
|
|
name: 'createTime',
|
|
label: '创建时间',
|
|
},
|
|
]
|
|
|
|
export function userDetailDialog() {
|
|
return {
|
|
actionType: 'dialog',
|
|
dialog: {
|
|
title: '账号详情',
|
|
actions: [],
|
|
body: {
|
|
type: 'form',
|
|
initApi: apiGet('${base}/user_management/detail/${username}'),
|
|
...horizontalFormOptions(),
|
|
static: true,
|
|
body: [
|
|
...dialogBody,
|
|
{
|
|
type: 'input-datetime',
|
|
name: 'lastLoginTime',
|
|
label: '上次登陆时间',
|
|
},
|
|
],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export function userCheckDialog() {
|
|
return {
|
|
actionType: 'dialog',
|
|
dialog: {
|
|
title: '账号审核',
|
|
actions: [
|
|
{
|
|
type: 'action',
|
|
label: '同意',
|
|
level: 'primary',
|
|
actionType: 'ajax',
|
|
api: apiGet('${base}/user_management/enable/${username}'),
|
|
confirmTitle: '审核通过',
|
|
confirmText: '确认通过账号为${username}通过审核吗?审核通过后将无法撤销。',
|
|
reload: '9200849e-a8e9-4752-b4fc-ae52dc46a205',
|
|
},
|
|
],
|
|
body: {
|
|
type: 'form',
|
|
initApi: apiGet('${base}/user_management/detail/${username}'),
|
|
...horizontalFormOptions(),
|
|
static: true,
|
|
body: dialogBody,
|
|
}
|
|
}
|
|
}
|
|
} |