From 9b2ab1a42516e4b0aa587a4ed84a56ae7d8c4a5b Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Thu, 22 Oct 2026 15:12:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E8=BD=AC=E7=A0=81=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=B1=95=E7=A4=BA=E5=AE=9E=E6=97=B6=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E4=B8=8E=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plans/2026-10-22-transcode-progress-ui.md | 12 +++++++ docs/plans/PROGRESS.md | 36 +++++++++++++++++++ src/api/admin/types.ts | 1 + src/locales/en.ts | 2 ++ src/locales/zh-CN.ts | 2 ++ .../upload/EpisodeTranscodeStatusPanel.vue | 14 ++++++++ 6 files changed, 67 insertions(+) create mode 100644 docs/plans/2026-10-22-transcode-progress-ui.md diff --git a/docs/plans/2026-10-22-transcode-progress-ui.md b/docs/plans/2026-10-22-transcode-progress-ui.md new file mode 100644 index 0000000..09d29fa --- /dev/null +++ b/docs/plans/2026-10-22-transcode-progress-ui.md @@ -0,0 +1,12 @@ +# 转码面板实时进度与更新时间 + +## 目标 + +- 展示后端 task progress、状态文案与 updatedAt。 +- RUNNING/QUEUED 且 progress=0 时显示“处理中(等待进度上报)”。 +- FAILED 保持错误信息与重新转码入口。 +- 保持现有轮询停止、关闭清理与字符串 ID 逻辑。 + +## 验证 + +- `pnpm lint:eslint`、`pnpm build:dev`。 diff --git a/docs/plans/PROGRESS.md b/docs/plans/PROGRESS.md index dc523d6..17e05b2 100644 --- a/docs/plans/PROGRESS.md +++ b/docs/plans/PROGRESS.md @@ -151,3 +151,39 @@ Build successful. Please see dist-dev directory 解读:字符串 id 链路、类型检查、ESLint 与开发构建均通过; 循环 chunk 为项目既有警告。 + +## 2026-10-22 转码面板实时进度与更新时间 + +- 分支:`feature/transcode-progress-ui` +- 基线:`develop` / `origin/develop` = `0d5d0d8` +- 计划:`docs/plans/2026-10-22-transcode-progress-ui.md` + +后端将补充 task.updatedAt;前端在现有轮询面板中展示进度、状态、 +最近更新时间,并在 RUNNING/QUEUED progress=0 时显示等待进度上报提示。 + +### 实现 + +- `EpisodeTranscodeItem` 增加 `updatedAt`。 +- 状态区展示“最近更新”,格式沿用 `formatDateTime`。 +- RUNNING/QUEUED 且 progress=0 时显示“处理中(等待进度上报)”。 +- SUCCESS/FAILED 继续停止轮询;关闭面板继续清理定时器。 +- 所有 id 保持字符串传递,不引入 Number 转换。 + +### 门禁 + +```text +$ pnpm lint:eslint +> eslint --fix --ext .js,.ts,.vue ./src +(0 error / 0 warning) + +$ pnpm ts:check +> vue-tsc --noEmit --skipLibCheck +(通过) + +$ pnpm build:dev + WARN Circular chunk: element-plus -> vue-chunks -> element-plus. +Build successful. Please see dist-dev directory +``` + +解读:进度与更新时间类型、ESLint、TypeScript 和开发构建全部通过; +循环 chunk 为项目既有警告。 diff --git a/src/api/admin/types.ts b/src/api/admin/types.ts index 8a84f0f..a58f120 100644 --- a/src/api/admin/types.ts +++ b/src/api/admin/types.ts @@ -311,6 +311,7 @@ export interface EpisodeTranscodeItem { progress?: number retryCount?: number errorMsg?: string + updatedAt?: string renditions: MediaRenditionItem[] thumbnails?: MediaThumbnailResult | null } diff --git a/src/locales/en.ts b/src/locales/en.ts index 3cefb8a..b0dbe88 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -535,6 +535,8 @@ export default { statusLabel: 'Status', progress: 'Progress', retryCount: 'Retries', + updatedAt: 'Last updated', + waitingProgress: 'Processing (waiting for progress report)', reprocess: 'Transcode again', reprocessing: 'Submitting', triggerSuccess: 'Transcode task submitted', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 91de289..9865516 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -529,6 +529,8 @@ export default { statusLabel: '状态', progress: '进度', retryCount: '重试次数', + updatedAt: '最近更新', + waitingProgress: '处理中(等待进度上报)', reprocess: '重新转码', reprocessing: '正在触发', triggerSuccess: '已提交转码任务', diff --git a/src/views/contentManagement/upload/EpisodeTranscodeStatusPanel.vue b/src/views/contentManagement/upload/EpisodeTranscodeStatusPanel.vue index d562a42..622f933 100644 --- a/src/views/contentManagement/upload/EpisodeTranscodeStatusPanel.vue +++ b/src/views/contentManagement/upload/EpisodeTranscodeStatusPanel.vue @@ -6,6 +6,7 @@ import type { EpisodeTranscodeItem } from '@/api/admin/types' import { AppIcon } from '@/components/AppIcon' import { AppIcons } from '@/constants/icons' import { useI18n } from '@/hooks/web/useI18n' +import { formatDateTime } from '@/utils/format' import type { TranscodeProgressStatus, TranscodeTagType } from './episodeTranscodeUi' interface StatusView { @@ -64,6 +65,10 @@ const { t } = useI18n() {{ t('episodeTranscode.retryCount') }} {{ detail.retryCount || 0 }} +
+ {{ t('episodeTranscode.updatedAt') }} + {{ formatDateTime(detail.updatedAt) }} +
+

+ {{ t('episodeTranscode.waitingProgress') }} +