主要修复: - 修复批量上传闭包陷阱,防止文件丢失 - 添加 fileName 参数传递原始文件名,保留正确扩展名 - 添加取消检查回调,改进批量上传取消功能 其他改进: - 优化搜索功能和管理后台 - 添加 FRP 故障诊断文档 - 更新环境验证和网络检测
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
// 上传相关的类型定义
|
||
|
||
// 统一的批量上传数据结构(改进版:每个文件可独立配置)
|
||
export interface BatchFileItem {
|
||
id: string // 唯一ID
|
||
file: File
|
||
expanded: boolean // 是否展开显示配置
|
||
productModel: string
|
||
productModelSource?: 'filename' | 'manual' | 'sync' // SPU来源:filename=从文件名提取(可覆盖), manual=用户手动输入(不可覆盖), sync=自动同步(可覆盖)
|
||
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
|
||
}
|
||
|