将 web-admin 从子模块改为仓库内普通目录,便于单仓克隆与维护。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e9d020d50
commit
c87732fcd5
515 files changed
+74372
-1
No files matched your search
Vendored
+380
@@ -0,0 +1,380 @@
|
||||
/**
|
||||
* API 类型定义
|
||||
*/
|
||||
declare namespace Api {
|
||||
namespace Auth {
|
||||
interface UserInfo {
|
||||
userId?: string
|
||||
id?: string
|
||||
username: string
|
||||
realName?: string
|
||||
phone?: string
|
||||
role: string
|
||||
regionId?: string
|
||||
regionName?: string
|
||||
email?: string
|
||||
roles?: string[]
|
||||
/** 自定义头像 URL,空则前端使用系统默认 logo */
|
||||
avatarUrl?: string | null
|
||||
}
|
||||
|
||||
interface LoginParams {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
interface LoginResponse {
|
||||
token: string
|
||||
refreshToken: string
|
||||
expiresIn: number
|
||||
userInfo: UserInfo
|
||||
}
|
||||
}
|
||||
|
||||
namespace User {
|
||||
interface UserItem {
|
||||
id: string
|
||||
username: string
|
||||
realName: string
|
||||
phone: string
|
||||
avatarUrl?: string | null
|
||||
role: string
|
||||
regionId?: string
|
||||
regionName?: string
|
||||
isActive: boolean
|
||||
createAt: string
|
||||
createName: string
|
||||
}
|
||||
|
||||
interface UserDetail extends UserItem {
|
||||
updateAt: string
|
||||
updateBy: string
|
||||
}
|
||||
}
|
||||
|
||||
namespace Region {
|
||||
interface RegionItem {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
description?: string
|
||||
sortOrder: number
|
||||
isActive: boolean
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface RegionDetail extends RegionItem {
|
||||
updateAt: string
|
||||
updateBy: string
|
||||
}
|
||||
}
|
||||
|
||||
namespace Category {
|
||||
interface CategoryItem {
|
||||
id: string
|
||||
name: string
|
||||
imageUrl?: string
|
||||
parentId?: string
|
||||
parentName?: string
|
||||
sortOrder: number
|
||||
isActive: boolean
|
||||
createAt: string
|
||||
}
|
||||
}
|
||||
|
||||
namespace Unit {
|
||||
interface UnitItem {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
isActive: boolean
|
||||
createAt: string
|
||||
}
|
||||
}
|
||||
|
||||
namespace Product {
|
||||
interface ProductItem {
|
||||
id: string
|
||||
name: string
|
||||
categoryId?: string
|
||||
categoryName?: string
|
||||
unitId?: string
|
||||
unitName?: string
|
||||
description?: string
|
||||
imageUrl?: string
|
||||
isActive: boolean
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface ProductDetail extends ProductItem {
|
||||
updateAt: string
|
||||
updateBy: string
|
||||
}
|
||||
|
||||
// 商品轮播图
|
||||
interface ProductBanner {
|
||||
id: string
|
||||
productId: string
|
||||
mediaType: string
|
||||
fileUrl: string
|
||||
thumbnailUrl?: string
|
||||
sortOrder: number
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface ProductBannerCreate {
|
||||
mediaType?: string
|
||||
fileUrl: string
|
||||
thumbnailUrl?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
interface ProductBannerUpdate {
|
||||
mediaType?: string
|
||||
fileUrl?: string
|
||||
thumbnailUrl?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
// 商品详情媒体
|
||||
interface ProductDetailMedia {
|
||||
id: string
|
||||
productId: string
|
||||
contentType: string
|
||||
contentText?: string
|
||||
fileUrl?: string
|
||||
thumbnailUrl?: string
|
||||
description?: string
|
||||
sortOrder: number
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface ProductDetailMediaCreate {
|
||||
contentType?: string
|
||||
contentText?: string
|
||||
fileUrl?: string
|
||||
thumbnailUrl?: string
|
||||
description?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
interface ProductDetailMediaUpdate {
|
||||
contentType?: string
|
||||
contentText?: string
|
||||
fileUrl?: string
|
||||
thumbnailUrl?: string
|
||||
description?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
// 商品参数模板
|
||||
interface ProductParameter {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
paramType: string
|
||||
options?: string
|
||||
placeholder?: string
|
||||
isRequired: number
|
||||
isActive: number
|
||||
sortOrder: number
|
||||
remark?: string
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface ProductParameterSimple {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
paramType: string
|
||||
options?: string
|
||||
}
|
||||
|
||||
interface ProductParameterCreate {
|
||||
name: string
|
||||
code: string
|
||||
paramType?: string
|
||||
options?: string
|
||||
placeholder?: string
|
||||
isRequired?: number
|
||||
isActive?: number
|
||||
sortOrder?: number
|
||||
remark?: string
|
||||
}
|
||||
|
||||
interface ProductParameterUpdate {
|
||||
name?: string
|
||||
code?: string
|
||||
paramType?: string
|
||||
options?: string
|
||||
placeholder?: string
|
||||
isRequired?: number
|
||||
isActive?: number
|
||||
sortOrder?: number
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 分类参数关联
|
||||
interface CategoryParameter {
|
||||
id: string
|
||||
categoryId: string
|
||||
parameterId: string
|
||||
parameterName: string
|
||||
parameterCode: string
|
||||
paramType: string
|
||||
options?: string
|
||||
placeholder?: string
|
||||
isRequired: number
|
||||
defaultValue?: string
|
||||
sortOrder: number
|
||||
}
|
||||
|
||||
interface CategoryParameterCreate {
|
||||
categoryId: string
|
||||
parameterId: string
|
||||
isRequired?: number
|
||||
defaultValue?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
// 商品参数值
|
||||
interface ProductParameterValue {
|
||||
id: string
|
||||
productId: string
|
||||
parameterId: string
|
||||
parameterName?: string
|
||||
parameterCode?: string
|
||||
paramType?: string
|
||||
options?: string
|
||||
placeholder?: string
|
||||
paramValue?: string
|
||||
sortOrder: number
|
||||
}
|
||||
|
||||
interface ProductParameterValueCreate {
|
||||
productId: string
|
||||
parameterId: string
|
||||
paramValue?: string
|
||||
}
|
||||
|
||||
// 售后评价
|
||||
interface ProductReview {
|
||||
id: string
|
||||
productId: string
|
||||
orderId?: string
|
||||
orderItemId?: string
|
||||
userId: string
|
||||
userName?: string
|
||||
rating: number
|
||||
ratingTags?: string
|
||||
content?: string
|
||||
isAnonymous: number
|
||||
replyContent?: string
|
||||
replyTime?: string
|
||||
replyBy?: string
|
||||
replyByName?: string
|
||||
likeCount: number
|
||||
isTop: number
|
||||
status: string
|
||||
rejectReason?: string
|
||||
createAt: string
|
||||
mediaList?: ProductReviewMedia[]
|
||||
}
|
||||
|
||||
interface ProductReviewMedia {
|
||||
id: string
|
||||
reviewId: string
|
||||
mediaType: string
|
||||
fileUrl: string
|
||||
thumbnailUrl?: string
|
||||
sortOrder: number
|
||||
}
|
||||
|
||||
interface ProductReviewStatistics {
|
||||
totalCount: number
|
||||
pendingCount: number
|
||||
approvedCount: number
|
||||
rejectedCount: number
|
||||
avgRating: number
|
||||
ratingDistribution: Record<string, number>
|
||||
}
|
||||
}
|
||||
|
||||
namespace Order {
|
||||
interface OrderItem {
|
||||
id: string
|
||||
orderNo: string
|
||||
clientId: string
|
||||
clientName: string
|
||||
regionId: string
|
||||
regionName: string
|
||||
priceListId: string
|
||||
totalAmount: string
|
||||
paidAmount: string
|
||||
receivableAmount: string
|
||||
refundAmount: string
|
||||
status: string
|
||||
paymentMethod?: string
|
||||
contactPerson?: string
|
||||
contactPhone?: string
|
||||
deliveryAddress?: string
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface OrderDetail extends OrderItem {
|
||||
items: OrderItemDetail[]
|
||||
cancelReason?: string
|
||||
cancelReviewTime?: string
|
||||
completedTime?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
interface OrderItemDetail {
|
||||
id: string
|
||||
productId: string
|
||||
productName: string
|
||||
unitId: string
|
||||
unitName: string
|
||||
quantity: string
|
||||
unitPrice: string
|
||||
amount: string
|
||||
deliveredQuantity: string
|
||||
status: string
|
||||
}
|
||||
}
|
||||
|
||||
namespace Delivery {
|
||||
interface DeliveryTask {
|
||||
id: string
|
||||
taskNo: string
|
||||
orderId: string
|
||||
orderNo: string
|
||||
regionId: string
|
||||
regionName: string
|
||||
deliverId?: string
|
||||
deliverName?: string
|
||||
status: string
|
||||
pickupTime?: string
|
||||
deliveryTime?: string
|
||||
createAt: string
|
||||
}
|
||||
|
||||
interface DeliveryTaskDetail extends DeliveryTask {
|
||||
items: DeliveryTaskItem[]
|
||||
}
|
||||
|
||||
interface DeliveryTaskItem {
|
||||
id: string
|
||||
productName: string
|
||||
quantity: string
|
||||
deliveredQuantity: string
|
||||
status: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
Vendored
+138
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* API 接口类型定义模块
|
||||
*
|
||||
* 提供所有后端接口的类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 通用类型(分页参数、响应结构等)
|
||||
* - 认证类型(登录、用户信息等)
|
||||
* - 系统管理类型(用户、角色等)
|
||||
* - 全局命名空间声明
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - API 请求参数类型约束
|
||||
* - API 响应数据类型定义
|
||||
* - 接口文档类型同步
|
||||
*
|
||||
* ## 注意事项
|
||||
*
|
||||
* - 在 .vue 文件使用需要在 eslint.config.mjs 中配置 globals: { Api: 'readonly' }
|
||||
* - 使用全局命名空间,无需导入即可使用
|
||||
*
|
||||
* ## 使用方式
|
||||
*
|
||||
* ```typescript
|
||||
* const params: Api.Auth.LoginParams = { userName: 'admin', password: '123456' }
|
||||
* const response: Api.Auth.UserInfo = await fetchUserInfo()
|
||||
* ```
|
||||
*
|
||||
* @module types/api/api
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
declare namespace Api {
|
||||
/** 通用类型 */
|
||||
namespace Common {
|
||||
/** 分页参数 */
|
||||
interface PaginationParams {
|
||||
/** 当前页码 */
|
||||
current: number
|
||||
/** 每页条数 */
|
||||
size: number
|
||||
/** 总条数 */
|
||||
total: number
|
||||
}
|
||||
|
||||
/** 通用搜索参数 */
|
||||
type CommonSearchParams = Pick<PaginationParams, 'current' | 'size'>
|
||||
|
||||
/** 分页响应基础结构 */
|
||||
interface PaginatedResponse<T = any> {
|
||||
records: T[]
|
||||
current: number
|
||||
size: number
|
||||
total: number
|
||||
}
|
||||
|
||||
/** 启用状态 */
|
||||
type EnableStatus = '1' | '2'
|
||||
}
|
||||
|
||||
/** 认证类型 */
|
||||
namespace Auth {
|
||||
/** 登录参数 */
|
||||
interface LoginParams {
|
||||
userName: string
|
||||
password: string
|
||||
}
|
||||
|
||||
/** 登录响应 */
|
||||
interface LoginResponse {
|
||||
token: string
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
/** 用户信息 */
|
||||
interface UserInfo {
|
||||
buttons: string[]
|
||||
roles: string[]
|
||||
userId: number
|
||||
userName: string
|
||||
email: string
|
||||
avatar?: string
|
||||
}
|
||||
}
|
||||
|
||||
/** 系统管理类型 */
|
||||
namespace SystemManage {
|
||||
/** 用户列表 */
|
||||
type UserList = Api.Common.PaginatedResponse<UserListItem>
|
||||
|
||||
/** 用户列表项 */
|
||||
interface UserListItem {
|
||||
id: number
|
||||
avatar: string
|
||||
status: string
|
||||
userName: string
|
||||
userGender: string
|
||||
nickName: string
|
||||
userPhone: string
|
||||
userEmail: string
|
||||
userRoles: string[]
|
||||
createBy: string
|
||||
createTime: string
|
||||
updateBy: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
/** 用户搜索参数 */
|
||||
type UserSearchParams = Partial<
|
||||
Pick<UserListItem, 'id' | 'userName' | 'userGender' | 'userPhone' | 'userEmail' | 'status'> &
|
||||
Api.Common.CommonSearchParams
|
||||
>
|
||||
|
||||
/** 角色列表 */
|
||||
type RoleList = Api.Common.PaginatedResponse<RoleListItem>
|
||||
|
||||
/** 角色列表项 */
|
||||
interface RoleListItem {
|
||||
roleId: number
|
||||
roleName: string
|
||||
roleCode: string
|
||||
description: string
|
||||
enabled: boolean
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/** 角色搜索参数 */
|
||||
type RoleSearchParams = Partial<
|
||||
Pick<RoleListItem, 'roleId' | 'roleName' | 'roleCode' | 'description' | 'enabled'> &
|
||||
Api.Common.CommonSearchParams & {
|
||||
startTime: string | null
|
||||
endTime: string | null
|
||||
}
|
||||
>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* 通用类型定义模块
|
||||
*
|
||||
* 提供项目中常用的通用类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 状态类型(启用/禁用)
|
||||
* - 性别类型
|
||||
* - 排序方向类型
|
||||
* - 操作类型(增删改查)
|
||||
* - 记录类型(键值对)
|
||||
* - 时间范围类型
|
||||
* - 文件信息类型
|
||||
* - 坐标和尺寸类型
|
||||
* - 响应式断点类型
|
||||
* - 主题和语言类型
|
||||
* - 环境和弹窗类型
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - 通用数据结构定义
|
||||
* - 类型约束和提示
|
||||
* - 减少重复类型定义
|
||||
*
|
||||
* @module types/common/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
// 导出响应类型
|
||||
export * from './response'
|
||||
|
||||
// 状态类型
|
||||
export type Status = 0 | 1 // 0: 禁用, 1: 启用
|
||||
|
||||
// 性别类型
|
||||
export type Gender = 'male' | 'female' | 'unknown'
|
||||
|
||||
// 排序方向
|
||||
export type SortOrder = 'ascending' | 'descending'
|
||||
|
||||
// 操作类型
|
||||
export type ActionType = 'create' | 'update' | 'delete' | 'view'
|
||||
|
||||
// 可选的记录类型
|
||||
export type Recordable<T = any> = Record<string, T>
|
||||
|
||||
// 键值对类型
|
||||
export type KeyValue<T = any> = {
|
||||
key: string
|
||||
value: T
|
||||
label?: string
|
||||
}
|
||||
|
||||
// 时间范围类型
|
||||
export interface TimeRange {
|
||||
startTime: string
|
||||
endTime: string
|
||||
}
|
||||
|
||||
// 文件类型
|
||||
export interface FileInfo {
|
||||
name: string
|
||||
url: string
|
||||
size: number
|
||||
type: string
|
||||
lastModified?: number
|
||||
}
|
||||
|
||||
// 坐标类型
|
||||
export interface Position {
|
||||
x: number
|
||||
y: number
|
||||
}
|
||||
|
||||
// 尺寸类型
|
||||
export interface Size {
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
// 响应式断点类型
|
||||
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
||||
|
||||
// 主题类型
|
||||
export type ThemeMode = 'light' | 'dark' | 'auto'
|
||||
|
||||
// 语言类型
|
||||
export type Language = 'zh-CN' | 'en-US'
|
||||
|
||||
// 环境类型
|
||||
export type Environment = 'development' | 'production' | 'test'
|
||||
|
||||
// 弹窗类型
|
||||
export type DialogType = 'add' | 'edit'
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* API 响应类型定义模块
|
||||
*
|
||||
* 提供统一的 API 响应结构类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 基础响应结构定义
|
||||
* - 泛型支持(适配不同数据类型)
|
||||
* - 统一的响应格式约束
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - API 请求响应类型约束
|
||||
* - 接口数据类型定义
|
||||
* - 响应数据解析
|
||||
*
|
||||
* @module types/common/response
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
/** 基础 API 响应结构 */
|
||||
export interface BaseResponse<T = unknown> {
|
||||
/** 状态码 */
|
||||
code: number
|
||||
/** 消息 (支持 msg 和 message 两种格式) */
|
||||
msg?: string
|
||||
message?: string
|
||||
/** 数据 */
|
||||
data: T
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
/**
|
||||
* 图表组件类型定义模块
|
||||
*
|
||||
* 提供 ECharts 图表组件的完整类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 基础图表配置类型
|
||||
* - 柱状图类型定义
|
||||
* - 折线图类型定义
|
||||
* - 饼图/环形图类型定义
|
||||
* - 雷达图类型定义
|
||||
* - K线图类型定义
|
||||
* - 散点图类型定义
|
||||
* - 地图图表类型定义
|
||||
* - 双向堆叠柱状图类型定义
|
||||
* - 图表主题配置类型
|
||||
* - 图表事件回调类型
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - 图表组件 Props 类型约束
|
||||
* - 图表配置类型定义
|
||||
* - 图表数据结构定义
|
||||
* - 图表事件处理
|
||||
*
|
||||
* @module types/component/chart
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
import type { EChartsOption } from '@/plugins/echarts'
|
||||
|
||||
// 图例位置类型
|
||||
export type LegendPosition = 'bottom' | 'top' | 'left' | 'right'
|
||||
|
||||
export type SymbolType =
|
||||
| 'circle'
|
||||
| 'rect'
|
||||
| 'roundRect'
|
||||
| 'triangle'
|
||||
| 'diamond'
|
||||
| 'pin'
|
||||
| 'arrow'
|
||||
| 'none'
|
||||
|
||||
// 图表主题配置
|
||||
export interface ChartThemeConfig {
|
||||
/** 图表高度 */
|
||||
chartHeight: string
|
||||
/** 字体大小 */
|
||||
fontSize: number
|
||||
/** 字体颜色 */
|
||||
fontColor: string
|
||||
/** 主题颜色 */
|
||||
themeColor: string
|
||||
/** 颜色组 */
|
||||
colors: string[]
|
||||
}
|
||||
|
||||
// 图表初始化选项
|
||||
export interface UseChartOptions {
|
||||
/** 初始化选项 */
|
||||
initOptions?: EChartsOption
|
||||
/** 延迟初始化时间(ms) */
|
||||
initDelay?: number
|
||||
/** IntersectionObserver阈值 */
|
||||
threshold?: number
|
||||
/** 是否自动响应主题变化 */
|
||||
autoTheme?: boolean
|
||||
}
|
||||
|
||||
// 基础图表 Props 接口 - 统一所有图表的基础属性
|
||||
export interface BaseChartProps {
|
||||
/** 图表高度 */
|
||||
height?: string
|
||||
/** 是否加载中 */
|
||||
loading?: boolean
|
||||
isEmpty?: boolean
|
||||
/** 颜色配置 */
|
||||
colors?: string[]
|
||||
}
|
||||
|
||||
// 轴线显示控制接口 - 统一轴线相关配置
|
||||
export interface AxisDisplayProps {
|
||||
/** 是否显示坐标轴标签 */
|
||||
showAxisLabel?: boolean
|
||||
/** 是否显示坐标轴线 */
|
||||
showAxisLine?: boolean
|
||||
/** 是否显示分割线 */
|
||||
showSplitLine?: boolean
|
||||
}
|
||||
|
||||
// 交互显示控制接口 - 统一交互相关配置
|
||||
export interface InteractionProps {
|
||||
/** 是否显示提示框 */
|
||||
showTooltip?: boolean
|
||||
/** 是否显示图例 */
|
||||
showLegend?: boolean
|
||||
/** 图例位置 */
|
||||
legendPosition?: LegendPosition
|
||||
}
|
||||
|
||||
// 柱状图数据项接口
|
||||
export interface BarDataItem {
|
||||
/** 系列名称 */
|
||||
name: string
|
||||
/** 数据值 */
|
||||
data: number[]
|
||||
/** 柱状图宽度 */
|
||||
barWidth?: string | number
|
||||
/** 堆叠分组名称 */
|
||||
stack?: string
|
||||
}
|
||||
|
||||
// 柱状图 Props 接口 - 统一柱状图配置
|
||||
export interface BarChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
||||
/** 图表数据 - 支持单组数据或多组数据 */
|
||||
data: number[] | BarDataItem[]
|
||||
/** X轴标签数据 */
|
||||
xAxisData?: string[]
|
||||
/** 柱状图宽度 */
|
||||
barWidth?: string | number
|
||||
/** 是否堆叠显示 */
|
||||
stack?: boolean
|
||||
/** 圆角 */
|
||||
borderRadius?: number | number[]
|
||||
}
|
||||
|
||||
// 折线图数据项接口
|
||||
export interface LineDataItem {
|
||||
/** 系列名称 */
|
||||
name: string
|
||||
/** 数据值 */
|
||||
data: number[]
|
||||
/** 线条宽度 */
|
||||
lineWidth?: number
|
||||
/** 是否显示区域填充 */
|
||||
showAreaColor?: boolean
|
||||
/** 区域样式配置 */
|
||||
areaStyle?: {
|
||||
/** 渐变开始透明度 */
|
||||
startOpacity?: number
|
||||
/** 渐变结束透明度 */
|
||||
endOpacity?: number
|
||||
/** 自定义 ECharts areaStyle 配置 */
|
||||
custom?: any
|
||||
}
|
||||
/** 是否平滑曲线 */
|
||||
smooth?: boolean
|
||||
/** 数据点符号 */
|
||||
symbol?: SymbolType
|
||||
/** 数据点大小 */
|
||||
symbolSize?: number
|
||||
}
|
||||
|
||||
// 折线图 Props 接口 - 统一折线图配置
|
||||
export interface LineChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
||||
/** 图表数据 - 支持单组数据或多组数据 */
|
||||
data: number[] | LineDataItem[]
|
||||
/** X轴标签数据 */
|
||||
xAxisData?: string[]
|
||||
/** 线条宽度 */
|
||||
lineWidth?: number
|
||||
/** 是否显示区域填充 */
|
||||
showAreaColor?: boolean
|
||||
/** 是否平滑曲线 */
|
||||
smooth?: boolean
|
||||
/** 数据点符号 */
|
||||
symbol?: SymbolType
|
||||
/** 数据点大小 */
|
||||
symbolSize?: number
|
||||
/** 多数据动画延迟间隔(毫秒) */
|
||||
animationDelay?: number
|
||||
}
|
||||
|
||||
// 雷达图数据项接口
|
||||
export interface RadarDataItem {
|
||||
/** 系列名称 */
|
||||
name: string
|
||||
/** 数据值 */
|
||||
value: number[]
|
||||
}
|
||||
|
||||
// 雷达图 Props 接口 - 统一雷达图配置
|
||||
export interface RadarChartProps extends BaseChartProps, InteractionProps {
|
||||
/** 雷达图指标配置 */
|
||||
indicator?: Array<{ name: string; max: number }>
|
||||
/** 图表数据 */
|
||||
data?: RadarDataItem[]
|
||||
}
|
||||
|
||||
// 饼图/环形图数据项接口
|
||||
export interface PieDataItem {
|
||||
/** 数据值 */
|
||||
value: number
|
||||
/** 数据名称 */
|
||||
name: string
|
||||
}
|
||||
|
||||
// 环形图 Props 接口 - 统一环形图配置
|
||||
export interface RingChartProps extends BaseChartProps, InteractionProps {
|
||||
/** 图表数据 */
|
||||
data: PieDataItem[]
|
||||
/** 内外半径 */
|
||||
radius?: string[]
|
||||
/** 边框圆角 */
|
||||
borderRadius?: number
|
||||
/** 中心文本 */
|
||||
centerText?: string
|
||||
/** 是否显示标签 */
|
||||
showLabel?: boolean
|
||||
}
|
||||
|
||||
// K线图数据项接口
|
||||
export interface KLineDataItem {
|
||||
/** 时间标签 */
|
||||
time: string
|
||||
/** 开盘价 */
|
||||
open: number
|
||||
/** 收盘价 */
|
||||
close: number
|
||||
/** 最高价 */
|
||||
high: number
|
||||
/** 最低价 */
|
||||
low: number
|
||||
}
|
||||
|
||||
// K线图 Props 接口 - 统一K线图配置
|
||||
export interface KLineChartProps extends BaseChartProps {
|
||||
/** 图表数据 */
|
||||
data?: KLineDataItem[]
|
||||
/** 是否显示数据缩放控件 */
|
||||
showDataZoom?: boolean
|
||||
/** 数据缩放初始开始位置 */
|
||||
dataZoomStart?: number
|
||||
/** 数据缩放初始结束位置 */
|
||||
dataZoomEnd?: number
|
||||
}
|
||||
|
||||
// 散点图数据项接口
|
||||
export interface ScatterDataItem {
|
||||
/** 坐标值 [x, y] */
|
||||
value: number[]
|
||||
}
|
||||
|
||||
// 散点图 Props 接口 - 统一散点图配置
|
||||
export interface ScatterChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
||||
/** 图表数据 */
|
||||
data?: ScatterDataItem[]
|
||||
/** 散点大小 */
|
||||
symbolSize?: number
|
||||
}
|
||||
|
||||
// 双柱对比图 Props 接口 - 统一双柱对比图配置
|
||||
export interface DualBarCompareChartProps extends BaseChartProps {
|
||||
/** 上方数据 */
|
||||
topData: number[]
|
||||
/** 下方数据 */
|
||||
bottomData: number[]
|
||||
/** X轴标签数据 */
|
||||
xAxisData: string[]
|
||||
/** 上方柱子颜色 */
|
||||
topColor?: string
|
||||
/** 下方柱子颜色 */
|
||||
bottomColor?: string
|
||||
/** 柱状图宽度 */
|
||||
barWidth?: number
|
||||
}
|
||||
|
||||
// 地图图表 Props 接口 - 统一地图图表配置
|
||||
export interface MapChartProps extends BaseChartProps {
|
||||
/** 地图数据 */
|
||||
mapData?: any[]
|
||||
/** 选中区域 */
|
||||
selectedRegion?: string
|
||||
/** 是否显示标签 */
|
||||
showLabels?: boolean
|
||||
/** 是否显示散点 */
|
||||
showScatter?: boolean
|
||||
}
|
||||
|
||||
// 双向堆叠柱状图 Props 接口(人口金字塔样式)
|
||||
export interface BidirectionalBarChartProps
|
||||
extends BaseChartProps,
|
||||
AxisDisplayProps,
|
||||
InteractionProps {
|
||||
/** 正向数据(向上显示) */
|
||||
positiveData: number[]
|
||||
/** 负向数据(向下显示) */
|
||||
negativeData: number[]
|
||||
/** X轴标签数据 */
|
||||
xAxisData?: string[]
|
||||
/** 正向数据名称 */
|
||||
positiveName?: string
|
||||
/** 负向数据名称 */
|
||||
negativeName?: string
|
||||
/** 柱状图宽度 */
|
||||
barWidth?: string | number
|
||||
/** Y轴最小值 */
|
||||
yAxisMin?: number
|
||||
/** Y轴最大值 */
|
||||
yAxisMax?: number
|
||||
/** 是否显示数据标签 */
|
||||
showDataLabel?: boolean
|
||||
/** 正向数据圆角配置 */
|
||||
positiveBorderRadius?: number | number[]
|
||||
/** 负向数据圆角配置 */
|
||||
negativeBorderRadius?: number | number[]
|
||||
}
|
||||
|
||||
// 图表配置生成器函数类型
|
||||
export type ChartOptionGenerator = () => EChartsOption
|
||||
|
||||
// 图表事件回调类型
|
||||
export type ChartEventCallback = (params: any) => void
|
||||
|
||||
// 图表错误信息接口
|
||||
export interface ChartError {
|
||||
/** 错误码 */
|
||||
code: string
|
||||
/** 错误信息 */
|
||||
message: string
|
||||
/** 错误详情 */
|
||||
details?: any
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* 组件类型定义模块
|
||||
*
|
||||
* 提供项目组件的类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 搜索组件类型定义
|
||||
* - 表格列配置类型
|
||||
* - 分页配置类型
|
||||
* - 表单规则类型
|
||||
* - 对话框配置类型
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - 组件 Props 类型约束
|
||||
* - 组件配置类型定义
|
||||
* - 组件事件参数类型
|
||||
*
|
||||
* @module types/component/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
// 搜索组件类型
|
||||
export type SearchComponentType =
|
||||
| 'input'
|
||||
| 'select'
|
||||
| 'radio'
|
||||
| 'checkbox'
|
||||
| 'date'
|
||||
| 'datetime'
|
||||
| 'daterange'
|
||||
| 'datetimerange'
|
||||
| 'month'
|
||||
| 'monthrange'
|
||||
| 'year'
|
||||
| 'yearrange'
|
||||
| 'week'
|
||||
| 'time'
|
||||
| 'timerange'
|
||||
|
||||
// 搜索框值变化参数
|
||||
export interface SearchChangeParams {
|
||||
prop: string
|
||||
val: unknown
|
||||
}
|
||||
|
||||
// 表格列配置接口
|
||||
export interface ColumnOption<T = any> {
|
||||
// 列类型
|
||||
type?: 'selection' | 'expand' | 'index' | 'globalIndex'
|
||||
// 列属性名
|
||||
prop?: string
|
||||
// 列标题
|
||||
label?: string
|
||||
// 列宽度
|
||||
width?: string | number
|
||||
// 最小列宽度
|
||||
minWidth?: string | number
|
||||
// 固定列
|
||||
fixed?: boolean | 'left' | 'right'
|
||||
// 是否可排序
|
||||
sortable?: boolean | 'custom'
|
||||
// 过滤器选项
|
||||
filters?: any[]
|
||||
// 过滤方法
|
||||
filterMethod?: (value: any, row: any) => boolean
|
||||
// 过滤器位置
|
||||
filterPlacement?: string
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
// 是否显示列
|
||||
visible?: boolean
|
||||
// 是否选中显示
|
||||
checked?: boolean
|
||||
// 自定义渲染函数
|
||||
formatter?: (row: T) => any
|
||||
// 插槽相关配置
|
||||
// 是否使用插槽渲染内容
|
||||
useSlot?: boolean
|
||||
// 插槽名称(默认为 prop 值)
|
||||
slotName?: string
|
||||
// 是否使用表头插槽
|
||||
useHeaderSlot?: boolean
|
||||
// 表头插槽名称(默认为 `${prop}-header`)
|
||||
headerSlotName?: string
|
||||
// 其他属性
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
// 分页配置
|
||||
export interface PaginationConfig {
|
||||
// 当前页
|
||||
currentPage: number
|
||||
// 每页条数
|
||||
pageSize: number
|
||||
// 总条数
|
||||
total: number
|
||||
// 每页显示个数选择器的选项
|
||||
pageSizes?: number[]
|
||||
// 组件布局
|
||||
layout?: string
|
||||
// 是否为小型分页
|
||||
small?: boolean
|
||||
}
|
||||
|
||||
// 表单规则
|
||||
export interface FormRule {
|
||||
// 是否必填
|
||||
required?: boolean
|
||||
// 错误提示信息
|
||||
message?: string
|
||||
// 触发方式
|
||||
trigger?: string | string[]
|
||||
// 最小长度
|
||||
min?: number
|
||||
// 最大长度
|
||||
max?: number
|
||||
// 正则表达式
|
||||
pattern?: RegExp
|
||||
// 自定义验证函数
|
||||
validator?: (rule: any, value: any, callback: any) => void
|
||||
}
|
||||
|
||||
// 对话框配置
|
||||
export interface DialogConfig {
|
||||
// 标题
|
||||
title: string
|
||||
// 是否显示
|
||||
visible: boolean
|
||||
// 宽度
|
||||
width?: string | number
|
||||
// 是否可以通过点击 modal 关闭
|
||||
closeOnClickModal?: boolean
|
||||
// 是否可以通过按下 ESC 关闭
|
||||
closeOnPressEscape?: boolean
|
||||
// 是否显示关闭按钮
|
||||
showClose?: boolean
|
||||
// 是否在 Dialog 出现时将 body 滚动锁定
|
||||
lockScroll?: boolean
|
||||
// 是否显示遮罩层
|
||||
modal?: boolean
|
||||
// 自定义类名
|
||||
customClass?: string
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* 配置类型定义模块
|
||||
*
|
||||
* 提供系统配置相关的类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 主题设置类型
|
||||
* - 菜单布局类型
|
||||
* - 节日配置类型
|
||||
* - 系统基础配置类型
|
||||
* - 快速入口配置类型
|
||||
* - 顶部栏功能配置类型
|
||||
* - 环境配置类型
|
||||
* - 应用配置类型
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - 系统配置文件类型约束
|
||||
* - 配置项类型定义
|
||||
* - 配置数据验证
|
||||
*
|
||||
* @module types/config/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { MenuTypeEnum, SystemThemeEnum } from '@/enums/appEnum'
|
||||
import { MenuThemeType, SystemThemeTypes } from '@/types/store'
|
||||
|
||||
// 主题设置
|
||||
export interface ThemeSetting {
|
||||
/** 主题名称 */
|
||||
name: string
|
||||
/** 系统主题类型 */
|
||||
theme: SystemThemeEnum
|
||||
/** 主题颜色数组 */
|
||||
color: string[]
|
||||
/** 左侧线条颜色 */
|
||||
leftLineColor: string
|
||||
/** 右侧线条颜色 */
|
||||
rightLineColor: string
|
||||
/** 主题图片 */
|
||||
img: string
|
||||
}
|
||||
|
||||
// 菜单布局
|
||||
export interface MenuLayout {
|
||||
/** 布局名称 */
|
||||
name: string
|
||||
/** 菜单类型值 */
|
||||
value: MenuTypeEnum
|
||||
/** 布局预览图 */
|
||||
img: string
|
||||
/** 布局描述 */
|
||||
description?: string
|
||||
}
|
||||
|
||||
// 节日配置
|
||||
export interface FestivalConfig {
|
||||
/** 节日日期(单日)或开始日期(日期范围) */
|
||||
date: string
|
||||
/** 节日结束日期(可选,用于跨日期节日) */
|
||||
endDate?: string
|
||||
/** 节日名称 */
|
||||
name: string
|
||||
/** 烟花图片 */
|
||||
image: string
|
||||
/** 滚动文本 */
|
||||
scrollText: string
|
||||
/** 是否激活 */
|
||||
isActive?: boolean
|
||||
/** 烟花播放次数(可选,默认为 3 次) */
|
||||
count?: number
|
||||
}
|
||||
|
||||
// 系统基础配置
|
||||
export interface SystemBasicConfig {
|
||||
// 系统名称
|
||||
name: string
|
||||
// 系统描述
|
||||
description?: string
|
||||
// 系统logo
|
||||
logo?: string
|
||||
// 系统favicon
|
||||
favicon?: string
|
||||
// 版权信息
|
||||
copyright?: string
|
||||
}
|
||||
|
||||
// 快速入口基础项
|
||||
export interface FastEnterBaseItem {
|
||||
/** 名称 */
|
||||
name: string
|
||||
/** 是否启用 */
|
||||
enabled?: boolean
|
||||
/** 排序权重 */
|
||||
order?: number
|
||||
/** 路由名称 */
|
||||
routeName?: string
|
||||
/** 外部链接 */
|
||||
link?: string
|
||||
}
|
||||
|
||||
// 快速入口应用项
|
||||
export interface FastEnterApplication extends FastEnterBaseItem {
|
||||
/** 应用描述 */
|
||||
description: string
|
||||
/** 图标代码 */
|
||||
icon: string
|
||||
/** 图标颜色 */
|
||||
iconColor: string
|
||||
}
|
||||
|
||||
// 快速链接项
|
||||
export type FastEnterQuickLink = FastEnterBaseItem
|
||||
|
||||
// 快速入口配置
|
||||
export interface FastEnterConfig {
|
||||
/** 应用列表 */
|
||||
applications: FastEnterApplication[]
|
||||
/** 快速链接 */
|
||||
quickLinks: FastEnterQuickLink[]
|
||||
/** 显示条件(屏幕宽度) */
|
||||
minWidth?: number
|
||||
}
|
||||
|
||||
// 系统配置
|
||||
export interface SystemConfig {
|
||||
// 系统基础信息
|
||||
systemInfo: SystemBasicConfig
|
||||
// 系统主题样式
|
||||
systemThemeStyles: SystemThemeTypes
|
||||
// 设置主题列表
|
||||
settingThemeList: ThemeSetting[]
|
||||
// 菜单布局列表
|
||||
menuLayoutList: MenuLayout[]
|
||||
// 主题列表
|
||||
themeList: MenuThemeType[]
|
||||
// 暗色菜单样式
|
||||
darkMenuStyles: MenuThemeType[]
|
||||
// 系统主色调
|
||||
systemMainColor: readonly string[]
|
||||
// 快速入口配置
|
||||
fastEnter?: FastEnterConfig
|
||||
// 顶部栏功能配置
|
||||
headerBar?: HeaderBarFeatureConfig
|
||||
/** 仅保留界面样式参考:跳过登录与后端菜单/用户信息请求 */
|
||||
stylePreviewOnly?: boolean
|
||||
}
|
||||
|
||||
// 环境配置
|
||||
export interface EnvConfig {
|
||||
// 环境名称
|
||||
NODE_ENV: string
|
||||
// 应用版本
|
||||
VITE_VERSION: string
|
||||
// 应用端口
|
||||
VITE_PORT: string
|
||||
// 应用基础路径
|
||||
VITE_BASE_URL: string
|
||||
// API 地址
|
||||
VITE_API_URL: string
|
||||
// 是否开启 Mock
|
||||
VITE_USE_MOCK?: string
|
||||
// 是否开启压缩
|
||||
VITE_USE_GZIP?: string
|
||||
// 是否开启 CDN
|
||||
VITE_USE_CDN?: string
|
||||
}
|
||||
|
||||
// 应用配置
|
||||
export interface AppConfig extends SystemConfig {
|
||||
// 环境配置
|
||||
env: EnvConfig
|
||||
// 开发模式
|
||||
isDev: boolean
|
||||
// 生产模式
|
||||
isProd: boolean
|
||||
// 测试模式
|
||||
isTest: boolean
|
||||
}
|
||||
|
||||
// 功能配置项基础接口
|
||||
export interface FeatureConfigItem {
|
||||
enabled: boolean
|
||||
description: string
|
||||
}
|
||||
|
||||
// 顶部栏功能配置接口
|
||||
export interface HeaderBarFeatureConfig {
|
||||
/** 菜单按钮 */
|
||||
menuButton: FeatureConfigItem
|
||||
/** 刷新按钮 */
|
||||
refreshButton: FeatureConfigItem
|
||||
/** 快速入口 */
|
||||
fastEnter: FeatureConfigItem
|
||||
/** 面包屑导航 */
|
||||
breadcrumb: FeatureConfigItem
|
||||
/** 全局搜索 */
|
||||
globalSearch: FeatureConfigItem
|
||||
/** 全屏功能 */
|
||||
fullscreen: FeatureConfigItem
|
||||
/** 通知功能 */
|
||||
notification: FeatureConfigItem
|
||||
/** 聊天功能 */
|
||||
chat: FeatureConfigItem
|
||||
/** 多语言切换 */
|
||||
language: FeatureConfigItem
|
||||
/** 设置面板 */
|
||||
settings: FeatureConfigItem
|
||||
/** 主题切换 */
|
||||
themeToggle: FeatureConfigItem
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import type {
|
||||
AuthDirective,
|
||||
RolesDirective,
|
||||
RippleDirective,
|
||||
HighlightDirective
|
||||
} from '@/directives'
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalDirectives {
|
||||
vAuth: AuthDirective
|
||||
vRoles: RolesDirective
|
||||
vRipple: RippleDirective
|
||||
vHighlight: HighlightDirective
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 类型定义统一导出模块
|
||||
* 提供全局类型定义的统一导出入口
|
||||
*
|
||||
* @module types/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
/** 通用类型定义(基础类型、工具类型等) */
|
||||
export * from './common'
|
||||
|
||||
/** 组件相关类型定义 */
|
||||
export * from './component'
|
||||
|
||||
/** 状态管理相关类型定义 */
|
||||
export * from './store'
|
||||
|
||||
/** 路由相关类型定义 */
|
||||
export * from './router'
|
||||
|
||||
/** 配置相关类型定义 */
|
||||
export * from './config'
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* 路由类型定义模块
|
||||
*
|
||||
* 提供路由相关的类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 路由元数据类型(标题、图标、权限等)
|
||||
* - 应用路由记录类型
|
||||
* - 路由配置扩展
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - 路由配置类型约束
|
||||
* - 路由元数据定义
|
||||
* - 菜单生成
|
||||
* - 权限控制
|
||||
*
|
||||
* @module types/router/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
|
||||
/**
|
||||
* 路由元数据接口
|
||||
* 定义路由的各种配置属性
|
||||
*/
|
||||
export interface RouteMeta extends Record<string | number | symbol, unknown> {
|
||||
/** 路由标题 */
|
||||
title: string
|
||||
/** 路由图标 */
|
||||
icon?: string
|
||||
/** 是否显示徽章 */
|
||||
showBadge?: boolean
|
||||
/** 文本徽章 */
|
||||
showTextBadge?: string
|
||||
/** 是否在菜单中隐藏 */
|
||||
isHide?: boolean
|
||||
/** 是否在标签页中隐藏 */
|
||||
isHideTab?: boolean
|
||||
/** 外部链接 */
|
||||
link?: string
|
||||
/** 是否为iframe */
|
||||
isIframe?: boolean
|
||||
/** 是否缓存 */
|
||||
keepAlive?: boolean
|
||||
/** 操作权限 */
|
||||
authList?: Array<{
|
||||
title: string
|
||||
authMark: string
|
||||
}>
|
||||
/** 是否为一级菜单 */
|
||||
isFirstLevel?: boolean
|
||||
/** 角色权限 */
|
||||
roles?: string[]
|
||||
/** 是否固定标签页 */
|
||||
fixedTab?: boolean
|
||||
/** 激活菜单路径 */
|
||||
activePath?: string
|
||||
/** 是否为全屏页面 */
|
||||
isFullPage?: boolean
|
||||
/** 是否为权限按钮行 */
|
||||
isAuthButton?: boolean
|
||||
/** 权限标识 */
|
||||
authMark?: string
|
||||
/** 父级路径 */
|
||||
parentPath?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用路由记录接口
|
||||
* 扩展 Vue Router 的路由记录类型
|
||||
*/
|
||||
export interface AppRouteRecord extends Record<string, any> {
|
||||
id?: number
|
||||
path?: RouteRecordRaw['path']
|
||||
name?: RouteRecordRaw['name']
|
||||
redirect?: RouteRecordRaw['redirect']
|
||||
meta: RouteMeta
|
||||
children?: AppRouteRecord[]
|
||||
component?: string | (() => Promise<any>)
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Store 状态类型定义模块
|
||||
*
|
||||
* 提供 Pinia Store 的状态类型定义
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 系统主题类型
|
||||
* - 菜单主题类型
|
||||
* - 设置状态类型
|
||||
* - 工作标签页类型
|
||||
* - 用户状态类型
|
||||
* - 菜单状态类型
|
||||
* - 根状态类型
|
||||
*
|
||||
* ## 使用场景
|
||||
*
|
||||
* - Store 状态类型约束
|
||||
* - 状态数据结构定义
|
||||
* - 类型提示和自动补全
|
||||
*
|
||||
* @module types/store/index
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { MenuThemeEnum, SystemThemeEnum } from '@/enums/appEnum'
|
||||
import { LocationQueryRaw } from 'vue-router'
|
||||
|
||||
// 系统主题样式(light | dark)
|
||||
export interface SystemThemeType {
|
||||
/** 主题类名 */
|
||||
className: string
|
||||
}
|
||||
|
||||
// 定义包含多个主题的类型
|
||||
export type SystemThemeTypes = {
|
||||
[key in Exclude<SystemThemeEnum, SystemThemeEnum.AUTO>]: SystemThemeType
|
||||
}
|
||||
|
||||
// 菜单主题样式
|
||||
export interface MenuThemeType {
|
||||
/** 主题类型 */
|
||||
theme: MenuThemeEnum
|
||||
/** 背景颜色 */
|
||||
background: string
|
||||
/** 系统名称颜色 */
|
||||
systemNameColor: string
|
||||
/** 文本颜色 */
|
||||
textColor: string
|
||||
/** 图标颜色 */
|
||||
iconColor: string
|
||||
/** 背景图片 */
|
||||
img?: string
|
||||
}
|
||||
|
||||
// 设置中心
|
||||
export interface SettingState {
|
||||
/** 主题 */
|
||||
theme: string
|
||||
/** 是否只保持一个子菜单的展开 */
|
||||
uniqueOpened: boolean
|
||||
/** 是否显示菜单按钮 */
|
||||
menuButton: boolean
|
||||
/** 是否显示刷新按钮 */
|
||||
showRefreshButton: boolean
|
||||
/** 是否显示面包屑 */
|
||||
showCrumbs: boolean
|
||||
/** 是否自动关闭 */
|
||||
autoClose: boolean
|
||||
/** 是否显示工作标签页 */
|
||||
showWorkTab: boolean
|
||||
/** 是否显示语言切换 */
|
||||
showLanguage: boolean
|
||||
/** 是否显示进度条 */
|
||||
showNprogress: boolean
|
||||
/** 主题模式 */
|
||||
themeModel: string
|
||||
}
|
||||
|
||||
// 多标签
|
||||
export interface WorkTab {
|
||||
/** 标签标题 */
|
||||
title: string
|
||||
/** 自定义标题 */
|
||||
customTitle?: string
|
||||
/** 路由路径 */
|
||||
path: string
|
||||
/** 路由名称 */
|
||||
name: string
|
||||
/** 是否缓存 */
|
||||
keepAlive: boolean
|
||||
/** 是否固定标签 */
|
||||
fixedTab?: boolean
|
||||
/** 路由参数 */
|
||||
params?: object
|
||||
/** 路由查询参数 */
|
||||
query?: LocationQueryRaw
|
||||
/** 图标 */
|
||||
icon?: string
|
||||
/** 是否激活 */
|
||||
isActive?: boolean
|
||||
}
|
||||
|
||||
// 用户Store状态
|
||||
export interface UserState {
|
||||
/** 用户信息 */
|
||||
userInfo: Api.Auth.UserInfo | null
|
||||
/** 认证令牌 */
|
||||
token: string | null
|
||||
/** 用户角色列表 */
|
||||
roles: string[]
|
||||
/** 用户权限列表 */
|
||||
permissions: string[]
|
||||
}
|
||||
|
||||
// 设置Store状态
|
||||
export interface SettingStoreState extends SettingState {
|
||||
// 额外的设置状态
|
||||
/** 菜单是否折叠 */
|
||||
collapsed: boolean
|
||||
/** 设备类型 */
|
||||
device: 'desktop' | 'mobile'
|
||||
/** 当前语言 */
|
||||
language: string
|
||||
}
|
||||
|
||||
// 工作标签页Store状态
|
||||
export interface WorkTabState {
|
||||
/** 标签页列表 */
|
||||
tabs: WorkTab[]
|
||||
/** 当前激活的标签页 */
|
||||
activeTab: string
|
||||
/** 缓存的标签页列表 */
|
||||
cachedTabs: string[]
|
||||
}
|
||||
|
||||
// 菜单Store状态
|
||||
export interface MenuState {
|
||||
/** 菜单列表 */
|
||||
menuList: any[]
|
||||
/** 菜单是否已加载 */
|
||||
isLoaded: boolean
|
||||
/** 菜单是否折叠 */
|
||||
collapsed: boolean
|
||||
}
|
||||
|
||||
// 根Store状态类型
|
||||
export interface RootState {
|
||||
/** 用户状态 */
|
||||
user: UserState
|
||||
/** 设置状态 */
|
||||
setting: SettingStoreState
|
||||
/** 工作标签页状态 */
|
||||
workTab: WorkTabState
|
||||
/** 菜单状态 */
|
||||
menu: MenuState
|
||||
}
|
||||
Reference in new issue
Block a user