diff --git a/desktop/src/features/download/DownloadManagerView.vue b/desktop/src/features/download/DownloadManagerView.vue index 1715b74..639cf33 100644 --- a/desktop/src/features/download/DownloadManagerView.vue +++ b/desktop/src/features/download/DownloadManagerView.vue @@ -95,9 +95,20 @@ function noteText(job: DownloadJob) { text = "保存编号进度时文件被拒绝访问,已下载的内容还在,点继续即可"; } if (!text || text === statusLabel(job)) return ""; + if (text === "正在读取并下载" || text === "准备中") return ""; + if (/^已完成 \d+(,已读取 \d+)?(,失败 \d+)?$/.test(text)) return ""; + if (/^已完成 \d+\/\d+,失败 \d+$/.test(text)) return ""; return text; } +function cardFacts(job: DownloadJob) { + if (waitingToRead(job)) return [job.id, "等待读取编号", `已写入 ${job.writtenRows} 行`]; + const progress = scanning(job) + ? [`已下载 ${job.completed}`, `已读取 ${job.discovered || 0} 个栅格`] + : [`${job.completed}/${job.total} 个栅格`]; + return [job.id, ...progress, `已写入 ${job.writtenRows} 行`]; +} + function waitingToRead(job: DownloadJob) { return Boolean(job.wholeCity) && job.status === "queued"; } @@ -183,15 +194,6 @@ async function changeConcurrency(job: DownloadJob, value: number | null) { } } -function countText(job: DownloadJob) { - const written = `已写入 ${job.writtenRows} 行`; - if (waitingToRead(job)) return `${job.id} · 等待读取 · ${written}`; - const progress = scanning(job) - ? `已完成 ${job.completed} · 已读取 ${job.discovered || 0} 个栅格` - : `${job.completed}/${job.total} 个栅格`; - return `${job.id} · ${progress} · ${written}`; -} - async function saveLimit(value: number | null) { if (!value) return; try { @@ -481,7 +483,9 @@ async function removeJob(job: DownloadJob, files: boolean) {

{{ job.name }}

-
{{ countText(job) }}
+
+ {{ fact }} +
@@ -519,9 +523,9 @@ async function removeJob(job: DownloadJob, files: boolean) { {{ statusLabel(job) }} - {{ noteText(job) }} + {{ noteText(job) }} - 失败 {{ job.failed }} · {{ formatSize(job.fileBytes) }} + 失败 {{ job.failed }} · {{ formatSize(job.fileBytes) }}