mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-15 05:19:17 +00:00
refactor(app): 清理前端冗余代码并优化页面布局
1. 移除多个废弃的API模块、组件和页面文件 2. 重构个人中心和工作台的菜单结构 3. 替换旧分页组件为官方WdPagination 4. 统一空状态提示为wd-empty组件 5. 优化卡片布局和样式 6. 简化骨架屏实现逻辑 7. 调整首页通知栏样式适配暗色模式
This commit is contained in:
@@ -1,80 +0,0 @@
|
||||
import type { BatchSetStatus } from './user'
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 字典管理 API
|
||||
* 与 web 端 module_system/dict.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const DictAPI = {
|
||||
getTypePage(params?: Record<string, any>): Promise<PageResult<DictTypeItem>> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/type/list`, params)
|
||||
},
|
||||
getTypeDetail(id: number): Promise<DictTypeItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/type/detail/${id}`)
|
||||
},
|
||||
createType(data: DictTypeForm): Promise<DictTypeItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/dict/type/create`, data)
|
||||
},
|
||||
updateType(id: number, data: DictTypeForm): Promise<DictTypeItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/dict/type/update/${id}`, data)
|
||||
},
|
||||
removeType(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/dict/type/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
batchTypeStatus(data: BatchSetStatus): Promise<void> {
|
||||
return http.Patch(`${SYSTEM_BASE}/dict/type/status/batch`, data)
|
||||
},
|
||||
getTypeOptions(): Promise<DictTypeItem[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/type/optionselect`)
|
||||
},
|
||||
getDataPage(params?: Record<string, any>): Promise<PageResult<DictDataItem>> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/data/list`, params)
|
||||
},
|
||||
getDataDetail(id: number): Promise<DictDataItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/data/detail/${id}`)
|
||||
},
|
||||
createData(data: DictDataForm): Promise<DictDataItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/dict/data/create`, data)
|
||||
},
|
||||
updateData(id: number, data: DictDataForm): Promise<DictDataItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/dict/data/update/${id}`, data)
|
||||
},
|
||||
removeData(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/dict/data/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
batchDataStatus(data: BatchSetStatus): Promise<void> {
|
||||
return http.Patch(`${SYSTEM_BASE}/dict/data/status/batch`, data)
|
||||
},
|
||||
getDataByType(dictType: string): Promise<DictDataItem[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/dict/data/info/${dictType}`)
|
||||
},
|
||||
}
|
||||
|
||||
export interface DictTypeForm extends BaseFormType {
|
||||
dict_name?: string
|
||||
dict_type?: string
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface DictTypeItem extends BaseType, DictTypeForm {
|
||||
id: number
|
||||
dict_type: string
|
||||
}
|
||||
|
||||
export interface DictDataForm extends BaseFormType {
|
||||
dict_sort?: number
|
||||
dict_label?: string
|
||||
dict_value?: string
|
||||
dict_type?: string
|
||||
dict_type_id?: number
|
||||
css_class?: string
|
||||
list_class?: string
|
||||
is_default?: boolean | string
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface DictDataItem extends BaseType, DictDataForm {}
|
||||
@@ -1,71 +0,0 @@
|
||||
import type { BatchSetStatus } from './user'
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 菜单管理 API
|
||||
* 与 web 端 module_system/menu.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const MenuAPI = {
|
||||
getTree(params?: MenuQuery): Promise<MenuItem[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/menu/tree`, params)
|
||||
},
|
||||
getDetail(id: number): Promise<MenuItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/menu/detail/${id}`)
|
||||
},
|
||||
create(data: MenuForm): Promise<MenuItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/menu/create`, data)
|
||||
},
|
||||
update(id: number, data: MenuForm): Promise<MenuItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/menu/update/${id}`, data)
|
||||
},
|
||||
remove(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/menu/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
batchStatus(data: BatchSetStatus): Promise<void> {
|
||||
return http.Patch(`${SYSTEM_BASE}/menu/status/batch`, data)
|
||||
},
|
||||
}
|
||||
|
||||
export interface MenuQuery {
|
||||
name?: string
|
||||
status?: number
|
||||
type?: number
|
||||
menu_client?: 'web' | 'app'
|
||||
}
|
||||
|
||||
export interface MenuForm extends BaseFormType {
|
||||
name?: string
|
||||
type: number
|
||||
icon?: string
|
||||
order?: number
|
||||
permission?: string
|
||||
route_name?: string
|
||||
route_path?: string
|
||||
component_path?: string
|
||||
redirect?: string
|
||||
parent_id?: number
|
||||
keep_alive?: boolean
|
||||
hidden?: boolean
|
||||
always_show?: boolean
|
||||
title?: string
|
||||
params?: { key: string, value: string }[]
|
||||
affix?: boolean
|
||||
link?: string
|
||||
is_iframe?: boolean
|
||||
is_hide_tab?: boolean
|
||||
active_path?: string
|
||||
show_badge?: boolean
|
||||
show_text_badge?: string
|
||||
scope?: 'web' | 'app'
|
||||
client?: 'pc' | 'app'
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface MenuItem extends BaseType, MenuForm {
|
||||
id: number
|
||||
parent_name?: string
|
||||
children?: MenuItem[]
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 参数配置 API
|
||||
* 与 web 端 module_system/params.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const ParamsAPI = {
|
||||
getInfo(): Promise<ParamsItem[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/param/info`)
|
||||
},
|
||||
update(id: number, data: ParamsForm): Promise<ParamsItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/param/update/${id}`, data)
|
||||
},
|
||||
}
|
||||
|
||||
export interface ParamsForm extends BaseFormType {
|
||||
config_name?: string
|
||||
config_key?: string
|
||||
config_value?: string
|
||||
config_type?: boolean
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface ParamsItem extends BaseType, ParamsForm {}
|
||||
@@ -1,45 +0,0 @@
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 版本发布管理 API
|
||||
* 与 web 端 module_system/version.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const VersionAPI = {
|
||||
getPage(params?: Record<string, any>): Promise<PageResult<VersionItem>> {
|
||||
return http.Get(`${SYSTEM_BASE}/versions/list`, params)
|
||||
},
|
||||
/** 获取已发布版本列表(无需认证) */
|
||||
getPublished(): Promise<VersionItem[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/versions/published`)
|
||||
},
|
||||
getDetail(id: number): Promise<VersionItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/versions/detail/${id}`)
|
||||
},
|
||||
create(data: VersionForm): Promise<VersionItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/versions/create`, data)
|
||||
},
|
||||
update(id: number, data: VersionForm): Promise<VersionItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/versions/update/${id}`, data)
|
||||
},
|
||||
remove(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/versions/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
setStatus(id: number, status: number): Promise<void> {
|
||||
return http.Put(`${SYSTEM_BASE}/versions/${id}/status`, { status })
|
||||
},
|
||||
}
|
||||
|
||||
export interface VersionForm extends BaseFormType {
|
||||
version?: string
|
||||
title?: string
|
||||
date?: string
|
||||
content?: string
|
||||
description?: string
|
||||
sort?: number
|
||||
status?: number
|
||||
require_re_login?: boolean
|
||||
}
|
||||
|
||||
export interface VersionItem extends BaseType, VersionForm {}
|
||||
Reference in New Issue
Block a user