Initial commit: One Pipe System
完整的管理系统,包含账户管理、卡片管理、套餐管理、财务管理等功能模块。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
166
src/types/api/account.ts
Normal file
166
src/types/api/account.ts
Normal file
@@ -0,0 +1,166 @@
|
||||
/**
|
||||
* 账号相关类型定义
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
import { UserRole } from './auth'
|
||||
|
||||
// 账号状态
|
||||
export enum AccountStatus {
|
||||
ENABLED = 1, // 启用
|
||||
DISABLED = 0 // 禁用
|
||||
}
|
||||
|
||||
// 账号实体(统一账号模型,匹配后端 ModelAccountResponse)
|
||||
export interface PlatformAccount {
|
||||
ID: number
|
||||
CreatedAt?: string
|
||||
UpdatedAt?: string
|
||||
DeletedAt?: string | null
|
||||
creator: number // 创建人ID
|
||||
updater: number // 更新人ID
|
||||
username: string
|
||||
phone: string
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
enterprise_id?: number | null // 关联企业ID
|
||||
shop_id?: number | null // 关联店铺ID
|
||||
status: AccountStatus // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 代理商实体
|
||||
export interface Agent {
|
||||
id: string | number
|
||||
agentCode: string // 代理商编码
|
||||
agentName: string // 代理商名称
|
||||
contactPerson: string // 联系人
|
||||
contactPhone: string // 联系电话
|
||||
email?: string
|
||||
// 层级关系
|
||||
parentId?: string | number // 上级代理商ID
|
||||
parentName?: string // 上级代理商名称
|
||||
level: number // 代理商层级(1为一级代理)
|
||||
// 角色和权限
|
||||
customerRoleId: string | number // 客户角色ID
|
||||
customerRoleName?: string
|
||||
// 状态信息
|
||||
status: AccountStatus
|
||||
// 账号信息
|
||||
username: string // 登录账号
|
||||
// 业务数据
|
||||
cardCount?: number // 网卡数量
|
||||
deviceCount?: number // 设备数量
|
||||
subAgentCount?: number // 下级代理数量
|
||||
// 时间信息
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 企业客户实体
|
||||
export interface EnterpriseCustomer {
|
||||
id: string | number
|
||||
enterpriseCode: string // 企业编码
|
||||
enterpriseName: string // 企业名称
|
||||
contactPerson: string // 联系人
|
||||
contactPhone: string // 联系电话
|
||||
email?: string
|
||||
address?: string
|
||||
// 角色和权限
|
||||
customerRoleId: string | number // 客户角色ID
|
||||
customerRoleName?: string
|
||||
// 状态信息
|
||||
status: AccountStatus
|
||||
// 账号信息
|
||||
username: string // 登录账号
|
||||
// 业务数据
|
||||
cardCount?: number // 网卡数量
|
||||
deviceCount?: number // 设备数量
|
||||
// 时间信息
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 客户账号(代理商+企业客户统一视图)
|
||||
export interface CustomerAccount {
|
||||
id: string | number
|
||||
accountType: 'agent' | 'enterprise' // 账号类型
|
||||
accountCode: string // 账号编码
|
||||
accountName: string // 账号名称
|
||||
username: string
|
||||
phone?: string
|
||||
email?: string
|
||||
customerRoleName?: string
|
||||
status: AccountStatus
|
||||
lastLoginTime?: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 账号查询参数
|
||||
export interface AccountQueryParams extends PaginationParams {
|
||||
keyword?: string // 关键词(用户名、姓名、手机号)
|
||||
roleId?: string | number
|
||||
status?: AccountStatus
|
||||
createTimeRange?: [string, string]
|
||||
}
|
||||
|
||||
// 代理商查询参数
|
||||
export interface AgentQueryParams extends PaginationParams {
|
||||
keyword?: string
|
||||
parentId?: string | number
|
||||
level?: number
|
||||
customerRoleId?: string | number
|
||||
status?: AccountStatus
|
||||
}
|
||||
|
||||
// 企业客户查询参数
|
||||
export interface EnterpriseQueryParams extends PaginationParams {
|
||||
keyword?: string
|
||||
customerRoleId?: string | number
|
||||
status?: AccountStatus
|
||||
}
|
||||
|
||||
// 创建账号参数(匹配后端 ModelCreateAccountRequest)
|
||||
export interface CreatePlatformAccountParams {
|
||||
username: string // 用户名 (3-50字符)
|
||||
password: string // 密码 (8-32字符)
|
||||
phone: string // 手机号 (11位)
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
enterprise_id?: number | null // 关联企业ID(企业账号必填)
|
||||
shop_id?: number | null // 关联店铺ID(代理账号必填)
|
||||
}
|
||||
|
||||
// 创建代理商参数
|
||||
export interface CreateAgentParams {
|
||||
agentCode: string
|
||||
agentName: string
|
||||
contactPerson: string
|
||||
contactPhone: string
|
||||
email?: string
|
||||
parentId?: string | number
|
||||
customerRoleId: string | number
|
||||
username: string
|
||||
password: string
|
||||
status: AccountStatus
|
||||
}
|
||||
|
||||
// 创建企业客户参数
|
||||
export interface CreateEnterpriseParams {
|
||||
enterpriseCode: string
|
||||
enterpriseName: string
|
||||
contactPerson: string
|
||||
contactPhone: string
|
||||
email?: string
|
||||
address?: string
|
||||
customerRoleId: string | number
|
||||
username: string
|
||||
password: string
|
||||
status: AccountStatus
|
||||
}
|
||||
|
||||
// 账号操作参数
|
||||
export interface AccountOperationParams {
|
||||
id: string | number
|
||||
operation: 'resetPassword' | 'unbindPhone' | 'enable' | 'disable' | 'lock'
|
||||
newPassword?: string // 重置密码时需要
|
||||
}
|
||||
65
src/types/api/auth.ts
Normal file
65
src/types/api/auth.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 认证相关类型定义
|
||||
*/
|
||||
|
||||
// 用户角色类型
|
||||
export enum UserRole {
|
||||
SUPER_ADMIN = 'R_SUPER', // 超级管理员
|
||||
ADMIN = 'R_ADMIN', // 管理员
|
||||
AGENT = 'R_AGENT', // 代理商
|
||||
ENTERPRISE = 'R_ENTERPRISE' // 企业客户
|
||||
}
|
||||
|
||||
// 登录请求参数
|
||||
export interface LoginParams {
|
||||
username: string
|
||||
password: string
|
||||
device?: string
|
||||
}
|
||||
|
||||
// 登录响应数据
|
||||
export interface LoginData {
|
||||
access_token: string
|
||||
refresh_token: string
|
||||
expires_in: number
|
||||
permissions?: string[] | null
|
||||
user: UserInfo
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export interface UserInfo {
|
||||
id: number // 用户ID
|
||||
username: string // 用户名
|
||||
phone: string // 手机号
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
user_type_name: string // 用户类型名称
|
||||
enterprise_id?: number // 企业ID(可选)
|
||||
enterprise_name?: string // 企业名称(可选)
|
||||
shop_id?: number // 店铺ID(可选)
|
||||
shop_name?: string // 店铺名称(可选)
|
||||
}
|
||||
|
||||
// 获取用户信息响应数据 (GET /api/admin/me)
|
||||
export interface UserInfoResponse {
|
||||
user: UserInfo
|
||||
permissions: string[]
|
||||
}
|
||||
|
||||
// 刷新 Token 参数
|
||||
export interface RefreshTokenParams {
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
// 刷新 Token 响应数据
|
||||
export interface RefreshTokenData {
|
||||
access_token: string
|
||||
refresh_token: string
|
||||
expires_in: number
|
||||
}
|
||||
|
||||
// 修改密码参数
|
||||
export interface ChangePasswordParams {
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
confirmPassword: string
|
||||
}
|
||||
229
src/types/api/card.ts
Normal file
229
src/types/api/card.ts
Normal file
@@ -0,0 +1,229 @@
|
||||
/**
|
||||
* 网卡相关类型定义
|
||||
*/
|
||||
|
||||
import { PaginationParams, ImportTask } from './common'
|
||||
|
||||
// 运营商类型
|
||||
export enum Operator {
|
||||
CHINA_MOBILE = 'mobile', // 中国移动
|
||||
CHINA_UNICOM = 'unicom', // 中国联通
|
||||
CHINA_TELECOM = 'telecom', // 中国电信
|
||||
GS_MOBILE = 'gs_mobile', // GS移动
|
||||
GS_UNICOM = 'gs_unicom', // GS联通
|
||||
GS_TELECOM = 'gs_telecom', // GS电信
|
||||
DC_IOT = 'dc_iot', // DC物联
|
||||
GDWL = 'gdwl' // GDWL
|
||||
}
|
||||
|
||||
// 网卡状态
|
||||
export enum CardStatus {
|
||||
ACTIVATED = 1, // 激活
|
||||
DEACTIVATED = 2, // 停用
|
||||
TESTING = 3, // 测试
|
||||
INVENTORY = 4, // 库存
|
||||
SUSPENDED = 5, // 停机
|
||||
EXPIRED = 6 // 已过期
|
||||
}
|
||||
|
||||
// 网络类型
|
||||
export enum NetworkType {
|
||||
'2G' = '2G',
|
||||
'3G' = '3G',
|
||||
'4G' = '4G',
|
||||
'5G' = '5G',
|
||||
NB_IOT = 'NB-IoT'
|
||||
}
|
||||
|
||||
// 卡类型
|
||||
export enum CardType {
|
||||
MONTHLY = 'monthly', // 月卡
|
||||
ANNUAL = 'annual', // 年卡
|
||||
FLOW = 'flow' // 流量卡
|
||||
}
|
||||
|
||||
// 号卡商品实体
|
||||
export interface SimCardProduct {
|
||||
id: string | number
|
||||
productCode: string // 商品编码
|
||||
productName: string // 商品名称
|
||||
operator: Operator // 运营商
|
||||
networkType: NetworkType // 网络类型
|
||||
cardType: CardType // 卡类型
|
||||
description?: string
|
||||
price?: number // 价格
|
||||
status: 1 | 0 // 上架/下架
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 网卡实体
|
||||
export interface Card {
|
||||
id: string | number
|
||||
iccid: string // ICCID
|
||||
imsi?: string // IMSI
|
||||
msisdn?: string // 手机号码
|
||||
operator: Operator // 运营商
|
||||
networkType: NetworkType
|
||||
cardType: CardType
|
||||
status: CardStatus
|
||||
// 关联信息
|
||||
productId?: string | number // 关联商品ID
|
||||
productName?: string
|
||||
packageId?: string | number // 当前套餐ID
|
||||
packageName?: string
|
||||
agentId?: string | number // 所属代理商ID
|
||||
agentName?: string
|
||||
deviceId?: string | number // 绑定设备ID
|
||||
deviceCode?: string
|
||||
// 业务信息
|
||||
totalFlow?: number // 总流量(MB)
|
||||
usedFlow?: number // 已用流量(MB)
|
||||
remainFlow?: number // 剩余流量(MB)
|
||||
expireTime?: string // 过期时间
|
||||
activateTime?: string // 激活时间
|
||||
walletBalance?: number // 钱包余额
|
||||
// 导入信息
|
||||
importBatch?: string // 导入批次
|
||||
importTime?: string
|
||||
// 公司信息
|
||||
cardCompanyId?: string | number
|
||||
cardCompanyName?: string
|
||||
// 时间信息
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 网卡查询参数
|
||||
export interface CardQueryParams extends PaginationParams {
|
||||
keyword?: string // ICCID/IMSI/手机号
|
||||
operator?: Operator
|
||||
status?: CardStatus
|
||||
agentId?: string | number
|
||||
packageId?: string | number
|
||||
cardCompanyId?: string | number
|
||||
importBatch?: string
|
||||
expireTimeRange?: [string, string]
|
||||
importTimeRange?: [string, string]
|
||||
}
|
||||
|
||||
// 网卡导入批次信息
|
||||
export interface CardImportBatch extends ImportTask {
|
||||
importBatch: string // 导入批次号
|
||||
agentId?: string | number
|
||||
agentName?: string
|
||||
packageId?: string | number
|
||||
packageName?: string
|
||||
cardCompanyId?: string | number
|
||||
cardCompanyName?: string
|
||||
operator: Operator
|
||||
cardType: CardType
|
||||
operatorUser?: string // 操作人
|
||||
}
|
||||
|
||||
// 网卡操作类型
|
||||
export enum CardOperationType {
|
||||
RECHARGE = 'recharge', // 套餐充值
|
||||
SUSPEND = 'suspend', // 停机
|
||||
RESUME = 'resume', // 复机
|
||||
CHANGE_EXPIRE_TIME = 'changeExpireTime', // 更改过期时间
|
||||
TRANSFER = 'transfer', // 转卡
|
||||
ADD_FLOW = 'addFlow', // 增加流量
|
||||
REDUCE_FLOW = 'reduceFlow', // 减少流量
|
||||
CHANGE_WALLET = 'changeWallet', // 变更钱包余额
|
||||
RESET_PASSWORD = 'resetPassword', // 充值支付密码
|
||||
RENEW = 'renew' // 续充
|
||||
}
|
||||
|
||||
// 网卡操作参数
|
||||
export interface CardOperationParams {
|
||||
iccid: string
|
||||
operation: CardOperationType
|
||||
// 不同操作需要的参数
|
||||
packageId?: string | number // 套餐充值
|
||||
expireTime?: string // 更改过期时间
|
||||
targetIccid?: string // 转卡目标ICCID
|
||||
flow?: number // 增减流量
|
||||
amount?: number // 金额
|
||||
password?: string // 密码
|
||||
remark?: string // 备注
|
||||
}
|
||||
|
||||
// 号卡分配参数
|
||||
export interface CardAssignParams {
|
||||
productId: string | number
|
||||
agentId: string | number
|
||||
commissionMode: 'template' | 'custom' // 佣金模式:模板/自定义
|
||||
commissionTemplateId?: string | number // 佣金模板ID
|
||||
commissionRate?: number // 自定义佣金比例
|
||||
quantity: number // 分配数量
|
||||
}
|
||||
|
||||
// 网卡批量充值记录
|
||||
export interface BatchRechargeRecord {
|
||||
id: string | number
|
||||
batchNo: string // 批次号
|
||||
fileName: string // 文件名
|
||||
totalCount: number
|
||||
successCount: number
|
||||
failCount: number
|
||||
totalAmount?: number // 总金额
|
||||
status: 'pending' | 'processing' | 'completed' | 'failed'
|
||||
createTime: string
|
||||
operatorName?: string
|
||||
}
|
||||
|
||||
// 换卡申请
|
||||
export interface CardChangeApplication {
|
||||
id: string | number
|
||||
applicationNo: string // 申请单号
|
||||
oldIccid: string // 旧ICCID
|
||||
newIccid?: string // 新ICCID
|
||||
reason: string // 换卡原因
|
||||
status: 'pending' | 'approved' | 'rejected' | 'completed'
|
||||
applicantId: string | number
|
||||
applicantName: string
|
||||
applicantType: 'agent' | 'enterprise'
|
||||
applyTime: string
|
||||
processTime?: string
|
||||
processorName?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 处理换卡申请参数
|
||||
export interface ProcessCardChangeParams {
|
||||
id: string | number
|
||||
status: 'approved' | 'rejected'
|
||||
newIccid?: string // 通过时填写
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 流量详情
|
||||
export interface FlowDetail {
|
||||
date: string
|
||||
usedFlow: number // MB
|
||||
description?: string
|
||||
}
|
||||
|
||||
// 停复机记录
|
||||
export interface SuspendResumeRecord {
|
||||
id: string | number
|
||||
iccid: string
|
||||
operation: 'suspend' | 'resume'
|
||||
operatorName: string
|
||||
operateTime: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 网卡历史订单
|
||||
export interface CardOrder {
|
||||
id: string | number
|
||||
orderNo: string
|
||||
iccid: string
|
||||
orderType: 'recharge' | 'renew' | 'transfer'
|
||||
packageName?: string
|
||||
amount: number
|
||||
status: 'pending' | 'success' | 'failed'
|
||||
createTime: string
|
||||
payTime?: string
|
||||
}
|
||||
236
src/types/api/commission.ts
Normal file
236
src/types/api/commission.ts
Normal file
@@ -0,0 +1,236 @@
|
||||
/**
|
||||
* 佣金相关类型定义
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 佣金状态
|
||||
export enum CommissionStatus {
|
||||
PENDING = 'pending', // 待结算
|
||||
SETTLED = 'settled', // 已结算
|
||||
WITHDRAWN = 'withdrawn', // 已提现
|
||||
FROZEN = 'frozen' // 冻结
|
||||
}
|
||||
|
||||
// 提现状态
|
||||
export enum WithdrawalStatus {
|
||||
PENDING = 'pending', // 待审核
|
||||
APPROVED = 'approved', // 已通过
|
||||
REJECTED = 'rejected', // 已拒绝
|
||||
PROCESSING = 'processing', // 处理中
|
||||
COMPLETED = 'completed', // 已完成
|
||||
FAILED = 'failed' // 失败
|
||||
}
|
||||
|
||||
// 佣金类型
|
||||
export enum CommissionType {
|
||||
CARD_SALE = 'cardSale', // 号卡销售佣金
|
||||
PACKAGE_SALE = 'packageSale', // 套餐销售佣金
|
||||
RECHARGE = 'recharge', // 充值佣金
|
||||
RENEWAL = 'renewal' // 续费佣金
|
||||
}
|
||||
|
||||
// 分佣模板
|
||||
export interface CommissionTemplate {
|
||||
id: string | number
|
||||
templateCode: string // 模板编码
|
||||
templateName: string // 模板名称
|
||||
description?: string
|
||||
// 分佣规则
|
||||
rules: CommissionRule[]
|
||||
status: 1 | 0 // 启用/禁用
|
||||
isDefault: boolean // 是否默认模板
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 分佣规则
|
||||
export interface CommissionRule {
|
||||
id?: string | number
|
||||
type: CommissionType // 佣金类型
|
||||
rateType: 'fixed' | 'percentage' // 固定金额/百分比
|
||||
value: number // 金额或百分比值
|
||||
minAmount?: number // 最小触发金额
|
||||
maxAmount?: number // 最大触发金额
|
||||
description?: string
|
||||
}
|
||||
|
||||
// 佣金记录
|
||||
export interface CommissionRecord {
|
||||
id: string | number
|
||||
recordNo: string // 记录编号
|
||||
// 关联信息
|
||||
accountId: string | number
|
||||
accountName: string
|
||||
accountType: 'agent' | 'enterprise'
|
||||
// 佣金信息
|
||||
type: CommissionType
|
||||
amount: number // 佣金金额
|
||||
sourceAmount: number // 源交易金额
|
||||
rate: number // 佣金比例
|
||||
status: CommissionStatus
|
||||
// 来源信息
|
||||
sourceType: 'card' | 'package' | 'recharge' // 来源类型
|
||||
sourceId: string | number // 来源ID
|
||||
sourceName?: string
|
||||
orderId?: string | number // 关联订单ID
|
||||
orderNo?: string
|
||||
// 结算信息
|
||||
settleTime?: string // 结算时间
|
||||
withdrawTime?: string // 提现时间
|
||||
withdrawId?: string | number // 提现申请ID
|
||||
// 时间信息
|
||||
createTime: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 提现申请
|
||||
export interface WithdrawalApplication {
|
||||
id: string | number
|
||||
applicationNo: string // 申请单号
|
||||
// 申请人信息
|
||||
applicantId: string | number
|
||||
applicantName: string
|
||||
applicantType: 'agent' | 'enterprise'
|
||||
// 提现信息
|
||||
amount: number // 提现金额
|
||||
fee?: number // 手续费
|
||||
actualAmount?: number // 实际到账金额
|
||||
status: WithdrawalStatus
|
||||
// 收款信息
|
||||
bankName?: string // 银行名称
|
||||
bankAccount?: string // 银行账号
|
||||
accountName?: string // 账户名
|
||||
alipayAccount?: string // 支付宝账号
|
||||
wechatAccount?: string // 微信账号
|
||||
paymentMethod: 'bank' | 'alipay' | 'wechat' // 支付方式
|
||||
// 审核信息
|
||||
applyTime: string
|
||||
processTime?: string // 处理时间
|
||||
processorId?: string | number
|
||||
processorName?: string
|
||||
rejectReason?: string // 拒绝原因
|
||||
// 完成信息
|
||||
completeTime?: string
|
||||
transactionNo?: string // 交易流水号
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 客户账户(佣金视图)
|
||||
export interface CustomerCommissionAccount {
|
||||
id: string | number
|
||||
accountId: string | number
|
||||
accountName: string
|
||||
accountType: 'agent' | 'enterprise'
|
||||
// 佣金统计
|
||||
totalCommission: number // 总佣金
|
||||
settledCommission: number // 已结算佣金
|
||||
withdrawnCommission: number // 已提现佣金
|
||||
pendingCommission: number // 待结算佣金
|
||||
frozenCommission: number // 冻结佣金
|
||||
availableCommission: number // 可提现佣金
|
||||
// 提现统计
|
||||
totalWithdrawal: number // 累计提现
|
||||
withdrawalCount: number // 提现次数
|
||||
lastWithdrawalTime?: string // 最后提现时间
|
||||
// 时间信息
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 我的账户(当前登录账号的佣金数据)
|
||||
export interface MyCommissionAccount {
|
||||
// 佣金概览
|
||||
totalCommission: number
|
||||
settledCommission: number
|
||||
withdrawnCommission: number
|
||||
pendingCommission: number
|
||||
availableCommission: number
|
||||
frozenCommission: number
|
||||
// 本月数据
|
||||
monthCommission: number // 本月佣金
|
||||
monthSettled: number // 本月已结算
|
||||
// 今日数据
|
||||
todayCommission: number
|
||||
// 提现信息
|
||||
totalWithdrawal: number
|
||||
withdrawalCount: number
|
||||
pendingWithdrawal: number // 待审核提现
|
||||
// 图表数据(近7天/30天)
|
||||
chartData?: {
|
||||
dates: string[]
|
||||
commissions: number[]
|
||||
}
|
||||
}
|
||||
|
||||
// 佣金提现设置
|
||||
export interface WithdrawalSetting {
|
||||
id: string | number
|
||||
// 提现规则
|
||||
minAmount: number // 最小提现金额
|
||||
maxAmount?: number // 最大提现金额
|
||||
dailyLimit?: number // 每日提现次数限制
|
||||
fee: number // 手续费
|
||||
feeType: 'fixed' | 'percentage' // 固定金额/百分比
|
||||
// 审核设置
|
||||
autoApprove: boolean // 是否自动审核
|
||||
autoApproveAmount?: number // 自动审核金额阈值
|
||||
// 到账时间
|
||||
arrivalDays: number // 预计到账天数
|
||||
// 生效时间
|
||||
effectiveTime: string
|
||||
createTime: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 佣金查询参数
|
||||
export interface CommissionQueryParams extends PaginationParams {
|
||||
accountId?: string | number
|
||||
accountType?: 'agent' | 'enterprise'
|
||||
type?: CommissionType
|
||||
status?: CommissionStatus
|
||||
amountRange?: [number, number]
|
||||
createTimeRange?: [string, string]
|
||||
settleTimeRange?: [string, string]
|
||||
}
|
||||
|
||||
// 提现查询参数
|
||||
export interface WithdrawalQueryParams extends PaginationParams {
|
||||
applicationNo?: string
|
||||
applicantId?: string | number
|
||||
applicantName?: string
|
||||
status?: WithdrawalStatus
|
||||
paymentMethod?: 'bank' | 'alipay' | 'wechat'
|
||||
amountRange?: [number, number]
|
||||
applyTimeRange?: [string, string]
|
||||
}
|
||||
|
||||
// 创建分佣模板参数
|
||||
export interface CreateCommissionTemplateParams {
|
||||
templateCode: string
|
||||
templateName: string
|
||||
description?: string
|
||||
rules: CommissionRule[]
|
||||
isDefault: boolean
|
||||
}
|
||||
|
||||
// 申请提现参数
|
||||
export interface ApplyWithdrawalParams {
|
||||
amount: number
|
||||
paymentMethod: 'bank' | 'alipay' | 'wechat'
|
||||
bankName?: string
|
||||
bankAccount?: string
|
||||
accountName?: string
|
||||
alipayAccount?: string
|
||||
wechatAccount?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 审核提现参数
|
||||
export interface ProcessWithdrawalParams {
|
||||
id: string | number
|
||||
status: 'approved' | 'rejected'
|
||||
rejectReason?: string
|
||||
remark?: string
|
||||
}
|
||||
75
src/types/api/common.ts
Normal file
75
src/types/api/common.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* API 通用类型定义
|
||||
*/
|
||||
|
||||
// 基础响应类型
|
||||
export interface BaseResponse<T = any> {
|
||||
code: number
|
||||
msg: string
|
||||
data: T
|
||||
timestamp?: string
|
||||
}
|
||||
|
||||
// 分页请求参数
|
||||
export interface PaginationParams {
|
||||
current?: number
|
||||
size?: number
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
// 分页响应数据
|
||||
export interface PaginationData<T> {
|
||||
items: T[] // 后端实际返回的是 items,不是 records
|
||||
total: number
|
||||
size: number
|
||||
page: number // 后端返回的是 page,不是 current
|
||||
pages?: number
|
||||
}
|
||||
|
||||
// 分页响应
|
||||
export interface PaginationResponse<T = any> extends BaseResponse {
|
||||
data: PaginationData<T>
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
export interface ListResponse<T = any> extends BaseResponse {
|
||||
data: T[]
|
||||
}
|
||||
|
||||
// 日期范围参数
|
||||
export type DateRange = [string, string] | string[]
|
||||
|
||||
// 排序参数
|
||||
export interface SortParams {
|
||||
field?: string
|
||||
order?: 'asc' | 'desc' | 'ascending' | 'descending'
|
||||
}
|
||||
|
||||
// 批量操作参数
|
||||
export interface BatchOperationParams<T = any> {
|
||||
ids: (string | number)[]
|
||||
data?: T
|
||||
}
|
||||
|
||||
// 导入任务状态
|
||||
export enum ImportTaskStatus {
|
||||
PENDING = 'pending',
|
||||
PROCESSING = 'processing',
|
||||
SUCCESS = 'success',
|
||||
FAILED = 'failed',
|
||||
PARTIAL_SUCCESS = 'partial_success'
|
||||
}
|
||||
|
||||
// 导入任务信息
|
||||
export interface ImportTask {
|
||||
id: string | number
|
||||
fileName: string
|
||||
status: ImportTaskStatus
|
||||
totalCount: number
|
||||
successCount: number
|
||||
failCount: number
|
||||
createdTime: string
|
||||
completedTime?: string
|
||||
errorMessage?: string
|
||||
}
|
||||
143
src/types/api/device.ts
Normal file
143
src/types/api/device.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
/**
|
||||
* 设备相关类型定义
|
||||
*/
|
||||
|
||||
import { PaginationParams, ImportTask } from './common'
|
||||
|
||||
// 设备状态
|
||||
export enum DeviceStatus {
|
||||
ONLINE = 'online', // 在线
|
||||
OFFLINE = 'offline', // 离线
|
||||
FAULT = 'fault', // 故障
|
||||
MAINTENANCE = 'maintenance' // 维护中
|
||||
}
|
||||
|
||||
// 设备操作类型
|
||||
export enum DeviceOperationType {
|
||||
RESTART = 'restart', // 重启
|
||||
RESET = 'reset', // 重置
|
||||
UPGRADE = 'upgrade', // 升级
|
||||
CONFIG = 'config', // 配置
|
||||
BIND_CARD = 'bindCard', // 绑定网卡
|
||||
UNBIND_CARD = 'unbindCard' // 解绑网卡
|
||||
}
|
||||
|
||||
// 设备实体
|
||||
export interface Device {
|
||||
id: string | number
|
||||
deviceCode: string // 设备编码
|
||||
deviceName?: string // 设备名称
|
||||
deviceType?: string // 设备类型
|
||||
model?: string // 设备型号
|
||||
manufacturer?: string // 制造商
|
||||
// 网卡信息
|
||||
currentIccid?: string // 当前绑定的ICCID
|
||||
currentOperator?: string // 当前运营商
|
||||
currentImei?: string // IMEI
|
||||
// 卡槽信息(双卡设备)
|
||||
card1Iccid?: string
|
||||
card1Operator?: string
|
||||
card2Iccid?: string
|
||||
card2Operator?: string
|
||||
// 状态信息
|
||||
status: DeviceStatus
|
||||
onlineStatus: boolean // 在线状态
|
||||
lastOnlineTime?: string // 最后在线时间
|
||||
// 所属信息
|
||||
agentId?: string | number
|
||||
agentName?: string
|
||||
// 位置信息
|
||||
location?: string
|
||||
latitude?: number
|
||||
longitude?: number
|
||||
// 其他信息
|
||||
firmwareVersion?: string // 固件版本
|
||||
hardwareVersion?: string // 硬件版本
|
||||
activateTime?: string // 激活时间
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 设备查询参数
|
||||
export interface DeviceQueryParams extends PaginationParams {
|
||||
keyword?: string // 设备编码/名称/ICCID
|
||||
deviceType?: string
|
||||
status?: DeviceStatus
|
||||
onlineStatus?: boolean
|
||||
agentId?: string | number
|
||||
hasCard?: boolean // 是否绑定网卡
|
||||
operator?: string
|
||||
}
|
||||
|
||||
// 设备操作参数
|
||||
export interface DeviceOperationParams {
|
||||
deviceId: string | number
|
||||
operation: DeviceOperationType
|
||||
iccid?: string // 绑定/解绑网卡时需要
|
||||
config?: Record<string, any> // 配置参数
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 设备卡信息
|
||||
export interface DeviceCardInfo {
|
||||
deviceId: string | number
|
||||
deviceCode: string
|
||||
// 主卡信息
|
||||
mainCard?: {
|
||||
iccid: string
|
||||
operator: string
|
||||
imei?: string
|
||||
status: string
|
||||
signal?: number // 信号强度
|
||||
flow?: {
|
||||
total: number
|
||||
used: number
|
||||
remain: number
|
||||
}
|
||||
}
|
||||
// 副卡信息(双卡设备)
|
||||
viceCard?: {
|
||||
iccid: string
|
||||
operator: string
|
||||
imei?: string
|
||||
status: string
|
||||
signal?: number
|
||||
flow?: {
|
||||
total: number
|
||||
used: number
|
||||
remain: number
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 修改设备卡信息参数
|
||||
export interface UpdateDeviceCardParams {
|
||||
deviceId: string | number
|
||||
mainCardIccid?: string
|
||||
viceCardIccid?: string
|
||||
}
|
||||
|
||||
// 设备批量分配参数
|
||||
export interface DeviceBatchAssignParams {
|
||||
deviceIds: (string | number)[]
|
||||
targetAgentId: string | number
|
||||
includeCards: boolean // 是否连同网卡一起分配
|
||||
}
|
||||
|
||||
// 设备导入任务
|
||||
export interface DeviceImportTask extends ImportTask {
|
||||
agentId?: string | number
|
||||
agentName?: string
|
||||
operatorName?: string
|
||||
}
|
||||
|
||||
// 设备导入数据项
|
||||
export interface DeviceImportItem {
|
||||
deviceCode: string
|
||||
deviceName?: string
|
||||
deviceType?: string
|
||||
iccid?: string // 绑定的ICCID
|
||||
card1Iccid?: string
|
||||
card2Iccid?: string
|
||||
location?: string
|
||||
}
|
||||
42
src/types/api/index.ts
Normal file
42
src/types/api/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* API 类型统一导出
|
||||
*/
|
||||
|
||||
// 通用类型
|
||||
export * from './common'
|
||||
|
||||
// 认证相关
|
||||
export * from './auth'
|
||||
|
||||
// 角色相关
|
||||
export * from './role'
|
||||
|
||||
// 权限相关
|
||||
export * from './permission'
|
||||
|
||||
// 账号相关
|
||||
export * from './account'
|
||||
|
||||
// 平台账号相关
|
||||
export * from './platformAccount'
|
||||
|
||||
// 代理账号相关
|
||||
export * from './shopAccount'
|
||||
|
||||
// 店铺相关
|
||||
export * from './shop'
|
||||
|
||||
// 网卡相关
|
||||
export * from './card'
|
||||
|
||||
// 套餐相关
|
||||
export * from './package'
|
||||
|
||||
// 设备相关
|
||||
export * from './device'
|
||||
|
||||
// 佣金相关
|
||||
export * from './commission'
|
||||
|
||||
// 设置相关
|
||||
export * from './setting'
|
||||
142
src/types/api/package.ts
Normal file
142
src/types/api/package.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* 套餐相关类型定义
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
import { Operator } from './card'
|
||||
|
||||
// 套餐状态
|
||||
export enum PackageStatus {
|
||||
ENABLED = 1, // 启用
|
||||
DISABLED = 0 // 禁用
|
||||
}
|
||||
|
||||
// 套餐类型
|
||||
export enum PackageType {
|
||||
MONTHLY = 'monthly', // 月套餐
|
||||
ANNUAL = 'annual', // 年套餐
|
||||
FLOW = 'flow' // 流量包
|
||||
}
|
||||
|
||||
// 套餐系列
|
||||
export interface PackageSeries {
|
||||
id: string | number
|
||||
seriesCode: string // 系列编码
|
||||
seriesName: string // 系列名称
|
||||
operator: Operator // 运营商
|
||||
description?: string
|
||||
status: PackageStatus
|
||||
packageCount?: number // 系列下套餐数量
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 套餐实体
|
||||
export interface Package {
|
||||
id: string | number
|
||||
packageCode: string // 套餐编码
|
||||
packageName: string // 套餐名称
|
||||
seriesId: string | number // 所属系列ID
|
||||
seriesName?: string
|
||||
operator: Operator
|
||||
packageType: PackageType
|
||||
// 套餐内容
|
||||
totalFlow: number // 总流量(MB)
|
||||
duration: number // 有效期(天)
|
||||
price: number // 价格
|
||||
description?: string
|
||||
// 状态和可见性
|
||||
status: PackageStatus
|
||||
isPublic: boolean // 是否公开(管理员可见全部,代理商只能看到自己的)
|
||||
// 创建信息
|
||||
creatorId: string | number
|
||||
creatorName?: string
|
||||
creatorType: 'admin' | 'agent' // 创建者类型
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 套餐查询参数
|
||||
export interface PackageQueryParams extends PaginationParams {
|
||||
keyword?: string // 套餐名称/编码
|
||||
seriesId?: string | number
|
||||
operator?: Operator
|
||||
packageType?: PackageType
|
||||
status?: PackageStatus
|
||||
isPublic?: boolean
|
||||
creatorId?: string | number
|
||||
priceRange?: [number, number]
|
||||
}
|
||||
|
||||
// 套餐系列查询参数
|
||||
export interface PackageSeriesQueryParams extends PaginationParams {
|
||||
keyword?: string
|
||||
operator?: Operator
|
||||
status?: PackageStatus
|
||||
}
|
||||
|
||||
// 创建/编辑套餐系列参数
|
||||
export interface PackageSeriesFormData {
|
||||
seriesCode: string
|
||||
seriesName: string
|
||||
operator: Operator
|
||||
description?: string
|
||||
status: PackageStatus
|
||||
}
|
||||
|
||||
// 创建/编辑套餐参数
|
||||
export interface PackageFormData {
|
||||
packageCode: string
|
||||
packageName: string
|
||||
seriesId: string | number
|
||||
operator: Operator
|
||||
packageType: PackageType
|
||||
totalFlow: number
|
||||
duration: number
|
||||
price: number
|
||||
description?: string
|
||||
status: PackageStatus
|
||||
isPublic: boolean
|
||||
}
|
||||
|
||||
// 套餐分配参数
|
||||
export interface PackageAssignParams {
|
||||
packageId: string | number
|
||||
agentId: string | number // 直级代理ID
|
||||
commissionMode: 'template' | 'custom' // 佣金模式
|
||||
commissionTemplateId?: string | number
|
||||
commissionRate?: number // 自定义佣金比例
|
||||
}
|
||||
|
||||
// 套餐变更记录
|
||||
export interface PackageChangeRecord {
|
||||
id: string | number
|
||||
iccid: string
|
||||
oldPackageId?: string | number
|
||||
oldPackageName?: string
|
||||
newPackageId: string | number
|
||||
newPackageName: string
|
||||
changeType: 'upgrade' | 'downgrade' | 'renew' // 升级/降级/续费
|
||||
amount?: number
|
||||
status: 'pending' | 'success' | 'failed'
|
||||
operatorId: string | number
|
||||
operatorName: string
|
||||
changeTime: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 套餐分配记录
|
||||
export interface PackageAssignRecord {
|
||||
id: string | number
|
||||
packageId: string | number
|
||||
packageName: string
|
||||
agentId: string | number
|
||||
agentName: string
|
||||
commissionMode: 'template' | 'custom'
|
||||
commissionTemplateId?: string | number
|
||||
commissionTemplateName?: string
|
||||
commissionRate?: number
|
||||
assignTime: string
|
||||
operatorName?: string
|
||||
}
|
||||
75
src/types/api/permission.ts
Normal file
75
src/types/api/permission.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* 权限相关类型定义 - 匹配后端 ModelPermission
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 权限类型
|
||||
export enum PermissionType {
|
||||
MENU = 1, // 菜单权限
|
||||
BUTTON = 2 // 按钮权限
|
||||
}
|
||||
|
||||
// 权限状态
|
||||
export enum PermissionStatus {
|
||||
ENABLED = 1, // 启用
|
||||
DISABLED = 0 // 禁用
|
||||
}
|
||||
|
||||
// 权限实体(匹配后端 ModelPermission)
|
||||
export interface Permission {
|
||||
ID: number
|
||||
CreatedAt?: string
|
||||
UpdatedAt?: string
|
||||
DeletedAt?: string | null
|
||||
creator?: number // 创建人ID
|
||||
updater?: number // 更新人ID
|
||||
perm_name: string // 权限名称
|
||||
perm_code: string // 权限编码
|
||||
perm_type: PermissionType // 权限类型 (1:菜单, 2:按钮)
|
||||
parent_id?: number | null // 父级权限ID
|
||||
url?: string // URL路径
|
||||
platform?: string // 平台标识 (all:全部, web:Web后台, h5:H5端)
|
||||
sort?: number // 排序序号
|
||||
status: PermissionStatus // 状态 (0:禁用, 1:启用)
|
||||
available_for_role_types?: string // 可用的角色类型
|
||||
children?: Permission[] // 子权限列表(树形结构)
|
||||
}
|
||||
|
||||
// 权限树节点
|
||||
export interface PermissionTreeNode {
|
||||
id: string | number
|
||||
label: string
|
||||
value: string
|
||||
permissionCode: string
|
||||
permissionType: PermissionType
|
||||
parentId?: string | number
|
||||
children?: PermissionTreeNode[]
|
||||
}
|
||||
|
||||
// 权限查询参数
|
||||
export interface PermissionQueryParams extends PaginationParams {
|
||||
perm_name?: string // 权限名称模糊查询
|
||||
perm_code?: string // 权限编码模糊查询
|
||||
perm_type?: number | null // 权限类型 (1:菜单, 2:按钮)
|
||||
status?: number | null // 状态 (0:禁用, 1:启用)
|
||||
parent_id?: number | null // 父权限ID
|
||||
platform?: string // 适用端口 (all:全部, web:Web后台, h5:H5端)
|
||||
available_for_role_type?: number | null // 可用角色类型 (1:平台角色, 2:客户角色)
|
||||
}
|
||||
|
||||
// 创建权限参数
|
||||
export interface CreatePermissionParams {
|
||||
perm_name: string // 权限名称
|
||||
perm_code: string // 权限编码
|
||||
perm_type: number // 权限类型 (1:菜单, 2:按钮)
|
||||
parent_id?: number | null // 父权限ID
|
||||
url?: string // 请求路径
|
||||
platform?: string // 适用端口 (all:全部, web:Web后台, h5:H5端),默认为 all
|
||||
sort?: number // 排序值
|
||||
}
|
||||
|
||||
// 更新权限参数
|
||||
export interface UpdatePermissionParams extends Partial<CreatePermissionParams> {
|
||||
status?: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
82
src/types/api/platformAccount.ts
Normal file
82
src/types/api/platformAccount.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 平台账号相关类型定义 - 匹配后端 API 文档
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 平台账号响应实体(匹配后端 ModelAccountResponse - 使用大写字段名)
|
||||
export interface PlatformAccountResponse {
|
||||
ID: number // 账号ID
|
||||
CreatedAt?: string // 创建时间
|
||||
UpdatedAt?: string // 更新时间
|
||||
DeletedAt?: string | null // 删除时间
|
||||
creator?: number // 创建人ID
|
||||
updater?: number // 更新人ID
|
||||
username: string // 用户名
|
||||
phone: string // 手机号
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
enterprise_id?: number | null // 关联企业ID
|
||||
shop_id?: number | null // 关联店铺ID
|
||||
status: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 平台账号列表查询参数
|
||||
export interface PlatformAccountQueryParams extends PaginationParams {
|
||||
username?: string // 用户名模糊查询
|
||||
phone?: string // 手机号模糊查询
|
||||
status?: number | null // 状态 (0:禁用, 1:启用)
|
||||
page?: number // 页码
|
||||
page_size?: number // 每页数量
|
||||
}
|
||||
|
||||
// 创建平台账号参数(匹配后端 ModelCreateAccountRequest)
|
||||
export interface CreatePlatformAccountParams {
|
||||
username: string // 用户名
|
||||
password: string // 密码
|
||||
phone: string // 手机号
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
enterprise_id?: number | null // 关联企业ID(企业账号必填)
|
||||
shop_id?: number | null // 关联店铺ID(代理账号必填)
|
||||
}
|
||||
|
||||
// 更新平台账号参数(匹配后端 ModelUpdateAccountParams)
|
||||
export interface UpdatePlatformAccountParams {
|
||||
username?: string | null // 用户名
|
||||
password?: string | null // 密码
|
||||
phone?: string | null // 手机号
|
||||
status?: number | null // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 修改密码参数
|
||||
export interface ChangePlatformAccountPasswordParams {
|
||||
new_password: string // 新密码
|
||||
}
|
||||
|
||||
// 分配角色参数
|
||||
export interface AssignRolesParams {
|
||||
role_ids: number[] // 角色ID列表
|
||||
}
|
||||
|
||||
// 启用/禁用账号参数
|
||||
export interface UpdateAccountStatusParams {
|
||||
status: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 平台账号角色响应
|
||||
export interface PlatformAccountRoleResponse {
|
||||
creator?: number // 创建人ID
|
||||
role_desc?: string // 角色描述
|
||||
role_name?: string // 角色名称
|
||||
role_type?: number // 角色类型
|
||||
status?: number // 状态
|
||||
updater?: number // 更新人ID
|
||||
ID?: number // 角色ID
|
||||
}
|
||||
|
||||
// 平台账号列表分页响应(匹配后端 ModelAccountPageResult)
|
||||
export interface PlatformAccountPageResult {
|
||||
items: PlatformAccountResponse[] | null // 账号列表
|
||||
page?: number // 当前页码
|
||||
size?: number // 每页数量
|
||||
total?: number // 总记录数
|
||||
}
|
||||
48
src/types/api/request.ts
Normal file
48
src/types/api/request.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* 请求相关类型定义
|
||||
*/
|
||||
|
||||
// 错误消息模式
|
||||
export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined
|
||||
|
||||
// 请求配置选项
|
||||
export interface RequestOptions {
|
||||
// 是否将参数拼接到URL
|
||||
joinParamsToUrl?: boolean
|
||||
// 是否格式化日期
|
||||
formatDate?: boolean
|
||||
// 是否转换响应数据
|
||||
isTransformResponse?: boolean
|
||||
// 是否返回原生响应
|
||||
isReturnNativeResponse?: boolean
|
||||
// 是否添加前缀
|
||||
joinPrefix?: boolean
|
||||
// API URL
|
||||
apiUrl?: string
|
||||
// 错误消息模式
|
||||
errorMessageMode?: ErrorMessageMode
|
||||
// 是否添加时间戳
|
||||
joinTime?: boolean
|
||||
// 是否忽略取消令牌
|
||||
ignoreCancelToken?: boolean
|
||||
// 是否携带token
|
||||
withToken?: boolean
|
||||
}
|
||||
|
||||
// 请求方法类型
|
||||
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
|
||||
|
||||
// 请求头类型
|
||||
export interface RequestHeaders {
|
||||
[key: string]: string | number | boolean
|
||||
}
|
||||
|
||||
// 基础请求配置
|
||||
export interface BaseRequestConfig {
|
||||
url: string
|
||||
method?: RequestMethod
|
||||
headers?: RequestHeaders
|
||||
params?: Record<string, any>
|
||||
data?: any
|
||||
timeout?: number
|
||||
}
|
||||
54
src/types/api/response.ts
Normal file
54
src/types/api/response.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 响应相关类型定义
|
||||
*/
|
||||
|
||||
// 基础接口返回的数据结构
|
||||
export interface BaseResponse<T = any> {
|
||||
// 状态码
|
||||
code: number
|
||||
// 消息
|
||||
msg: string
|
||||
// 数据
|
||||
data: T
|
||||
// 可选字段,用于返回 token
|
||||
token?: string
|
||||
}
|
||||
|
||||
// 分页查询参数
|
||||
export interface PaginationParams {
|
||||
// 当前页码
|
||||
page: number
|
||||
// 每页数量
|
||||
pageSize: number
|
||||
// 其他查询参数
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
// 分页响应数据结构
|
||||
export interface PaginationResponse<T> extends BaseResponse {
|
||||
// 当前页
|
||||
currentPage: number
|
||||
// 每页条数
|
||||
pageSize: number
|
||||
// 总页数
|
||||
lastPage: number
|
||||
// 总条数
|
||||
total: number
|
||||
// 数据列表
|
||||
data: T[]
|
||||
}
|
||||
|
||||
// 列表响应数据结构
|
||||
export interface ListResponse<T> extends BaseResponse {
|
||||
data: T[]
|
||||
}
|
||||
|
||||
// 详情响应数据结构
|
||||
export interface DetailResponse<T> extends BaseResponse {
|
||||
data: T
|
||||
}
|
||||
|
||||
// 操作响应数据结构(增删改)
|
||||
export interface OperationResponse extends BaseResponse {
|
||||
data: boolean | null
|
||||
}
|
||||
54
src/types/api/role.ts
Normal file
54
src/types/api/role.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 角色相关类型定义 - 匹配后端 ModelRole
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 角色类型
|
||||
export enum RoleType {
|
||||
PLATFORM = 1, // 平台角色
|
||||
CUSTOMER = 2 // 客户角色
|
||||
}
|
||||
|
||||
// 角色状态
|
||||
export enum RoleStatus {
|
||||
ENABLED = 1, // 启用
|
||||
DISABLED = 0 // 禁用
|
||||
}
|
||||
|
||||
// 角色实体(匹配后端 ModelRole)
|
||||
export interface PlatformRole {
|
||||
ID: number
|
||||
CreatedAt?: string
|
||||
UpdatedAt?: string
|
||||
DeletedAt?: string | null
|
||||
creator: number // 创建人ID
|
||||
updater: number // 更新人ID
|
||||
role_name: string // 角色名称
|
||||
role_desc: string // 角色描述
|
||||
role_type: RoleType // 角色类型
|
||||
status: RoleStatus // 状态
|
||||
}
|
||||
|
||||
// 角色查询参数
|
||||
export interface RoleQueryParams extends PaginationParams {
|
||||
role_name?: string
|
||||
role_type?: RoleType
|
||||
status?: RoleStatus
|
||||
}
|
||||
|
||||
// 创建/编辑角色参数
|
||||
export interface PlatformRoleFormData {
|
||||
role_name: string
|
||||
role_desc: string
|
||||
role_type: RoleType
|
||||
status: RoleStatus
|
||||
}
|
||||
|
||||
// 权限树节点
|
||||
export interface PermissionTreeNode {
|
||||
id: number
|
||||
label: string
|
||||
value: string
|
||||
children?: PermissionTreeNode[]
|
||||
}
|
||||
123
src/types/api/setting.ts
Normal file
123
src/types/api/setting.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* 设置相关类型定义
|
||||
*/
|
||||
|
||||
// 支付方式
|
||||
export enum PaymentMethod {
|
||||
ALIPAY = 'alipay', // 支付宝
|
||||
WECHAT = 'wechat', // 微信支付
|
||||
BANK = 'bank' // 银行卡
|
||||
}
|
||||
|
||||
// 收款商户设置
|
||||
export interface PaymentMerchantSetting {
|
||||
id?: string | number
|
||||
// 支付宝配置
|
||||
alipay?: {
|
||||
enabled: boolean
|
||||
appId: string
|
||||
privateKey: string
|
||||
publicKey: string
|
||||
notifyUrl?: string
|
||||
}
|
||||
// 微信支付配置
|
||||
wechat?: {
|
||||
enabled: boolean
|
||||
appId: string
|
||||
mchId: string
|
||||
apiKey: string
|
||||
certPath?: string
|
||||
notifyUrl?: string
|
||||
}
|
||||
// 银行转账配置
|
||||
bank?: {
|
||||
enabled: boolean
|
||||
bankName: string
|
||||
accountName: string
|
||||
accountNumber: string
|
||||
branchName?: string
|
||||
}
|
||||
updateTime?: string
|
||||
updaterName?: string
|
||||
}
|
||||
|
||||
// 开发能力(API Key)
|
||||
export interface DevelopmentCapability {
|
||||
id: string | number
|
||||
accountId: string | number
|
||||
accountName: string
|
||||
// API 密钥
|
||||
appKey: string
|
||||
appSecret: string // 前端只显示部分
|
||||
// 权限范围
|
||||
scopes: string[] // 允许访问的 API 范围
|
||||
// IP 白名单
|
||||
ipWhitelist?: string[]
|
||||
// 状态
|
||||
status: 'active' | 'disabled'
|
||||
// 限流配置
|
||||
rateLimit?: {
|
||||
requestsPerSecond: number
|
||||
requestsPerDay: number
|
||||
}
|
||||
// 统计信息
|
||||
totalCalls?: number // 总调用次数
|
||||
todayCalls?: number // 今日调用次数
|
||||
lastCallTime?: string // 最后调用时间
|
||||
// 时间信息
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
expireTime?: string // 过期时间
|
||||
}
|
||||
|
||||
// 生成 API Key 参数
|
||||
export interface GenerateApiKeyParams {
|
||||
scopes: string[]
|
||||
ipWhitelist?: string[]
|
||||
expireDays?: number // 有效期天数
|
||||
rateLimit?: {
|
||||
requestsPerSecond: number
|
||||
requestsPerDay: number
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新 Secret 响应
|
||||
export interface RefreshSecretResponse {
|
||||
appSecret: string
|
||||
}
|
||||
|
||||
// API 调用日志
|
||||
export interface ApiCallLog {
|
||||
id: string | number
|
||||
appKey: string
|
||||
apiPath: string // API 路径
|
||||
method: string // HTTP 方法
|
||||
requestIp: string
|
||||
requestTime: string
|
||||
responseTime: string
|
||||
duration: number // 耗时(ms)
|
||||
statusCode: number
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
// 系统通知设置
|
||||
export interface NotificationSetting {
|
||||
id?: string | number
|
||||
// 邮件通知
|
||||
email?: {
|
||||
enabled: boolean
|
||||
events: string[] // 需要邮件通知的事件
|
||||
}
|
||||
// 短信通知
|
||||
sms?: {
|
||||
enabled: boolean
|
||||
events: string[]
|
||||
}
|
||||
// 站内消息
|
||||
internal?: {
|
||||
enabled: boolean
|
||||
events: string[]
|
||||
}
|
||||
updateTime?: string
|
||||
}
|
||||
70
src/types/api/shop.ts
Normal file
70
src/types/api/shop.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* 店铺相关类型定义 - 匹配后端 API 文档
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 店铺响应实体
|
||||
export interface ShopResponse {
|
||||
id: number // 店铺ID
|
||||
created_at: string // 创建时间
|
||||
updated_at: string // 更新时间
|
||||
shop_name: string // 店铺名称
|
||||
shop_code: string // 店铺编号
|
||||
level: number // 店铺层级 (1-7级)
|
||||
parent_id: number | null // 上级店铺ID
|
||||
province: string // 省份
|
||||
city: string // 城市
|
||||
district: string // 区县
|
||||
address: string // 详细地址
|
||||
contact_name: string // 联系人姓名
|
||||
contact_phone: string // 联系人电话
|
||||
status: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 店铺列表查询参数
|
||||
export interface ShopQueryParams extends PaginationParams {
|
||||
shop_name?: string // 店铺名称模糊查询
|
||||
shop_code?: string // 店铺编号模糊查询
|
||||
parent_id?: number | null // 上级店铺ID
|
||||
level?: number | null // 店铺层级 (1-7级)
|
||||
status?: number | null // 状态 (0:禁用, 1:启用)
|
||||
page?: number // 页码
|
||||
page_size?: number // 每页数量
|
||||
}
|
||||
|
||||
// 创建店铺参数
|
||||
export interface CreateShopParams {
|
||||
shop_name: string // 店铺名称(必填)
|
||||
shop_code: string // 店铺编号(必填)
|
||||
init_username: string // 初始账号用户名(必填)
|
||||
init_password: string // 初始账号密码(必填)
|
||||
init_phone: string // 初始账号手机号(必填)
|
||||
parent_id?: number | null // 上级店铺ID(一级店铺可不填)
|
||||
province?: string // 省份
|
||||
city?: string // 城市
|
||||
district?: string // 区县
|
||||
address?: string // 详细地址
|
||||
contact_name?: string // 联系人姓名
|
||||
contact_phone?: string // 联系人电话
|
||||
}
|
||||
|
||||
// 更新店铺参数
|
||||
export interface UpdateShopParams {
|
||||
shop_name: string // 店铺名称(必填)
|
||||
status: number // 状态(必填)
|
||||
province?: string // 省份
|
||||
city?: string // 城市
|
||||
district?: string // 区县
|
||||
address?: string // 详细地址
|
||||
contact_name?: string // 联系人姓名
|
||||
contact_phone?: string // 联系人电话
|
||||
}
|
||||
|
||||
// 店铺列表分页响应
|
||||
export interface ShopPageResult {
|
||||
items: ShopResponse[] | null // 店铺列表
|
||||
page?: number // 当前页码
|
||||
size?: number // 每页数量
|
||||
total?: number // 总记录数
|
||||
}
|
||||
58
src/types/api/shopAccount.ts
Normal file
58
src/types/api/shopAccount.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 代理账号相关类型定义 - 匹配后端 API 文档
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
|
||||
// 代理账号响应实体(根据API文档使用小写字段名)
|
||||
export interface ShopAccountResponse {
|
||||
id: number // 账号ID
|
||||
created_at: string // 创建时间
|
||||
updated_at: string // 更新时间
|
||||
username: string // 用户名
|
||||
phone: string // 手机号
|
||||
shop_id: number // 店铺ID
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
status: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 代理账号列表查询参数
|
||||
export interface ShopAccountQueryParams extends PaginationParams {
|
||||
username?: string // 用户名模糊查询
|
||||
phone?: string // 手机号精确查询
|
||||
shop_id?: number | null // 店铺ID过滤
|
||||
status?: number | null // 状态 (0:禁用, 1:启用)
|
||||
page?: number // 页码
|
||||
page_size?: number // 每页数量
|
||||
}
|
||||
|
||||
// 创建代理账号参数
|
||||
export interface CreateShopAccountParams {
|
||||
username: string // 用户名
|
||||
password: string // 密码
|
||||
phone: string // 手机号
|
||||
shop_id: number // 店铺ID
|
||||
}
|
||||
|
||||
// 更新代理账号参数
|
||||
export interface UpdateShopAccountParams {
|
||||
username: string // 用户名
|
||||
}
|
||||
|
||||
// 重置密码参数
|
||||
export interface UpdateShopAccountPasswordParams {
|
||||
new_password: string // 新密码
|
||||
}
|
||||
|
||||
// 更新状态参数
|
||||
export interface UpdateShopAccountStatusParams {
|
||||
status: number // 状态 (0:禁用, 1:启用)
|
||||
}
|
||||
|
||||
// 代理账号列表分页响应
|
||||
export interface ShopAccountPageResult {
|
||||
items: ShopAccountResponse[] | null // 账号列表
|
||||
page?: number // 当前页码
|
||||
size?: number // 每页数量
|
||||
total?: number // 总记录数
|
||||
}
|
||||
317
src/types/auto-imports.d.ts
vendored
Normal file
317
src/types/auto-imports.d.ts
vendored
Normal file
@@ -0,0 +1,317 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
// Generated by unplugin-auto-import
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const ElButton: (typeof import('element-plus/es'))['ElButton']
|
||||
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
||||
const ElMessageBox: (typeof import('element-plus/es'))['ElMessageBox']
|
||||
const ElNotification: (typeof import('element-plus/es'))['ElNotification']
|
||||
const ElPopconfirm: (typeof import('element-plus/es'))['ElPopconfirm']
|
||||
const ElPopover: (typeof import('element-plus/es'))['ElPopover']
|
||||
const ElTableColumn: (typeof import('element-plus/es'))['ElTableColumn']
|
||||
const ElTag: typeof import('element-plus/es')['ElTag']
|
||||
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
|
||||
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
||||
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const computedAsync: typeof import('@vueuse/core')['computedAsync']
|
||||
const computedEager: typeof import('@vueuse/core')['computedEager']
|
||||
const computedInject: typeof import('@vueuse/core')['computedInject']
|
||||
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
|
||||
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
|
||||
const controlledRef: typeof import('@vueuse/core')['controlledRef']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const createEventHook: typeof import('@vueuse/core')['createEventHook']
|
||||
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
|
||||
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
|
||||
const createPinia: typeof import('pinia')['createPinia']
|
||||
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
|
||||
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
|
||||
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
|
||||
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
|
||||
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
|
||||
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
|
||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||
const defineComponent: typeof import('vue')['defineComponent']
|
||||
const defineStore: typeof import('pinia')['defineStore']
|
||||
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
|
||||
const effectScope: typeof import('vue')['effectScope']
|
||||
const extendRef: typeof import('@vueuse/core')['extendRef']
|
||||
const getActivePinia: typeof import('pinia')['getActivePinia']
|
||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
||||
const h: typeof import('vue')['h']
|
||||
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
|
||||
const inject: typeof import('vue')['inject']
|
||||
const injectLocal: typeof import('@vueuse/core')['injectLocal']
|
||||
const isDefined: typeof import('@vueuse/core')['isDefined']
|
||||
const isProxy: typeof import('vue')['isProxy']
|
||||
const isReactive: typeof import('vue')['isReactive']
|
||||
const isReadonly: typeof import('vue')['isReadonly']
|
||||
const isRef: typeof import('vue')['isRef']
|
||||
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
|
||||
const mapActions: typeof import('pinia')['mapActions']
|
||||
const mapGetters: typeof import('pinia')['mapGetters']
|
||||
const mapState: typeof import('pinia')['mapState']
|
||||
const mapStores: typeof import('pinia')['mapStores']
|
||||
const mapWritableState: typeof import('pinia')['mapWritableState']
|
||||
const markRaw: typeof import('vue')['markRaw']
|
||||
const nextTick: typeof import('vue')['nextTick']
|
||||
const onActivated: typeof import('vue')['onActivated']
|
||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
||||
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
||||
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
||||
const onMounted: typeof import('vue')['onMounted']
|
||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||
const onUpdated: typeof import('vue')['onUpdated']
|
||||
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
||||
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
||||
const provide: typeof import('vue')['provide']
|
||||
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
||||
const reactify: typeof import('@vueuse/core')['reactify']
|
||||
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
|
||||
const reactive: typeof import('vue')['reactive']
|
||||
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
|
||||
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
|
||||
const reactivePick: typeof import('@vueuse/core')['reactivePick']
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
|
||||
const refDebounced: typeof import('@vueuse/core')['refDebounced']
|
||||
const refDefault: typeof import('@vueuse/core')['refDefault']
|
||||
const refThrottled: typeof import('@vueuse/core')['refThrottled']
|
||||
const refWithControl: typeof import('@vueuse/core')['refWithControl']
|
||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||
const resolveRef: typeof import('@vueuse/core')['resolveRef']
|
||||
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
|
||||
const setActivePinia: typeof import('pinia')['setActivePinia']
|
||||
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
const storeToRefs: typeof import('pinia')['storeToRefs']
|
||||
const syncRef: typeof import('@vueuse/core')['syncRef']
|
||||
const syncRefs: typeof import('@vueuse/core')['syncRefs']
|
||||
const templateRef: typeof import('@vueuse/core')['templateRef']
|
||||
const throttledRef: typeof import('@vueuse/core')['throttledRef']
|
||||
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
|
||||
const toRaw: typeof import('vue')['toRaw']
|
||||
const toReactive: typeof import('@vueuse/core')['toReactive']
|
||||
const toRef: typeof import('vue')['toRef']
|
||||
const toRefs: typeof import('vue')['toRefs']
|
||||
const toValue: typeof import('vue')['toValue']
|
||||
const triggerRef: typeof import('vue')['triggerRef']
|
||||
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
|
||||
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
|
||||
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
|
||||
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
|
||||
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
|
||||
const unref: typeof import('vue')['unref']
|
||||
const unrefElement: typeof import('@vueuse/core')['unrefElement']
|
||||
const until: typeof import('@vueuse/core')['until']
|
||||
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
|
||||
const useAnimate: typeof import('@vueuse/core')['useAnimate']
|
||||
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
|
||||
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
|
||||
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
|
||||
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
|
||||
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
|
||||
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
|
||||
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
|
||||
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
|
||||
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
|
||||
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
|
||||
const useArraySome: typeof import('@vueuse/core')['useArraySome']
|
||||
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
|
||||
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
|
||||
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
|
||||
const useAttrs: typeof import('vue')['useAttrs']
|
||||
const useBase64: typeof import('@vueuse/core')['useBase64']
|
||||
const useBattery: typeof import('@vueuse/core')['useBattery']
|
||||
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
|
||||
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
|
||||
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
|
||||
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
|
||||
const useCached: typeof import('@vueuse/core')['useCached']
|
||||
const useClipboard: typeof import('@vueuse/core')['useClipboard']
|
||||
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
|
||||
const useCloned: typeof import('@vueuse/core')['useCloned']
|
||||
const useColorMode: typeof import('@vueuse/core')['useColorMode']
|
||||
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
|
||||
const useCounter: typeof import('@vueuse/core')['useCounter']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVar: typeof import('@vueuse/core')['useCssVar']
|
||||
const useCssVars: typeof import('vue')['useCssVars']
|
||||
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
|
||||
const useCycleList: typeof import('@vueuse/core')['useCycleList']
|
||||
const useDark: typeof import('@vueuse/core')['useDark']
|
||||
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
|
||||
const useDebounce: typeof import('@vueuse/core')['useDebounce']
|
||||
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
|
||||
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
|
||||
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
|
||||
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
|
||||
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
|
||||
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
|
||||
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
|
||||
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
|
||||
const useDraggable: typeof import('@vueuse/core')['useDraggable']
|
||||
const useDropZone: typeof import('@vueuse/core')['useDropZone']
|
||||
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
|
||||
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
|
||||
const useElementHover: typeof import('@vueuse/core')['useElementHover']
|
||||
const useElementSize: typeof import('@vueuse/core')['useElementSize']
|
||||
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
|
||||
const useEventBus: typeof import('@vueuse/core')['useEventBus']
|
||||
const useEventListener: typeof import('@vueuse/core')['useEventListener']
|
||||
const useEventSource: typeof import('@vueuse/core')['useEventSource']
|
||||
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
|
||||
const useFavicon: typeof import('@vueuse/core')['useFavicon']
|
||||
const useFetch: typeof import('@vueuse/core')['useFetch']
|
||||
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
|
||||
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
|
||||
const useFocus: typeof import('@vueuse/core')['useFocus']
|
||||
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
|
||||
const useFps: typeof import('@vueuse/core')['useFps']
|
||||
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
||||
const useGamepad: typeof import('@vueuse/core')['useGamepad']
|
||||
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
||||
const useId: typeof import('vue')['useId']
|
||||
const useIdle: typeof import('@vueuse/core')['useIdle']
|
||||
const useImage: typeof import('@vueuse/core')['useImage']
|
||||
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
|
||||
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
|
||||
const useInterval: typeof import('@vueuse/core')['useInterval']
|
||||
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
|
||||
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
|
||||
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
|
||||
const useLink: typeof import('vue-router')['useLink']
|
||||
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
|
||||
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
|
||||
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
|
||||
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
|
||||
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
|
||||
const useMemoize: typeof import('@vueuse/core')['useMemoize']
|
||||
const useMemory: typeof import('@vueuse/core')['useMemory']
|
||||
const useModel: typeof import('vue')['useModel']
|
||||
const useMounted: typeof import('@vueuse/core')['useMounted']
|
||||
const useMouse: typeof import('@vueuse/core')['useMouse']
|
||||
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
||||
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
|
||||
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
|
||||
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
|
||||
const useNetwork: typeof import('@vueuse/core')['useNetwork']
|
||||
const useNow: typeof import('@vueuse/core')['useNow']
|
||||
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
|
||||
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
|
||||
const useOnline: typeof import('@vueuse/core')['useOnline']
|
||||
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
|
||||
const useParallax: typeof import('@vueuse/core')['useParallax']
|
||||
const useParentElement: typeof import('@vueuse/core')['useParentElement']
|
||||
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
|
||||
const usePermission: typeof import('@vueuse/core')['usePermission']
|
||||
const usePointer: typeof import('@vueuse/core')['usePointer']
|
||||
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
|
||||
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
|
||||
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
|
||||
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
|
||||
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
||||
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
||||
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
||||
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
||||
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
||||
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
|
||||
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
|
||||
const useRoute: typeof import('vue-router')['useRoute']
|
||||
const useRouter: typeof import('vue-router')['useRouter']
|
||||
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
||||
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
||||
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
||||
const useScroll: typeof import('@vueuse/core')['useScroll']
|
||||
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
|
||||
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
|
||||
const useShare: typeof import('@vueuse/core')['useShare']
|
||||
const useSlots: typeof import('vue')['useSlots']
|
||||
const useSorted: typeof import('@vueuse/core')['useSorted']
|
||||
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
|
||||
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
|
||||
const useStepper: typeof import('@vueuse/core')['useStepper']
|
||||
const useStorage: typeof import('@vueuse/core')['useStorage']
|
||||
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
|
||||
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
|
||||
const useSupported: typeof import('@vueuse/core')['useSupported']
|
||||
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
||||
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
||||
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
|
||||
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
|
||||
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
|
||||
const useThrottle: typeof import('@vueuse/core')['useThrottle']
|
||||
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
|
||||
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
|
||||
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
|
||||
const useTimeout: typeof import('@vueuse/core')['useTimeout']
|
||||
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
|
||||
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
|
||||
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
|
||||
const useTitle: typeof import('@vueuse/core')['useTitle']
|
||||
const useToNumber: typeof import('@vueuse/core')['useToNumber']
|
||||
const useToString: typeof import('@vueuse/core')['useToString']
|
||||
const useToggle: typeof import('@vueuse/core')['useToggle']
|
||||
const useTransition: typeof import('@vueuse/core')['useTransition']
|
||||
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
|
||||
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
|
||||
const useVModel: typeof import('@vueuse/core')['useVModel']
|
||||
const useVModels: typeof import('@vueuse/core')['useVModels']
|
||||
const useVibrate: typeof import('@vueuse/core')['useVibrate']
|
||||
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
|
||||
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
|
||||
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
|
||||
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
|
||||
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
|
||||
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
|
||||
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
|
||||
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
|
||||
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
|
||||
const watch: typeof import('vue')['watch']
|
||||
const watchArray: typeof import('@vueuse/core')['watchArray']
|
||||
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
|
||||
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
|
||||
const watchDeep: typeof import('@vueuse/core')['watchDeep']
|
||||
const watchEffect: typeof import('vue')['watchEffect']
|
||||
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
|
||||
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
|
||||
const watchOnce: typeof import('@vueuse/core')['watchOnce']
|
||||
const watchPausable: typeof import('@vueuse/core')['watchPausable']
|
||||
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
||||
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
||||
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
|
||||
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
|
||||
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
|
||||
const whenever: typeof import('@vueuse/core')['whenever']
|
||||
}
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
}
|
||||
72
src/types/common/index.ts
Normal file
72
src/types/common/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* 通用类型定义
|
||||
*/
|
||||
|
||||
// 状态类型
|
||||
export type Status = 0 | 1 // 0: 禁用, 1: 启用
|
||||
|
||||
// 性别类型
|
||||
export type Gender = 'male' | 'female' | 'unknown'
|
||||
|
||||
// 排序方向
|
||||
export type SortOrder = 'asc' | 'desc'
|
||||
|
||||
// 操作类型
|
||||
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 Option {
|
||||
label: string
|
||||
value: string | number
|
||||
disabled?: boolean
|
||||
children?: Option[]
|
||||
}
|
||||
|
||||
// 时间范围类型
|
||||
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'
|
||||
135
src/types/component/index.ts
Normal file
135
src/types/component/index.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* 组件相关类型定义
|
||||
*/
|
||||
|
||||
import { Option } from '../common'
|
||||
|
||||
// 搜索组件类型
|
||||
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 SearchFormItem {
|
||||
// 表单项标签
|
||||
label: string
|
||||
// 表单项属性名
|
||||
prop: string
|
||||
// 表单项类型
|
||||
type: SearchComponentType
|
||||
// 每列的宽度(基于 24 格布局)
|
||||
elColSpan?: number
|
||||
// select的选项
|
||||
options?: Option[] | (() => Option[])
|
||||
// 搜索框更改事件
|
||||
onChange?: (changeParams: SearchChangeParams) => void
|
||||
// 额外配置项
|
||||
config?: Record<string, unknown>
|
||||
// 默认值
|
||||
defaultValue?: any
|
||||
// 占位符
|
||||
placeholder?: string
|
||||
// 是否必填
|
||||
required?: boolean
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
// 表格列配置
|
||||
export interface TableColumn {
|
||||
// 列标题
|
||||
label: string
|
||||
// 列属性名
|
||||
prop: string
|
||||
// 列宽度
|
||||
width?: number | string
|
||||
// 最小宽度
|
||||
minWidth?: number | string
|
||||
// 是否可排序
|
||||
sortable?: boolean
|
||||
// 是否固定列
|
||||
fixed?: boolean | 'left' | 'right'
|
||||
// 列对齐方式
|
||||
align?: 'left' | 'center' | 'right'
|
||||
// 自定义渲染
|
||||
formatter?: (row: any, column: any, cellValue: any, index: number) => string
|
||||
// 是否显示
|
||||
show?: boolean
|
||||
// 列类型
|
||||
type?: 'selection' | 'index' | 'expand'
|
||||
}
|
||||
|
||||
// 分页配置
|
||||
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
|
||||
}
|
||||
156
src/types/components.d.ts
vendored
Normal file
156
src/types/components.d.ts
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
export {}
|
||||
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
AgentSelector: typeof import('./../components/business/AgentSelector.vue')['default']
|
||||
ArtBackToTop: typeof import('./../components/core/base/ArtBackToTop.vue')['default']
|
||||
ArtBarChart: typeof import('./../components/core/charts/ArtBarChart.vue')['default']
|
||||
ArtBarChartCard: typeof import('./../components/core/cards/ArtBarChartCard.vue')['default']
|
||||
ArtBasicBanner: typeof import('./../components/core/banners/ArtBasicBanner.vue')['default']
|
||||
ArtBreadcrumb: typeof import('./../components/core/layouts/art-breadcrumb/index.vue')['default']
|
||||
ArtButtonMore: typeof import('./../components/core/forms/ArtButtonMore.vue')['default']
|
||||
ArtButtonTable: typeof import('./../components/core/forms/ArtButtonTable.vue')['default']
|
||||
ArtCardBanner: typeof import('./../components/core/banners/ArtCardBanner.vue')['default']
|
||||
ArtChatWindow: typeof import('./../components/core/layouts/art-chat-window/index.vue')['default']
|
||||
ArtCutterImg: typeof import('./../components/core/media/ArtCutterImg.vue')['default']
|
||||
ArtDataListCard: typeof import('./../components/core/cards/ArtDataListCard.vue')['default']
|
||||
ArtDataViewer: typeof import('./../components/core/views/ArtDataViewer.vue')['default']
|
||||
ArtDonutChartCard: typeof import('./../components/core/cards/ArtDonutChartCard.vue')['default']
|
||||
ArtDragVerify: typeof import('./../components/core/forms/ArtDragVerify.vue')['default']
|
||||
ArtDualBarCompareChart: typeof import('./../components/core/charts/ArtDualBarCompareChart.vue')['default']
|
||||
ArtExcelExport: typeof import('./../components/core/forms/ArtExcelExport.vue')['default']
|
||||
ArtExcelImport: typeof import('./../components/core/forms/ArtExcelImport.vue')['default']
|
||||
ArtException: typeof import('./../components/core/views/exception/ArtException.vue')['default']
|
||||
ArtFastEnter: typeof import('./../components/core/layouts/art-fast-enter/index.vue')['default']
|
||||
ArtFestivalTextScroll: typeof import('./../components/core/text-effect/ArtFestivalTextScroll.vue')['default']
|
||||
ArtFireworksEffect: typeof import('./../components/core/layouts/art-fireworks-effect/index.vue')['default']
|
||||
ArtGlobalSearch: typeof import('./../components/core/layouts/art-global-search/index.vue')['default']
|
||||
ArtHBarChart: typeof import('./../components/core/charts/ArtHBarChart.vue')['default']
|
||||
ArtHeaderBar: typeof import('./../components/core/layouts/art-header-bar/index.vue')['default']
|
||||
ArtHorizontalMenu: typeof import('./../components/core/layouts/art-menus/art-horizontal-menu/index.vue')['default']
|
||||
ArtIconSelector: typeof import('./../components/core/base/ArtIconSelector.vue')['default']
|
||||
ArtImageCard: typeof import('./../components/core/cards/ArtImageCard.vue')['default']
|
||||
ArtKLineChart: typeof import('./../components/core/charts/ArtKLineChart.vue')['default']
|
||||
ArtLayouts: typeof import('./../components/core/layouts/art-layouts/index.vue')['default']
|
||||
ArtLineChart: typeof import('./../components/core/charts/ArtLineChart.vue')['default']
|
||||
ArtLineChartCard: typeof import('./../components/core/cards/ArtLineChartCard.vue')['default']
|
||||
ArtLogo: typeof import('./../components/core/base/ArtLogo.vue')['default']
|
||||
ArtMapChart: typeof import('./../components/core/charts/ArtMapChart.vue')['default']
|
||||
ArtMenuRight: typeof import('./../components/core/others/ArtMenuRight.vue')['default']
|
||||
ArtMixedMenu: typeof import('./../components/core/layouts/art-menus/art-mixed-menu/index.vue')['default']
|
||||
ArtNotification: typeof import('./../components/core/layouts/art-notification/index.vue')['default']
|
||||
ArtPageContent: typeof import('./../components/core/layouts/art-page-content/index.vue')['default']
|
||||
ArtProgressCard: typeof import('./../components/core/cards/ArtProgressCard.vue')['default']
|
||||
ArtRadarChart: typeof import('./../components/core/charts/ArtRadarChart.vue')['default']
|
||||
ArtResultPage: typeof import('./../components/core/views/result/ArtResultPage.vue')['default']
|
||||
ArtRingChart: typeof import('./../components/core/charts/ArtRingChart.vue')['default']
|
||||
ArtScatterChart: typeof import('./../components/core/charts/ArtScatterChart.vue')['default']
|
||||
ArtScreenLock: typeof import('./../components/core/layouts/art-screen-lock/index.vue')['default']
|
||||
ArtSearchBar: typeof import('./../components/core/forms/art-search-bar/index.vue')['default']
|
||||
ArtSearchDate: typeof import('./../components/core/forms/art-search-bar/widget/art-search-date/index.vue')['default']
|
||||
ArtSearchInput: typeof import('./../components/core/forms/art-search-bar/widget/art-search-input/index.vue')['default']
|
||||
ArtSearchRadio: typeof import('./../components/core/forms/art-search-bar/widget/art-search-radio/index.vue')['default']
|
||||
ArtSearchSelect: typeof import('./../components/core/forms/art-search-bar/widget/art-search-select/index.vue')['default']
|
||||
ArtSettingsPanel: typeof import('./../components/core/layouts/art-settings-panel/index.vue')['default']
|
||||
ArtSidebarMenu: typeof import('./../components/core/layouts/art-menus/art-sidebar-menu/index.vue')['default']
|
||||
ArtStatsCard: typeof import('./../components/core/cards/ArtStatsCard.vue')['default']
|
||||
ArtTable: typeof import('./../components/core/tables/ArtTable.vue')['default']
|
||||
ArtTableFullScreen: typeof import('./../components/core/tables/ArtTableFullScreen.vue')['default']
|
||||
ArtTableHeader: typeof import('./../components/core/tables/ArtTableHeader.vue')['default']
|
||||
ArtTextScroll: typeof import('./../components/core/text-effect/ArtTextScroll.vue')['default']
|
||||
ArtTimelineListCard: typeof import('./../components/core/cards/ArtTimelineListCard.vue')['default']
|
||||
ArtVideoPlayer: typeof import('./../components/core/media/ArtVideoPlayer.vue')['default']
|
||||
ArtWangEditor: typeof import('./../components/core/forms/ArtWangEditor.vue')['default']
|
||||
ArtWatermark: typeof import('./../components/core/others/ArtWatermark.vue')['default']
|
||||
ArtWorkTab: typeof import('./../components/core/layouts/art-work-tab/index.vue')['default']
|
||||
BasicSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/BasicSettings.vue')['default']
|
||||
BatchOperationDialog: typeof import('./../components/business/BatchOperationDialog.vue')['default']
|
||||
BoxStyleSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/BoxStyleSettings.vue')['default']
|
||||
CardOperationDialog: typeof import('./../components/business/CardOperationDialog.vue')['default']
|
||||
CardStatusTag: typeof import('./../components/business/CardStatusTag.vue')['default']
|
||||
ColorSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/ColorSettings.vue')['default']
|
||||
CommentItem: typeof import('./../components/custom/comment-widget/widget/CommentItem.vue')['default']
|
||||
CommentWidget: typeof import('./../components/custom/comment-widget/index.vue')['default']
|
||||
CommissionDisplay: typeof import('./../components/business/CommissionDisplay.vue')['default']
|
||||
ContainerSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/ContainerSettings.vue')['default']
|
||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||
ElCalendar: typeof import('element-plus/es')['ElCalendar']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||
ElCol: typeof import('element-plus/es')['ElCol']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSegmented: typeof import('element-plus/es')['ElSegmented']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
||||
ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElTimeline: typeof import('element-plus/es')['ElTimeline']
|
||||
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
|
||||
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||
ElWatermark: typeof import('element-plus/es')['ElWatermark']
|
||||
HorizontalSubmenu: typeof import('./../components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue')['default']
|
||||
ImportDialog: typeof import('./../components/business/ImportDialog.vue')['default']
|
||||
LoginLeftView: typeof import('./../components/core/views/login/LoginLeftView.vue')['default']
|
||||
MenuLayoutSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/MenuLayoutSettings.vue')['default']
|
||||
MenuStyleSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/MenuStyleSettings.vue')['default']
|
||||
OperatorSelect: typeof import('./../components/business/OperatorSelect.vue')['default']
|
||||
PackageSelector: typeof import('./../components/business/PackageSelector.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SectionTitle: typeof import('./../components/core/layouts/art-settings-panel/widget/SectionTitle.vue')['default']
|
||||
SettingDrawer: typeof import('./../components/core/layouts/art-settings-panel/widget/SettingDrawer.vue')['default']
|
||||
SettingHeader: typeof import('./../components/core/layouts/art-settings-panel/widget/SettingHeader.vue')['default']
|
||||
SettingItem: typeof import('./../components/core/layouts/art-settings-panel/widget/SettingItem.vue')['default']
|
||||
SidebarSubmenu: typeof import('./../components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue')['default']
|
||||
ThemeSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/ThemeSettings.vue')['default']
|
||||
}
|
||||
export interface ComponentCustomProperties {
|
||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
}
|
||||
}
|
||||
107
src/types/config/index.ts
Normal file
107
src/types/config/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 配置相关类型定义
|
||||
*/
|
||||
|
||||
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
|
||||
name: string
|
||||
image: string
|
||||
scrollText: string
|
||||
isActive?: boolean
|
||||
}
|
||||
|
||||
// 系统基础配置
|
||||
export interface SystemBasicConfig {
|
||||
// 系统名称
|
||||
name: string
|
||||
// 系统描述
|
||||
description?: string
|
||||
// 系统logo
|
||||
logo?: string
|
||||
// 系统favicon
|
||||
favicon?: string
|
||||
// 版权信息
|
||||
copyright?: string
|
||||
}
|
||||
|
||||
// 系统配置
|
||||
export interface SystemConfig {
|
||||
// Element Plus 主题配置
|
||||
elementPlusTheme: {
|
||||
primary: string
|
||||
}
|
||||
// 系统基础信息
|
||||
systemInfo: SystemBasicConfig
|
||||
// 系统主题样式
|
||||
systemThemeStyles: SystemThemeTypes
|
||||
// 设置主题列表
|
||||
settingThemeList: ThemeSetting[]
|
||||
// 菜单布局列表
|
||||
menuLayoutList: MenuLayout[]
|
||||
// 主题列表
|
||||
themeList: MenuThemeType[]
|
||||
// 暗色菜单样式
|
||||
darkMenuStyles: MenuThemeType[]
|
||||
// 系统主色调
|
||||
systemMainColor: readonly string[]
|
||||
// 系统设置
|
||||
systemSetting: {
|
||||
defaultMenuWidth: number
|
||||
defaultCustomRadius: string
|
||||
defaultTabStyle: string
|
||||
}
|
||||
}
|
||||
|
||||
// 环境配置
|
||||
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
|
||||
}
|
||||
7
src/types/index.ts
Normal file
7
src/types/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// 统一导出所有类型定义
|
||||
export * from './api'
|
||||
export * from './common'
|
||||
export * from './component'
|
||||
export * from './store'
|
||||
export * from './router'
|
||||
export * from './config'
|
||||
46
src/types/router/index.ts
Normal file
46
src/types/router/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 路由相关类型定义
|
||||
*/
|
||||
|
||||
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
|
||||
auth_mark: string
|
||||
}>
|
||||
/** 是否为一级菜单 */
|
||||
isFirstLevel?: boolean
|
||||
/** 角色权限 */
|
||||
roles?: string[]
|
||||
/** 是否固定标签页 */
|
||||
fixedTab?: boolean
|
||||
}
|
||||
|
||||
// 扩展路由记录
|
||||
export interface AppRouteRecord extends Omit<RouteRecordRaw, 'meta' | 'children' | 'component'> {
|
||||
id?: number
|
||||
meta: RouteMeta
|
||||
children?: AppRouteRecord[]
|
||||
component?: string | (() => Promise<any>)
|
||||
}
|
||||
114
src/types/store/index.ts
Normal file
114
src/types/store/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Store相关类型定义
|
||||
*/
|
||||
|
||||
import { MenuThemeEnum, SystemThemeEnum } from '@/enums/appEnum'
|
||||
import { LocationQueryRaw } from 'vue-router'
|
||||
|
||||
// 用户信息
|
||||
export interface UserInfo {
|
||||
id: number // 用户ID
|
||||
username: string // 用户名
|
||||
phone: string // 手机号
|
||||
user_type: number // 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
|
||||
user_type_name: string // 用户类型名称
|
||||
enterprise_id?: number // 企业ID(可选)
|
||||
enterprise_name?: string // 企业名称(可选)
|
||||
shop_id?: number // 店铺ID(可选)
|
||||
shop_name?: string // 店铺名称(可选)
|
||||
roles?: string[]
|
||||
buttons?: string[]
|
||||
avatar?: string
|
||||
email?: string
|
||||
}
|
||||
|
||||
// 系统主题样式(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
|
||||
textActiveColor: string
|
||||
iconColor: string
|
||||
iconActiveColor: string
|
||||
tabBarBackground: string
|
||||
systemBackground: string
|
||||
leftLineColor: string
|
||||
rightLineColor: 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
|
||||
path: string
|
||||
name: string
|
||||
keepAlive: boolean
|
||||
fixedTab?: boolean
|
||||
params?: object
|
||||
query?: LocationQueryRaw
|
||||
icon?: string
|
||||
isActive?: boolean
|
||||
}
|
||||
|
||||
// 用户Store状态
|
||||
export interface UserState {
|
||||
userInfo: 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