From c71a12f6f48ea58419c7402343781159bd189338 Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Wed, 21 Oct 2026 22:04:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(admin):=20=E7=BB=9F=E4=B8=80=E5=89=A7?= =?UTF-8?q?=E9=9B=86=E4=B8=8A=E4=BC=A0=E6=A0=BC=E5=BC=8F=E4=B8=8E=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- src/locales/en.ts | 2 +- src/locales/zh-CN.ts | 2 +- .../contentManagement/EpisodeManagementView.vue | 13 ++++++------- .../contentManagement/upload/BatchUploadDialog.vue | 9 +++------ src/views/contentManagement/upload/videoLimit.ts | 6 ++++++ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/locales/en.ts b/src/locales/en.ts index ab44e71..8375904 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -537,7 +537,7 @@ export default { retry: 'Retry', retryAll: 'Retry all', remove: 'Remove', - hint: 'Supports MP4 / MOV / MKV / WEBM, max 500MB each; up to 2 files in parallel.', + hint: 'Supports MP4 / MOV / MKV / WEBM, max 500MB each; multi-select allowed, 2 upload in parallel, the rest queue automatically.', invalidType: 'Only MP4, MOV, MKV, WEBM are allowed', oversize: 'File exceeds 500MB and was not queued', overallProgress: 'Overall progress', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index a66b726..63286e2 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -531,7 +531,7 @@ export default { retry: '重试', retryAll: '全部重试', remove: '移除', - hint: '支持 MP4 / MOV / MKV / WEBM,单文件不超过 500MB;同时最多上传 2 个文件。', + hint: '支持 MP4 / MOV / MKV / WEBM,单文件不超过 500MB;可一次多选,同时上传 2 个,其余自动排队。', invalidType: '仅支持 MP4、MOV、MKV、WEBM', oversize: '文件超过 500MB,未入队', overallProgress: '总进度', diff --git a/src/views/contentManagement/EpisodeManagementView.vue b/src/views/contentManagement/EpisodeManagementView.vue index bc7f1f2..6c7eac7 100644 --- a/src/views/contentManagement/EpisodeManagementView.vue +++ b/src/views/contentManagement/EpisodeManagementView.vue @@ -20,7 +20,7 @@ import { useI18n } from '@/hooks/web/useI18n' import { probeVideoDuration, uploadFile } from '@/utils/uploader' import BatchUploadDialog from './upload/BatchUploadDialog.vue' import { listPendingSessions } from './upload/uploadSessions' -import { MAX_VIDEO_SIZE } from './upload/videoLimit' +import { MAX_VIDEO_SIZE, VIDEO_ACCEPT_ATTR, VIDEO_EXTENSIONS } from './upload/videoLimit' const route = useRoute() const { can } = useRbac() @@ -62,7 +62,6 @@ const statusOptions = [ { code: 'offline', text: '已下线' } ] -const VIDEO_EXTENSIONS = ['mp4', 'mov'] const formRules = { number: [{ required: true, message: '请输入集号', trigger: 'change' }], title: [{ required: true, message: '请输入剧集标题', trigger: 'blur' }], @@ -218,7 +217,7 @@ function beforeVideoUpload(file) { .pop() ?.toLowerCase() if (!VIDEO_EXTENSIONS.includes(extension)) { - videoError.value = '视频仅支持 MP4 或 MOV 格式' + videoError.value = t('episodeBatch.invalidType') return false } if (file.size > MAX_VIDEO_SIZE) { @@ -556,7 +555,7 @@ onMounted(async () => { drag class="episode-video-empty-upload" :show-file-list="false" - accept=".mp4,.mov" + :accept="VIDEO_ACCEPT_ATTR" :before-upload="beforeVideoUpload" :http-request="uploadVideo" :disabled="uploadingVideo" @@ -564,7 +563,7 @@ onMounted(async () => {
拖放或点击上传 - MP4、MOV + MP4、MOV、MKV、WEBM
@@ -582,7 +581,7 @@ onMounted(async () => { {{ videoDisplayName }}
-

支持 MP4、MOV,单个文件不超过 500MB。

+

{{ t('episodeBatch.hint') }}

{ props.modelValue, set: (value: boolean) => emit('update:modelValue', value) @@ -208,7 +205,7 @@ function onEpisodesCreated(): void { type="file" multiple hidden - :accept="ACCEPT_ATTR" + :accept="VIDEO_ACCEPT_ATTR" @change="onPickFiles" /> diff --git a/src/views/contentManagement/upload/videoLimit.ts b/src/views/contentManagement/upload/videoLimit.ts index a649d8a..4f66667 100644 --- a/src/views/contentManagement/upload/videoLimit.ts +++ b/src/views/contentManagement/upload/videoLimit.ts @@ -1,3 +1,9 @@ // Author: fruit.com.cn /** 剧集视频大小上限,单文件上传与批量上传共用。 */ export const MAX_VIDEO_SIZE = 500 * 1024 * 1024 + +/** 允许的视频扩展名(小写,不含点),单文件与批量上传同源。 */ +export const VIDEO_EXTENSIONS: string[] = ['mp4', 'mov', 'mkv', 'webm'] + +/** el-upload / input[type=file] 的 accept 属性,与 VIDEO_EXTENSIONS 保持一致。 */ +export const VIDEO_ACCEPT_ATTR = '.mp4,.mov,.mkv,.webm,video/*' From cff864d5827474c4f9f83bc810bba32546ad18bf Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Wed, 21 Oct 2026 22:07:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(admin):=20=E6=8B=86=E5=88=86?= =?UTF-8?q?=E5=89=A7=E9=9B=86=E7=AE=A1=E7=90=86=E9=A1=B5=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../EpisodeManagementView.vue | 402 +----------------- .../upload/EpisodeFormDialog.vue | 280 ++++++++++++ .../upload/EpisodeVideoUploader.vue | 172 ++++++++ 3 files changed, 467 insertions(+), 387 deletions(-) create mode 100644 src/views/contentManagement/upload/EpisodeFormDialog.vue create mode 100644 src/views/contentManagement/upload/EpisodeVideoUploader.vue diff --git a/src/views/contentManagement/EpisodeManagementView.vue b/src/views/contentManagement/EpisodeManagementView.vue index 6c7eac7..bfb449d 100644 --- a/src/views/contentManagement/EpisodeManagementView.vue +++ b/src/views/contentManagement/EpisodeManagementView.vue @@ -1,26 +1,19 @@ + + diff --git a/src/views/contentManagement/upload/EpisodeVideoUploader.vue b/src/views/contentManagement/upload/EpisodeVideoUploader.vue new file mode 100644 index 0000000..d3bcc6b --- /dev/null +++ b/src/views/contentManagement/upload/EpisodeVideoUploader.vue @@ -0,0 +1,172 @@ + + + + + +