refactor: 重构项目结构 - enums/config/types/plugins

- 重构 enums: 按业务域合并为 5 个文件
- 创建 config: storage.ts, vxe-table.ts
- 删除 plugins,功能迁移到 main.ts
- 创建完整 types 结构
- 新增 utils: validators, websocket, register-components
- 创建 router/guards/permission.ts
- 更新配置文件
This commit is contained in:
Ray.Hao
2025-12-12 13:59:40 +08:00
parent add4237b1f
commit 9fb1942619
45 changed files with 836 additions and 834 deletions

121
src/types/global.d.ts vendored
View File

@@ -1,111 +1,16 @@
/**
* 全局类型声明
*
* @deprecated 请使用 @/types 下的具名导出
*/
declare global {
/**
* 响应数据
*/
interface ApiResponse<T = any> {
code: string;
data: T;
msg: string;
}
/**
* 分页查询参数
*/
interface PageQuery {
pageNum: number;
pageSize: number;
}
/**
* 分页响应对象
*/
interface PageResult<T> {
/** 数据列表 */
list: T;
/** 总数 */
total: number;
}
/**
* 页签对象
*/
interface TagView {
/** 页签名称 */
name: string;
/** 页签标题 */
title: string;
/** 页签路由路径 */
path: string;
/** 页签路由完整路径 */
fullPath: string;
/** 页签图标 */
icon?: string;
/** 是否固定页签 */
affix?: boolean;
/** 是否开启缓存 */
keepAlive?: boolean;
/** 路由查询参数 */
query?: any;
}
/**
* 系统设置
*/
interface AppSettings {
/** 系统标题 */
title: string;
/** 系统版本 */
version: string;
/** 是否显示设置 */
showSettings: boolean;
/** 是否显示多标签导航 */
showTagsView: boolean;
/** 是否显示应用Logo */
showAppLogo: boolean;
/** 导航栏布局(left|top|mix) */
layout: "left" | "top" | "mix";
/** 主题颜色 */
themeColor: string;
/** 主题模式(dark|light) */
theme: import("@/enums/settings/theme-enum").ThemeMode;
/** 布局大小(default |large |small) */
size: string;
/** 语言( zh-cn| en) */
language: string;
/** 是否显示水印 */
showWatermark: boolean;
/** 水印内容 */
watermarkContent: string;
/** 侧边栏配色方案 */
sidebarColorScheme: "classic-blue" | "minimal-white";
/** 是否启用 AI 助手 */
enableAiAssistant: boolean;
}
/**
* 下拉选项数据类型
*/
interface OptionType {
/** 值 */
value: string | number;
/** 文本 */
label: string;
/** 子列表 */
children?: OptionType[];
}
/**
* 导入结果
*/
interface ExcelResult {
/** 状态码 */
code: string;
/** 无效数据条数 */
invalidCount: number;
/** 有效数据条数 */
validCount: number;
/** 错误信息 */
messageList: Array<string>;
}
type ApiResponse<T = any> = import("@/types/api").ApiResponse<T>;
type PageQuery = import("@/types/api").PageQuery;
type PageResult<T> = import("@/types/api").PageResult<T>;
type OptionType = import("@/types/api").OptionType;
type ExcelResult = import("@/types/api").ExcelResult;
type TagView = import("@/types/ui").TagView;
type AppSettings = import("@/types/ui").AppSettings;
}
export {};