增加公共下载进度、增加接收SKU、密钥分别存放
This commit is contained in:
@@ -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 !== '用户取消') {
|
||||
|
||||
Reference in New Issue
Block a user