Skip to content

🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"

TypeScript

feat(episode): 导出页镜头预览+手动标记完成,区条改显画面比例

Connorad7543285e7d
diff --git a/frontend/app/locales/en.json b/frontend/app/locales/en.json
index 88dab2a..9f29e6f 100644
--- a/frontend/app/locales/en.json
+++ b/frontend/app/locales/en.json
@@ -465,7 +465,7 @@
"mergeExport": "Merge & Export",
"scriptStage": "Script · {step}",
"prodStage": "Production · {step}",
- "exportDone": "Export · film ready",
+ "exportDone": "Export · done",
"exportWaiting": "Export · waiting to merge",
"workbench": "Workbench"
},
@@ -630,7 +630,7 @@
"startBreak": "Break down & generate prompts",
"promptProgress": "Prompts {done}/{total}",
"promptSelected": "Generate selected prompts ({n})",
- "batchPrompts": "Fill missing prompts",
+ "batchPrompts": "Batch Fill Prompts",
"listTitle": "Shot List",
"listSub": "Check breakdown descriptions and bound characters/scenes",
"select": "Select",
@@ -742,7 +742,8 @@
"confirmResolution": "Resolution",
"confirmNote": "Generation will start shot by shot with the above config; failed tasks can be retried later via \"Retry failed\".",
"confirmStart": "Start ({n})",
- "selectMissing": "Select without video"
+ "selectMissing": "Select without video",
+ "aspectRatio": "Aspect Ratio"
},
"inspector": {
"videoPromptPlaceholder": "Reference assets with {'@'}character / {'@'}scene — auto-mapped to reference images on generation; then describe motion and camera per time segment…",
@@ -789,7 +790,14 @@
"merging": "Merging…",
"mergingToast": "Merging...",
"mergeDone": "Merge complete",
- "mergeFailed": "Merge failed"
+ "mergeFailed": "Merge failed",
+ "previewShot": "Play this shot",
+ "shotPreview": "Shot #{n} preview",
+ "markDone": "Mark done",
+ "markedDone": "Done",
+ "markDoneTitle": "Manually mark this episode's export as done (click again to undo)",
+ "markedDoneToast": "Marked as done",
+ "unmarkDoneToast": "Done mark removed"
},
"image": {
"generatingChar": "Character image generating",
diff --git a/frontend/app/locales/ja.json b/frontend/app/locales/ja.json
index dec65ab..07e0ebc 100644
--- a/frontend/app/locales/ja.json
+++ b/frontend/app/locales/ja.json
@@ -465,7 +465,7 @@
"mergeExport": "結合して書き出し",
"scriptStage": "脚本段階 · {step}",
"prodStage": "制作段階 · {step}",
- "exportDone": "書き出し段階 · 映像完成",
+ "exportDone": "書き出し段階 · 完了",
"exportWaiting": "書き出し段階 · 結合待ち",
"workbench": "ワークベンチ"
},
@@ -630,7 +630,7 @@
"startBreak": "分割してプロンプト生成",
"promptProgress": "プロンプト {done}/{total}",
"promptSelected": "選択分のプロンプト生成({n})",
- "batchPrompts": "不足プロンプトを補完",
+ "batchPrompts": "一括でプロンプトを補完",
"listTitle": "分镜一覧",
"listSub": "分解の説明と紐付いたキャラクター・シーンを確認",
"select": "選択",
@@ -742,7 +742,8 @@
"confirmResolution": "解像度",
"confirmNote": "上記の設定でショットごとに生成を開始します。失敗したタスクは後で「失敗を再試行」からまとめて再実行できます。",
"confirmStart": "生成開始 ({n})",
- "selectMissing": "未生成を選択"
+ "selectMissing": "未生成を選択",
+ "aspectRatio": "アスペクト比"
},
"inspector": {
"videoPromptPlaceholder": "{'@'}キャラクター名 / {'@'}シーン名 で参照素材を指定(生成時に参照画像へ自動マッピング)。時間帯ごとに画面の動きとカメラを記述…",
@@ -789,7 +790,14 @@
"merging": "結合中…",
"mergingToast": "結合中...",
"mergeDone": "結合が完了しました",
- "mergeFailed": "結合に失敗しました"
+ "mergeFailed": "結合に失敗しました",
+ "previewShot": "このショットを再生",
+ "shotPreview": "ショット #{n} プレビュー",
+ "markDone": "完了にする",
+ "markedDone": "完了",
+ "markDoneTitle": "このエピソードの書き出しを手動で完了にします(再クリックで解除)",
+ "markedDoneToast": "完了としてマークしました",
+ "unmarkDoneToast": "完了マークを解除しました"
},
"image": {
"generatingChar": "キャラクター画像を生成中",
diff --git a/frontend/app/locales/ko.json b/frontend/app/locales/ko.json
index 9e33e6e..7ff55df 100644
--- a/frontend/app/locales/ko.json
+++ b/frontend/app/locales/ko.json
@@ -465,7 +465,7 @@
"mergeExport": "병합 납출",
"scriptStage": "대본 단계 · {step}",
"prodStage": "제작 단계 · {step}",
- "exportDone": "납출 단계 · 영상 완성",
+ "exportDone": "납출 단계 · 완료",
"exportWaiting": "납출 단계 · 병합 대기",
"workbench": "워크벤치"
},
@@ -630,7 +630,7 @@
"startBreak": "분할 및 프롬프트 생성",
"promptProgress": "프롬프트 {done}/{total}",
"promptSelected": "선택분 프롬프트 생성({n})",
- "batchPrompts": "누락 프롬프트 채우기",
+ "batchPrompts": "일괄 프롬프트 채우기",
"listTitle": "스토리보드 목록",
"listSub": "분해 설명과 연결된 캐릭터·장면 확인",
"select": "선택",
@@ -742,7 +742,8 @@
"confirmResolution": "해상도",
"confirmNote": "위 설정으로 샷별로 생성을 시작합니다. 실패한 작업은 나중에 「실패 재시도」로 한 번에 다시 실행할 수 있습니다.",
"confirmStart": "생성 시작 ({n})",
- "selectMissing": "미생성 선택"
+ "selectMissing": "미생성 선택",
+ "aspectRatio": "화면 비율"
},
"inspector": {
"videoPromptPlaceholder": "{'@'}캐릭터명 / {'@'}장멸명 으로 참조 소재를 지정(생성 시 참조 이미지로 자동 매핑). 시간대별로 화면의 움직임과 침라를 기술…",
@@ -789,7 +790,14 @@
"merging": "병합 중…",
"mergingToast": "병합 중...",
"mergeDone": "병합이 완료되었습니다",
- "mergeFailed": "병합에 실패했습니다"
+ "mergeFailed": "병합에 실패했습니다",
+ "previewShot": "이 샷 재생",
+ "shotPreview": "샷 #{n} 미리보기",
+ "markDone": "완료로 표시",
+ "markedDone": "완료됨",
+ "markDoneTitle": "이 에피소드의 납출을 수동으로 완료 표시(다시 클릭하면 해제)",
+ "markedDoneToast": "완료로 표시했습니다",
+ "unmarkDoneToast": "완료 표시를 해제했습니다"
},
"image": {
"generatingChar": "캐릭터 이미지 생성 중",
diff --git a/frontend/app/locales/zh.json b/frontend/app/locales/zh.json
index 6e4a89f..0a1e590 100644
--- a/frontend/app/locales/zh.json
+++ b/frontend/app/locales/zh.json
@@ -465,7 +465,7 @@
"mergeExport": "拼接导出",
"scriptStage": "剧本阶段 · {step}",
"prodStage": "制作阶段 · {step}",
- "exportDone": "导出阶段 · 成片已生成",
+ "exportDone": "导出阶段 · 已完成",
"exportWaiting": "导出阶段 · 等待拼接",
"workbench": "工作台"
},
@@ -630,7 +630,7 @@
"startBreak": "拆分并生成提示词",
"promptProgress": "提示词 {done}/{total}",
"promptSelected": "生成所选提示词({n})",
- "batchPrompts": "补齐提示词",
+ "batchPrompts": "批量补齐提示词",
"listTitle": "分镜列表",
"listSub": "检查拆分描述和绑定的角色场景",
"select": "选择",
@@ -742,7 +742,8 @@
"confirmResolution": "分辨率",
"confirmNote": "将按以上配置逐镜头发起生成;失败的任务之后可点「重试失败」一键重跑。",
"confirmStart": "开始生成 ({n})",
- "selectMissing": "选未生成"
+ "selectMissing": "选未生成",
+ "aspectRatio": "画面比例"
},
"inspector": {
"videoPromptPlaceholder": "用 {'@'}角色名 / {'@'}场景名 引用参考素材,生成时自动映射为参考图片;再按时间段描述画面运动与镜头…",
@@ -789,7 +790,14 @@
"merging": "拼接中…",
"mergingToast": "拼接中...",
"mergeDone": "拼接完成",
- "mergeFailed": "拼接失败"
+ "mergeFailed": "拼接失败",
+ "previewShot": "播放该镜头",
+ "shotPreview": "镜头 #{n} 预览",
+ "markDone": "标记完成",
+ "markedDone": "已完成",
+ "markDoneTitle": "手动标记本集导出完成(可再次点击取消)",
+ "markedDoneToast": "已标记为完成",
+ "unmarkDoneToast": "已取消完成标记"
},
"image": {
"generatingChar": "角色图片生成中",
diff --git a/frontend/app/views/drama/episode.vue b/frontend/app/views/drama/episode.vue
index ee513f5..766fef3 100644
--- a/frontend/app/views/drama/episode.vue
+++ b/frontend/app/views/drama/episode.vue
@@ -253,7 +253,6 @@
<div class="prod-section-bar">
<span class="dim" style="font-size:12px">{{ t('episode.prod.assets') }}</span>
<span class="tag mono">{{ t('episode.prod.readyCount', { ready: assetReadyCount, total: assetTotalCount }) }}</span>
- <span class="tag">{{ lockedImageConfigLabel }}</span>
<div class="ml-auto flex gap-1 asset-bar-actions">
<button
v-for="et in EXTRACT_TARGETS"
@@ -484,7 +483,7 @@
<div class="prod-section-bar">
<span class="dim" style="font-size:12px">{{ t('episode.prod.videos') }}</span>
<span class="tag mono">{{ t('episode.sb.segmentStat', { n: sbs.length, dur: totalDuration }) }}</span>
- <span class="tag">{{ lockedVideoConfigLabel }}</span>
+ <span class="tag mono" :title="t('episode.vid.aspectRatio')">{{ dramaAspectRatio }}</span>
<div class="ml-auto flex gap-1">
<button class="btn btn-sm" :disabled="rn" @click="doBreakdown">
<Loader2 v-if="rt === 'storyboard_breaker'" :size="11" class="animate-spin" />
@@ -515,7 +514,7 @@
</div>
<div class="empty-title">{{ t('episode.sb.emptyTitle') }}</div>
<div class="empty-desc">{{ t('episode.sb.emptyDesc') }}</div>
- <div class="locked-config-banner">{{ t('episode.vid.lockedModel') }}{{ lockedVideoConfigLabel }}</div>
+ <div class="locked-config-banner">{{ t('episode.vid.lockedModel') }}{{ effectiveVideoModelLabel }}</div>
<button class="btn btn-primary" :disabled="rn" @click="doBreakdown">
<Loader2 v-if="rt === 'storyboard_breaker'" :size="13" class="animate-spin" />
<svg v-else width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
@@ -859,7 +858,15 @@
<div class="export-section-head">
<span class="export-section-title">{{ t('episode.export.filmList') }}</span>
<span class="dim" style="font-size:11px">{{ t('episode.export.countN', { n: exportMerges.length }) }}</span>
- <button class="btn btn-sm ml-auto" @click="loadExportMerges">
+ <button
+ :class="['btn btn-sm ml-auto export-done-btn', { on: exportDone }]"
+ :title="t('episode.export.markDoneTitle')"
+ @click="toggleExportDone"
+ >
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
+ {{ exportDone ? t('episode.export.markedDone') : t('episode.export.markDone') }}
+ </button>
+ <button class="btn btn-sm" @click="loadExportMerges">
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
{{ t('common.refresh') }}
</button>
@@ -954,6 +961,14 @@
</div>
<span class="exp-thumb-index">#{{ String(i+1).padStart(2,'0') }}</span>
<span v-if="sb.duration" class="exp-thumb-duration">{{ sb.duration }}s</span>
+ <span
+ v-if="hasVid(sb)"
+ class="exp-play"
+ :title="t('episode.export.previewShot')"
+ @click.stop="previewShot = sb"
+ >
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="6 3 20 12 6 21 6 3"/></svg>
+ </span>
<span v-if="hasVid(sb)" :class="['exp-check', isExportSelected(sb.id) && 'on']">
<svg v-if="isExportSelected(sb.id)" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
</span>
@@ -1284,6 +1299,32 @@
</div>
</div>
+ <div v-if="previewShot" class="overlay image-viewer-overlay" @click.self="previewShot = null">
+ <div class="dialog image-viewer-dialog merge-viewer-dialog">
+ <div class="image-viewer-head">
+ <div class="image-viewer-title">{{ t('episode.export.shotPreview', { n: shotNumberOf(previewShot) }) }}</div>
+ <span v-if="previewShot.duration" class="dim" style="font-size:11px">{{ previewShot.duration }}s</span>
+ <a :href="'/' + getVideoUrl(previewShot)" download class="btn btn-sm" style="margin-left:auto">
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
+ {{ t('common.download') }}
+ </a>
+ <button class="btn btn-ghost btn-icon" @click="previewShot = null">
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
+ </button>
+ </div>
+ <div class="merge-viewer-body">
+ <video
+ :key="previewShot.id"
+ :src="'/' + getVideoUrl(previewShot)"
+ controls
+ autoplay
+ playsinline
+ class="merge-viewer-video"
+ />
+ </div>
+ </div>
+ </div>
+
<div v-if="activeMerge" class="overlay image-viewer-overlay" @click.self="activeMerge = null">
<div class="dialog image-viewer-dialog merge-viewer-dialog">
<div class="image-viewer-head">
@@ -1424,7 +1465,6 @@ const scriptContent = computed(() => episode.value?.script_content || episode.va
const epId = computed(() => episode.value?.id || 0)
const rawLen = computed(() => localRaw.value.replace(/\s/g, '').length || 0)
const scriptLen = computed(() => localScript.value.replace(/\s/g, '').length || 0)
-const mergeUrl = computed(() => mergeData.value?.merged_url || mergeData.value?.mergedUrl || null)
// ===== 拼接导出:镜头选择 + 成片列表 =====
const exportSelectedIds = ref([]) // 勾选的镜头 id
@@ -1569,6 +1609,24 @@ function closeTaskDrawer() {
}
const imageViewer = ref({ open: false, src: '', title: '' })
const activeMerge = ref(null) // 成片大预览弹窗中正在播放的拼接记录
+const previewShot = ref(null) // 导出页镜头素材预览弹窗中正在播放的分镜
+function shotNumberOf(sb) {
+ const i = sbs.value.findIndex(s => s.id === sb?.id)
+ return i >= 0 ? i + 1 : 0
+}
+// 导出步骤完成 = 用户手动标记(episodes.status = 'completed'),不再按最新拼接记录推算
+const exportDone = computed(() => episode.value?.status === 'completed')
+async function toggleExportDone() {
+ if (!epId.value) return
+ const status = exportDone.value ? 'active' : 'completed'
+ try {
+ await episodeAPI.update(epId.value, { status })
+ if (episode.value) episode.value.status = status
+ toast.success(status === 'completed' ? t('episode.export.markedDoneToast') : t('episode.export.unmarkDoneToast'))
+ } catch (e) {
+ toastError(e)
+ }
+}
const assetDetail = ref({ open: false, type: '', item: null })
const assetDetailDraft = ref({ appearance: '', styling: '', prompt: '', lighting: '', description: '' })
// 最终提示词手动编辑:dirty 时才随保存提交,避免无修改保存误清空 Agent 生成的提示词
@@ -1576,12 +1634,6 @@ const assetPromptDraft = ref('')
const assetPromptDirty = ref(false)
const savingAssetDetail = ref(false)
-function configLabel(config) {
- if (!config) return t('episode.model.notConfigured')
- const modelName = configModels(config)[0] || ''
- return modelName ? `${config.name} · ${modelName} (${config.provider})` : `${config.name} (${config.provider})`
-}
-
function isPendingCharImage(id) {
return pendingCharImageIds.value.includes(id)
}
@@ -1971,10 +2023,7 @@ function isNarratorCharacter(char) {
}
const visualChars = computed(() => chars.value.filter(c => !isNarratorCharacter(c)))
-const lockedImageConfigId = computed(() => episode.value?.image_config_id || episode.value?.imageConfigId || null)
const lockedVideoConfigId = computed(() => episode.value?.video_config_id || episode.value?.videoConfigId || null)
-const lockedImageConfigLabel = computed(() => configLabel(imageConfigs.value.find(c => c.id === lockedImageConfigId.value)))
-const lockedVideoConfigLabel = computed(() => configLabel(videoConfigs.value.find(c => c.id === lockedVideoConfigId.value)))
// 集视频分辨率:顶栏直接修改(持久化 episodes.resolution,生成任务按此值锁定)。
// 内部统一存 480p/720p/1080p 三档,界面按当前选中的视频模型显示厂商原生档位
// (Seedance 480p/720p、MiniMax 768P/2K、Wan 3.0 480P/720P/1080P),适配器再映射为官方枚举
@@ -2380,7 +2429,7 @@ function mainStageDone(stageId) {
if (stageId === 'videos') {
return !!sbs.value.length && shotVidCount.value === sbs.value.length
}
- if (stageId === 'export') return !!mergeUrl.value
+ if (stageId === 'export') return exportDone.value
return false
}
@@ -2450,7 +2499,7 @@ const pipelineProgress = computed(() =>
const currentStageLabel = computed(() => {
if (panel.value === 'script') return t('episode.stage.scriptStage', { step: stepLabels.value[scriptStep.value] })
if (panel.value === 'production') return t('episode.stage.prodStage', { step: prodTabDefs.value[prodTabIdx.value]?.label || t('episode.stage.production') })
- return mergeUrl.value ? t('episode.stage.exportDone') : t('episode.stage.exportWaiting')
+ return exportDone.value ? t('episode.stage.exportDone') : t('episode.stage.exportWaiting')
})
const currentMainStageLabel = computed(() => {
@@ -2736,7 +2785,7 @@ function doBreakdown() {
? propItems.value.map(p => `${p.name}(ID:${p.id})`).join('、')
: '(当前集还没有道具)'
runAgent('storyboard_breaker', `请基于当前集剧本拆分分镜,并为每个分镜段落同时生成 video_prompt(视频生成提示词)。
-本次视频模型:${lockedVideoConfigLabel.value},请按该模型的特性与时长限制生成 video_prompt。
+本次视频模型:${effectiveVideoModelLabel.value},请按该模型的特性与时长限制生成 video_prompt。
当前集已有角色:${charList}
当前集已有场景:${sceneList}
@@ -2760,7 +2809,7 @@ async function onBreakdownDone() {
async function genVideoPrompt(sb) {
if (!sb || videoPromptGeneratingIds.value.includes(sb.id)) return
const idx = sbs.value.indexOf(sb) + 1
- const cfg = videoConfigs.value.find(c => c.id === lockedVideoConfigId.value)
+ const cfg = selectedVideoConfig.value
const label = cfg ? `${cfg.name} (${cfg.provider})` : '默认'
const charNames = getStoryboardCharacters(sb).map(c => c.name).join('、') || '无'
const propNames = getStoryboardProps(sb).map(p => p.name).join('、') || '无'
@@ -5698,6 +5747,33 @@ button.video-task-metric.on { box-shadow: 0 0 0 2px var(--accent); }
font-family: var(--font-mono);
font-size: 9px;
}
+/* 镜头预览:悬停浮现的居中播放钮,点击打开预览弹窗(不影响卡片勾选) */
+.exp-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%) scale(0.9);
+ width: 36px;
+ height: 36px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ background: rgba(0,0,0,0.62);
+ color: #fff;
+ opacity: 0;
+ cursor: pointer;
+ transition: opacity 0.15s, transform 0.15s, background 0.15s;
+}
+.exp-card:hover .exp-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
+.exp-play:hover { background: var(--accent); }
+/* 导出完成手动标记按钮 */
+.export-done-btn.on {
+ background: var(--success-bg, var(--accent-bg));
+ color: var(--success, var(--accent-text));
+ border-color: transparent;
+ font-weight: 600;
+}
.exp-row-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Shared */