feat(admin): 新增题库、排行榜、实时结果和模板管理功能

- 添加题库管理页面及相关组件
- 实现排行榜管理功能,包括列表和详情页
- 新增实时结果展示页面
- 添加模板制作和管理功能
- 完善路由配置和国际化支持
- 新增阿里云OSS文件上传服务
- 添加多种工具函数和类型定义
- 优化表格和表单组件
- 调整布局和样式细节
This commit is contained in:
2026-01-22 17:55:45 +08:00
parent 697d606611
commit f1dacf7c66
25 changed files with 1001 additions and 945 deletions

View File

@ -8,20 +8,20 @@ declare namespace Api {
/** common params of paginating */
interface PaginatingCommonParams {
/** current page number */
current: number;
current: number
/** page size */
size: number;
size: number
/** total count */
total: number;
total: number
}
/** common params of paginating query list data */
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
records: T[];
records: T[]
}
/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>
/**
* enable status
@ -29,22 +29,22 @@ declare namespace Api {
* - "1": enabled
* - "2": disabled
*/
type EnableStatus = '1' | '2';
type EnableStatus = '1' | '2'
/** common record */
type CommonRecord<T = any> = {
/** record id */
id: number;
id: number
/** record creator */
createBy: string;
createBy: string
/** record create time */
createTime: string;
createTime: string
/** record updater */
updateBy: string;
updateBy: string
/** record update time */
updateTime: string;
updateTime: string
/** record status */
status: EnableStatus | null;
} & T;
status: EnableStatus | null
} & T
}
}

View File

@ -5,28 +5,28 @@ declare namespace Api {
* backend api module: "systemManage"
*/
namespace SystemManage {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>
/** role */
type Role = Common.CommonRecord<{
/** role name */
roleName: string;
roleName: string
/** role code */
roleCode: string;
roleCode: string
/** role description */
roleDesc: string;
}>;
roleDesc: string
}>
/** role search params */
type RoleSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'status'> & CommonSearchParams
>;
>
/** role list */
type RoleList = Common.PaginatingQueryRecord<Role>;
type RoleList = Common.PaginatingQueryRecord<Role>
/** all role */
type AllRole = Pick<Role, 'id' | 'roleName' | 'roleCode'>;
type AllRole = Pick<Role, 'id' | 'roleName' | 'roleCode'>
/**
* user gender
@ -34,32 +34,32 @@ declare namespace Api {
* - "1": "male"
* - "2": "female"
*/
type UserGender = '1' | '2';
type UserGender = '1' | '2'
/** user */
type User = Common.CommonRecord<{
/** user name */
userName: string;
userName: string
/** user gender */
userGender: UserGender | null;
userGender: UserGender | null
/** user nick name */
nickName: string;
nickName: string
/** user phone */
userPhone: string;
userPhone: string
/** user email */
userEmail: string;
userEmail: string
/** user role code collection */
userRoles: string[];
}>;
userRoles: string[]
}>
/** user search params */
type UserSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.User, 'userName' | 'userGender' | 'nickName' | 'userPhone' | 'userEmail' | 'status'> &
CommonSearchParams
>;
CommonSearchParams
>
/** user list */
type UserList = Common.PaginatingQueryRecord<User>;
type UserList = Common.PaginatingQueryRecord<User>
/**
* menu type
@ -67,18 +67,18 @@ declare namespace Api {
* - "1": directory
* - "2": menu
*/
type MenuType = '1' | '2';
type MenuType = '1' | '2'
type MenuButton = {
interface MenuButton {
/**
* button code
*
* it can be used to control the button permission
*/
code: string;
code: string
/** button description */
desc: string;
};
desc: string
}
/**
* icon type
@ -86,54 +86,54 @@ declare namespace Api {
* - "1": iconify icon
* - "2": local icon
*/
type IconType = '1' | '2';
type IconType = '1' | '2'
type MenuPropsOfRoute = Pick<
import('vue-router').RouteMeta,
| 'i18nKey'
| 'keepAlive'
| 'constant'
| 'order'
| 'href'
| 'hideInMenu'
| 'activeMenu'
| 'multiTab'
| 'fixedIndexInTab'
| 'query'
>;
| 'i18nKey'
| 'keepAlive'
| 'constant'
| 'order'
| 'href'
| 'hideInMenu'
| 'activeMenu'
| 'multiTab'
| 'fixedIndexInTab'
| 'query'
>
type Menu = Common.CommonRecord<{
/** parent menu id */
parentId: number;
parentId: number
/** menu type */
menuType: MenuType;
menuType: MenuType
/** menu name */
menuName: string;
menuName: string
/** route name */
routeName: string;
routeName: string
/** route path */
routePath: string;
routePath: string
/** component */
component?: string;
component?: string
/** iconify icon name or local icon name */
icon: string;
icon: string
/** icon type */
iconType: IconType;
iconType: IconType
/** buttons */
buttons?: MenuButton[] | null;
buttons?: MenuButton[] | null
/** children menu */
children?: Menu[] | null;
children?: Menu[] | null
}> &
MenuPropsOfRoute;
MenuPropsOfRoute
/** menu list */
type MenuList = Common.PaginatingQueryRecord<Menu>;
type MenuList = Common.PaginatingQueryRecord<Menu>
type MenuTree = {
id: number;
label: string;
pId: number;
children?: MenuTree[];
};
interface MenuTree {
id: number
label: string
pId: number
children?: MenuTree[]
}
}
}