feat: add batch processing for multiple file uploads

- Add BatchState management in taskStore with progress tracking
- Implement batch processing service with concurrency control
  - Direct Track: max 5 parallel tasks
  - OCR Track: sequential processing (GPU VRAM limit)
- Refactor ProcessingPage to support batch mode with BatchProcessingPanel
- Update UploadPage to initialize batch state for multi-file uploads
- Add i18n translations for batch processing (zh-TW, en-US)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-12 17:05:16 +08:00
parent d5bc311757
commit d20751d56b
11 changed files with 1469 additions and 5 deletions

View File

@@ -0,0 +1,42 @@
# Tasks: 新增批次處理功能
## 1. 批次狀態管理
- [x] 1.1 擴展 taskStore 新增批次狀態介面BatchState
- [x] 1.2 實作批次任務追蹤taskIds、taskStates
- [x] 1.3 實作批次進度計算total、completed、processing、failed
- [x] 1.4 實作批次設定儲存processingOptions
## 2. 批次處理邏輯
- [x] 2.1 新增批次分析函數(分析所有任務決定 track
- [x] 2.2 實作 Direct Track 並行處理(最多 5 並行)
- [x] 2.3 實作 OCR Track 佇列處理(單一佇列)
- [x] 2.4 實作混合模式處理Direct 和 OCR 同時進行)
- [x] 2.5 實作任務狀態輪詢與更新
## 3. 上傳頁面調整
- [x] 3.1 修改 UploadPage 上傳完成後儲存所有 taskIds
- [x] 3.2 導航至 ProcessingPage 時傳遞批次模式標記
## 4. 處理頁面重構
- [x] 4.1 修改 ProcessingPage 支援批次模式
- [x] 4.2 新增批次設定區塊(策略選擇、統一設定)
- [x] 4.3 新增批次進度顯示元件
- [x] 4.4 新增任務列表顯示(各任務狀態)
- [x] 4.5 實作批次開始處理按鈕
## 5. i18n 翻譯
- [x] 5.1 新增批次處理相關中文翻譯
- [x] 5.2 新增批次處理相關英文翻譯
## 6. 測試與驗證
- [x] 6.1 測試單檔案處理(向下相容)
- [x] 6.2 測試多檔案 Direct Track 並行
- [x] 6.3 測試多檔案 OCR Track 佇列
- [x] 6.4 測試混合模式處理
- [x] 6.5 驗證 TypeScript 編譯通過