feat(字典管理): 新增字典管理功能及相关基础设施
- 新增字典管理页面,支持字典项的增删改查 - 添加 pinia-plugin-persistedstate 依赖,实现状态持久化 - 创建字典相关的 API 类型定义和服务接口 - 实现字典数据存储模块,支持字典数据的缓存和复用 - 添加 useDict 组合式函数,方便组件中使用字典数据 - 在题目分类和比赛创建模块中使用字典数据替代硬编码选项 - 优化分类树组件,添加拖拽手柄和题目类型选择
This commit is contained in:
2
apps/admin/src/typings/api/common.d.ts
vendored
2
apps/admin/src/typings/api/common.d.ts
vendored
@ -24,7 +24,7 @@ declare namespace Api {
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'currentPage' | 'pageSize'>
|
||||
|
||||
/** common response */
|
||||
interface CommonResponse {
|
||||
export interface CommonResponse {
|
||||
success: boolean
|
||||
code: number
|
||||
msg: string
|
||||
|
||||
37
apps/admin/src/typings/api/dictionary.d.ts
vendored
Normal file
37
apps/admin/src/typings/api/dictionary.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Namespace Api
|
||||
*
|
||||
* All backend api type
|
||||
*/
|
||||
declare namespace Api {
|
||||
namespace Dictionary {
|
||||
interface DictionaryItem {
|
||||
Id: number
|
||||
DicKey: string
|
||||
DicValue: string
|
||||
bakValue: string
|
||||
}
|
||||
|
||||
interface DictionaryUIItem {
|
||||
id: number
|
||||
uI_Key: string
|
||||
uI_Value: string
|
||||
bakValue: string
|
||||
dictionaryID: number
|
||||
}
|
||||
|
||||
type AddOrUpdateParams = DictionaryItem
|
||||
|
||||
interface AddOrUpdateDictionaryUITypeParams {
|
||||
id?: number
|
||||
uI_Key: string
|
||||
uI_Value: string
|
||||
bakValue: string
|
||||
dictionaryID: number
|
||||
}
|
||||
|
||||
interface SearchParams {
|
||||
RoomID: number
|
||||
}
|
||||
}
|
||||
}
|
||||
3
apps/admin/src/typings/elegant-router.d.ts
vendored
3
apps/admin/src/typings/elegant-router.d.ts
vendored
@ -24,6 +24,7 @@ declare module "@elegant-router/types" {
|
||||
"competition_competition-add": "/competition/competition-add";
|
||||
"competition_competition-detail": "/competition/competition-detail";
|
||||
"competition_competition-list": "/competition/competition-list";
|
||||
"dictionary": "/dictionary";
|
||||
"home": "/home";
|
||||
"iframe-page": "/iframe-page/:url";
|
||||
"login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
|
||||
@ -71,6 +72,7 @@ declare module "@elegant-router/types" {
|
||||
| "404"
|
||||
| "500"
|
||||
| "competition"
|
||||
| "dictionary"
|
||||
| "home"
|
||||
| "iframe-page"
|
||||
| "login"
|
||||
@ -103,6 +105,7 @@ declare module "@elegant-router/types" {
|
||||
| "competition_competition-add"
|
||||
| "competition_competition-detail"
|
||||
| "competition_competition-list"
|
||||
| "dictionary"
|
||||
| "home"
|
||||
| "question-store"
|
||||
| "rank_rank-detail"
|
||||
|
||||
Reference in New Issue
Block a user