gongxiangp2/components/upload/upload-types.ts

36 lines
947 B
TypeScript

// 上传相关的类型定义
// 统一的批量上传数据结构(改进版:每个文件可独立配置)
export interface BatchFileItem {
id: string // 唯一ID
file: File
expanded: boolean // 是否展开显示配置
productModel: string
previewImage?: File // 预览图(如果需要)
previewImageUrl?: string // 预览图URL
categoryName: string
sceneName: string
platformName: string
productCategoryName: string
renderer?: string // 3D场景专用
}
// 批量上传详细状态
export interface BatchUploadStatus {
currentFileIndex: number
totalFiles: number
currentFileName: string
currentFileProgress: number
currentFileSpeed: number
fileStatuses: Array<{
fileName: string
status: 'pending' | 'uploading' | 'processing' | 'done' | 'failed'
progress: number
error?: string
uploadId?: string // 跟踪每个文件的上传ID
}>
isCancelled: boolean
startTime: number
}