增加公共下载进度、增加接收SKU、密钥分别存放

This commit is contained in:
super
2026-05-28 16:41:20 +08:00
parent ca4a2cd07a
commit 2ed1250604
119 changed files with 4077 additions and 293 deletions

View File

@@ -266,6 +266,7 @@ import { expandBrandFolderRecursive } from '@/shared/api/brand'
import { getPywebviewApi, type UploadedJavaFile } from '@/shared/bridges/pywebview'
import { getTaskPollIntervalMs } from '@/shared/task-progress-config'
import { createCategorizedTimers } from '@/shared/utils/categorized-timers'
import { saveUrlWithProgress } from '@/shared/utils/download-progress'
import {
addPriceTrackCandidate,
completePriceTrackLoopChild,
@@ -1604,14 +1605,9 @@ function canDownload(item: PriceTrackHistoryItem) {
async function downloadResult(item: PriceTrackHistoryItem) {
if (!item.resultId) return
const api = getPywebviewApi()
const filename = item.outputFilename || `${item.shopName || 'result'}.xlsx`
if (!api?.save_file_from_url_new) {
ElMessage.error('当前客户端未提供 save_file_from_url_new无法下载文件')
return
}
const url = getPriceTrackResultDownloadUrl(item.resultId)
const result = await api.save_file_from_url_new(url, filename)
const result = await saveUrlWithProgress(url, filename, `price-track:${item.resultId}`)
if (result.success) {
ElMessage.success(`已保存:${result.path || filename}`)
} else if (result.error && result.error !== '用户取消') {