✨ feat: 支持单个、选中及全量手动检测下载状态

* 默认关闭定时检测,取消页面加载、翻页和刷新列表触发检测
* 提供明确的检测可下载状态入口,支持全量跨分页和选中文件
* 逐个读取文件并显示进度,支持取消及过期响应隔离
* 保持检测结果标签与时间展示,验证桌面和移动端交互
* 补充手动范围、失败重试、取消及跨页全量检测的集成验收
This commit is contained in:
orion committed 2026-09-19 01:24:16 +08:00
1 parent fe6d812857
commit 3d70f67cf7
7 files changed
+243 -86

No files matched your search

+17 -6
View File
@@ -16,9 +16,9 @@
<div class="mb-4 flex flex-wrap items-center gap-3 text-sm" :class="mutedTextClass">
<label class="flex items-center gap-2">
下载状态刷新
自动检测当前页
<select :value="downloadCheckInterval" :disabled="savingCheckInterval" class="min-h-11 rounded-lg border px-3" :class="fieldClass" @change="handleCheckIntervalChange">
<option :value="0">仅手动刷新</option>
<option :value="0">仅手动检测</option>
<option :value="30">每 30 秒</option>
<option :value="60">每分钟</option>
<option :value="300">每 5 分钟</option>
@@ -26,7 +26,10 @@
<option :value="1800">每 30 分钟</option>
</select>
</label>
<span class="text-xs">仅检测当前页;刷新列表会重新检测,不消耗取件次数。</span>
<BaseButton variant="secondary" :disabled="!hasSelectedFiles || checkingDownloads" @click="checkDownloadIds([...selectedFileIds])">检测选中可下载状态({{ selectedCount }})</BaseButton>
<BaseButton variant="secondary" :disabled="checkingDownloads" @click="checkAllDownloads" title="检测全部文件,包括未显示的分页">检测可下载状态</BaseButton>
<BaseButton v-if="checkingDownloads" variant="outline" @click="cancelDownloadChecks">取消检测</BaseButton>
<span v-if="downloadProgressText" role="status">{{ downloadProgressText }} {{ downloadProgress.completed }}/{{ downloadProgress.total }}</span>
<span v-if="checkIntervalError" role="alert" class="text-red-500">{{ checkIntervalError }}</span>
</div>
@@ -380,7 +383,10 @@
{{ file.displayHealthState }}
</span>
</div>
<DownloadCheckStatus class="mt-2" :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<div class="mt-2 flex items-center justify-between gap-2">
<DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<BaseButton variant="outline" size="sm" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton>
</div>
<div class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-xs" :class="[mutedTextClass]">
<span>{{ file.code }} · {{ file.displaySize }}</span>
<span class="text-right">{{ file.displayUsage }}</span>
@@ -714,7 +720,10 @@
</span>
</td>
<td class="px-6 py-4" :class="primaryTextClass">
<DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<div class="flex items-center gap-2">
<DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<BaseButton variant="outline" size="sm" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<div class="flex items-center justify-end gap-2">
@@ -1880,7 +1889,9 @@ const {
const {
interval: downloadCheckInterval, saving: savingCheckInterval, error: checkIntervalError,
statusFor: downloadStatusFor, loadInterval: loadCheckInterval, saveInterval: saveCheckInterval
statusFor: downloadStatusFor, loadInterval: loadCheckInterval, saveInterval: saveCheckInterval,
checking: checkingDownloads, progress: downloadProgress, progressText: downloadProgressText,
checkIds: checkDownloadIds, checkAll: checkAllDownloads, cancel: cancelDownloadChecks
} = useDownloadChecks(tableData)
const handleCheckIntervalChange = (event: Event) => {
void saveCheckInterval(Number((event.target as HTMLSelectElement).value))