gongxiangp2/components/upload/upload-types.ts
chenpei 752b7bf999 fix: 修复批量上传和视频扩展名问题
主要修复:

- 修复批量上传闭包陷阱,防止文件丢失

- 添加 fileName 参数传递原始文件名,保留正确扩展名

- 添加取消检查回调,改进批量上传取消功能

其他改进:

- 优化搜索功能和管理后台

- 添加 FRP 故障诊断文档

- 更新环境验证和网络检测
2026-02-03 11:12:50 +08:00

37 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 上传相关的类型定义
// 统一的批量上传数据结构(改进版:每个文件可独立配置)
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
}