调整结构

This commit is contained in:
马宝龙
2026-07-28 12:52:36 +08:00
parent f9dcf890b2
commit 94dd560331
61 changed files with 4243 additions and 906 deletions

View File

@@ -0,0 +1,24 @@
import type { Role, Status, UserForm } from '../interfaces/user/model'
export const ROLE_OPTIONS: Role[] = ['Admin', 'Manager', 'Member', 'Viewer']
export const STATUS_OPTIONS: Array<{ value: Status | ''; label: string }> = [
{ value: '', label: '全部' },
{ value: 'ACTIVE', label: '活跃' },
{ value: 'INACTIVE', label: '未激活' },
]
export const EMPTY_USER_FORM: UserForm = {
fullName: '',
email: '',
role: 'Member',
status: 'ACTIVE',
}
export function roleLabel(role: string): string {
return ({ Admin: '管理员', Manager: '经理', Member: '成员', Viewer: '只读成员' })[role] ?? role
}
export function statusLabel(status: Status): string {
return status === 'ACTIVE' ? '活跃' : '未激活'
}