feat: 接入持久化工作流执行状态
This commit is contained in:
1 parent
7d2900c705
commit
3caea26924
14 files changed
+532
-44
No files matched your search
@@ -32,6 +32,7 @@ import QualityDialog from './components/QualityDialog.vue'
|
||||
import DetailDisclosure from '../../components/ui/DetailDisclosure.vue'
|
||||
import CreativeProfileSettings from '../generation-config/components/CreativeProfileSettings.vue'
|
||||
import EpisodeAssemblyPanel from './components/EpisodeAssemblyPanel.vue'
|
||||
import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue'
|
||||
const qualityOpen = ref(false)
|
||||
|
||||
/** 镜头生产页将项目批处理与单镜头资产管理放在同一条可核验链路中。 */
|
||||
@@ -55,13 +56,17 @@ const {
|
||||
keyframeLimit,
|
||||
keyframeWidth,
|
||||
keyframeHeight,
|
||||
promptLimit,
|
||||
videoLimit,
|
||||
videoRepairAttempts,
|
||||
keyframeValid,
|
||||
promptValid,
|
||||
videoQualityValid,
|
||||
batchValid,
|
||||
blocked,
|
||||
run
|
||||
run,
|
||||
promptExecution,
|
||||
videoExecution
|
||||
} = useProduction()
|
||||
const route = inject(routeLocationKey, undefined)
|
||||
/** 从素材页返回时恢复到指定剧集与正式镜头,不按重复的 Shot 编号定位。 */
|
||||
@@ -84,6 +89,19 @@ const openRequestedKeyframe = computed(
|
||||
() => queryText(route?.query.action) === 'keyframe' && queryText(route?.query.shotId) === shot.value?.shotId
|
||||
)
|
||||
const staleVideos = computed(() => query.data.value?.videos.stalePrimaryVideo ?? 0)
|
||||
const episodePromptReadiness = computed(() => {
|
||||
const source = query.data.value?.prompts
|
||||
if (!source) return undefined
|
||||
const items = source.items.filter(item => item.episodeNo === episodeNo.value)
|
||||
return {
|
||||
...source,
|
||||
items,
|
||||
total: items.length,
|
||||
ready: items.filter(item => item.status === 'ready').length,
|
||||
skipped: items.filter(item => item.status === 'skipped').length,
|
||||
blocked: items.filter(item => item.status === 'blocked').length
|
||||
}
|
||||
})
|
||||
const stages = computed(() => {
|
||||
const data = query.data.value
|
||||
return [
|
||||
@@ -93,8 +111,8 @@ const stages = computed(() => {
|
||||
title: '视频提示词',
|
||||
description: '校验 GenerationSpec 与主体参考图后,由模型生成视频运动描述。',
|
||||
icon: MessageSquareText,
|
||||
data: data?.prompts,
|
||||
done: data?.prompts.skipped ?? 0,
|
||||
data: episodePromptReadiness.value,
|
||||
done: episodePromptReadiness.value?.skipped ?? 0,
|
||||
action: force.value ? '重生成全部提示词' : '补齐视频提示词'
|
||||
},
|
||||
{
|
||||
@@ -190,12 +208,14 @@ const keyframeModel = computed(() => ({
|
||||
keyframeWidth: keyframeWidth.value,
|
||||
keyframeHeight: keyframeHeight.value
|
||||
}))
|
||||
const promptModel = computed(() => ({ promptLimit: promptLimit.value }))
|
||||
const dimensionRules = sizeRules(() => ({ width: keyframeWidth.value, height: keyframeHeight.value }))
|
||||
const keyframeRules = {
|
||||
keyframeLimit: integerRule('本批上限', 1, true),
|
||||
keyframeWidth: dimensionRules.width,
|
||||
keyframeHeight: dimensionRules.height
|
||||
}
|
||||
const promptRules = { promptLimit: integerRule('本批镜头上限') }
|
||||
const videoModel = computed(() => ({ videoLimit: videoLimit.value, videoRepairAttempts: videoRepairAttempts.value }))
|
||||
const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairAttempts: integerRule('每镜最多自动修复') }
|
||||
</script>
|
||||
@@ -340,6 +360,24 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
个主视频已过期。它们使用的主首帧或主体参考图已经变化;非覆盖模式批量生成时会只重建这些过期主视频。
|
||||
</NAlert>
|
||||
<ProductionReceipt v-if="session.receipt" :receipt="session.receipt" />
|
||||
<WorkflowExecutionPanel
|
||||
v-if="promptExecution.executionId.value"
|
||||
title="视频提示词后台任务"
|
||||
:execution="promptExecution.query.data.value"
|
||||
:loading="promptExecution.query.loading.value"
|
||||
:error="promptExecution.query.error.value"
|
||||
@refresh="promptExecution.query.refresh"
|
||||
@dismiss="promptExecution.dismiss"
|
||||
/>
|
||||
<WorkflowExecutionPanel
|
||||
v-if="videoExecution.executionId.value"
|
||||
title="视频质量后台任务"
|
||||
:execution="videoExecution.query.data.value"
|
||||
:loading="videoExecution.query.loading.value"
|
||||
:error="videoExecution.query.error.value"
|
||||
@refresh="videoExecution.query.refresh"
|
||||
@dismiss="videoExecution.dismiss"
|
||||
/>
|
||||
<div v-if="query.data.value" class="production-pipeline mt-5">
|
||||
<article
|
||||
v-for="stage in stages"
|
||||
@@ -430,6 +468,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
:disabled="
|
||||
blocked ||
|
||||
!batchValid ||
|
||||
(stage.key === 'prompts' && !promptValid) ||
|
||||
(stage.key === 'keyframes' && !keyframeValid) ||
|
||||
(stage.key === 'videos' && !videoQualityValid) ||
|
||||
!(stage.data?.ready ?? 0)
|
||||
@@ -442,11 +481,28 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
: `只为至多 ${videoLimit || '—'} 个就绪镜头启动严格质量流水线。任务创建后由后端自动校验,最多修复 ${videoRepairAttempts || '—'} 次,通过后才晋升主视频。`
|
||||
: stage.key === 'keyframes'
|
||||
? `处理缺失或过期主首帧。过期首帧成功后自动接替旧主图(覆盖模式也如此),其余已有主图只新增候选。本批上限:${keyframeLimit || '不限制'};尺寸:${keyframeWidth && keyframeHeight ? `${keyframeWidth} × ${keyframeHeight}` : '后端默认'}。`
|
||||
: '只处理通过视频提示词就绪检查的镜头;覆盖模式会重写已有提示词。'
|
||||
: `只处理第 ${episodeNo} 集中通过就绪检查的镜头,本批最多 ${promptLimit || '—'} 镜;覆盖模式会重写已有提示词。`
|
||||
"
|
||||
:primary="stage.key === 'videos'"
|
||||
@confirm="run(stage.key)"
|
||||
/>
|
||||
<AppForm
|
||||
v-if="stage.key === 'prompts'"
|
||||
:model="promptModel"
|
||||
:rules="promptRules"
|
||||
:disabled="operation.pending"
|
||||
validate-on-change
|
||||
class="mt-4 grid gap-3"
|
||||
>
|
||||
<NFormItem path="promptLimit" label="本批镜头上限"
|
||||
><NInputNumber
|
||||
v-model:value="promptLimit"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="operation.pending"
|
||||
:input-props="{ 'aria-label': '视频提示词本批镜头上限' }"
|
||||
/></NFormItem>
|
||||
</AppForm>
|
||||
<AppForm
|
||||
v-if="stage.key === 'keyframes'"
|
||||
:model="keyframeModel"
|
||||
|
||||
Reference in new issue
Block a user