feat: 升级stylelint依赖并修复相关问题
- 更新stylelint到16.x版本 - 修复postcss版本冲突 - 解决循环依赖问题 - 优化代码类型定义
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
// API响应基础类型
|
||||
export interface ApiResponse<T = unknown> {
|
||||
code: number;
|
||||
data: T;
|
||||
message: string;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
// 分页参数类型
|
||||
export interface PaginationParams {
|
||||
current: number;
|
||||
pageSize: number;
|
||||
total?: number;
|
||||
}
|
||||
|
||||
// 分页响应类型
|
||||
export interface PaginatedResponse<T> {
|
||||
list: T[];
|
||||
pagination: PaginationParams;
|
||||
}
|
||||
|
||||
// 排序参数类型
|
||||
export interface SortParams {
|
||||
field: string;
|
||||
order: 'asc' | 'desc';
|
||||
}
|
||||
|
||||
// 过滤参数类型
|
||||
export interface FilterParams {
|
||||
[key: string]: string | number | boolean | undefined;
|
||||
}
|
||||
|
||||
// 列表查询参数类型
|
||||
export interface ListQueryParams extends PaginationParams {
|
||||
sort?: SortParams;
|
||||
filter?: FilterParams;
|
||||
search?: string;
|
||||
}
|
||||
|
||||
// 文件上传进度回调类型
|
||||
export interface UploadProgressEvent {
|
||||
loaded: number;
|
||||
total: number;
|
||||
percent: number;
|
||||
}
|
||||
|
||||
export type UploadProgressCallback = (event: UploadProgressEvent) => void;
|
||||
|
||||
// 表格列定义类型
|
||||
export interface TableColumn<T = Record<string, unknown>> {
|
||||
title: string;
|
||||
dataIndex: string;
|
||||
key?: string;
|
||||
width?: number | string;
|
||||
align?: 'left' | 'center' | 'right';
|
||||
sortable?: boolean;
|
||||
filterable?: boolean;
|
||||
slotName?: string;
|
||||
render?: (value: unknown, record: T, index: number) => unknown;
|
||||
}
|
||||
|
||||
// 用户权限类型
|
||||
export interface UserPermission {
|
||||
id: number; // 权限ID
|
||||
parent_id: number; // 上一级ID
|
||||
prem_name: string; // 权限名称
|
||||
level: number; // 层级
|
||||
perm_key: string; // 权限标识
|
||||
prem_type: 1 | 2 | 3 | 4; // 权限类型:1菜单、2按钮、3接口、4页面
|
||||
path: string; // 路由路径
|
||||
sort: number; // 排序
|
||||
visible: 1 | 2; // 是否可见:1显示、2隐藏
|
||||
createdAt: string; // 创建时间
|
||||
updatedAt: string; // 更新时间
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// 项目类型常量定义
|
||||
export const PROJECT_TYPE = {
|
||||
COMMERCIAL_COMPLEX: '1',
|
||||
OFFICE_BUILDING: '2',
|
||||
INDUSTRIAL_PARK: '3',
|
||||
} as const;
|
||||
|
||||
// 租户状态常量
|
||||
export const TENANT_STATUS = {
|
||||
ACTIVE: 'active',
|
||||
EXPIRED: 'expired',
|
||||
PENDING: 'pending',
|
||||
} as const;
|
||||
|
||||
// 合同状态常量
|
||||
export const CONTRACT_STATUS = {
|
||||
DRAFT: 'draft',
|
||||
ACTIVE: 'active',
|
||||
EXPIRED: 'expired',
|
||||
TERMINATED: 'terminated',
|
||||
} as const;
|
||||
|
||||
// 类型定义
|
||||
export type ProjectType = (typeof PROJECT_TYPE)[keyof typeof PROJECT_TYPE];
|
||||
export type TenantStatus = (typeof TENANT_STATUS)[keyof typeof TENANT_STATUS];
|
||||
export type ContractStatus =
|
||||
(typeof CONTRACT_STATUS)[keyof typeof CONTRACT_STATUS];
|
||||
|
||||
// 项目相关类型定义
|
||||
export interface ProjectRecord {
|
||||
id?: string;
|
||||
name: string;
|
||||
type: ProjectType;
|
||||
size: string;
|
||||
kezu: string;
|
||||
rate: number;
|
||||
count: string;
|
||||
create_time: string;
|
||||
}
|
||||
|
||||
export const PROJECT_TYPE_COLORS: Record<ProjectType, string> = {
|
||||
[PROJECT_TYPE.COMMERCIAL_COMPLEX]: 'orangered',
|
||||
[PROJECT_TYPE.OFFICE_BUILDING]: 'green',
|
||||
[PROJECT_TYPE.INDUSTRIAL_PARK]: 'gold',
|
||||
};
|
||||
|
||||
export const PROJECT_TYPE_LABELS: Record<ProjectType, string> = {
|
||||
[PROJECT_TYPE.COMMERCIAL_COMPLEX]: '商业综合体',
|
||||
[PROJECT_TYPE.OFFICE_BUILDING]: '写字楼',
|
||||
[PROJECT_TYPE.INDUSTRIAL_PARK]: '园区',
|
||||
};
|
||||
|
||||
// 租户相关类型
|
||||
export interface TenantRecord {
|
||||
id: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
contractStartDate: string;
|
||||
contractEndDate: string;
|
||||
projectId: string;
|
||||
status: TenantStatus;
|
||||
}
|
||||
|
||||
// 合同相关类型
|
||||
export interface ContractRecord {
|
||||
id: string;
|
||||
contractNo: string;
|
||||
tenantId: string;
|
||||
projectId: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
rentAmount: number;
|
||||
status: ContractStatus;
|
||||
}
|
||||
Reference in New Issue
Block a user