fix(short-drama-agent-front): 修复拆解进度展示与问题交互

This commit is contained in:
GJ committed 2026-10-17 10:21:44 +08:00
1 parent 3414cc8232
commit db91a4b871
19 files changed
+870 -150

No files matched your search

@@ -19,7 +19,7 @@ const props = withDefaults(
loading: boolean
/** 状态读取错误。 */
error: string
/** 是否展示运行与完成说明,已有消息及详细快照的页面可关闭。 */
/** 是否展示运行、完成和错误详情;关闭后由调用方单独呈现问题。 */
showStatusHint?: boolean
}>(),
{ title: '制作任务', showStatusHint: true }
@@ -28,9 +28,35 @@ const props = withDefaults(
const emit = defineEmits<{ refresh: []; dismiss: [] }>()
const percentage = computed(() => executionPercentage(props.execution?.current ?? 0, props.execution?.total ?? 0))
const result = computed(() => props.execution?.result ?? {})
/** 拆解任务的单位和结果文案与镜头素材任务分开。 */
const breakdownTask = computed(() => props.execution?.workflowName === 'breakdown')
/** 执行完成不等于业务校验通过,明确保留待修复状态。 */
const breakdownInvalid = computed(() => {
const validation = result.value.storyboardShotValidation
return (
breakdownTask.value &&
validation &&
typeof validation === 'object' &&
'valid' in validation &&
validation.valid === false
)
})
/** 后端提供的进度单位,避免把抽取完成误报为整个拆解完成。 */
const progressLabel = computed(() =>
props.execution?.metadata?.progressUnit === 'extraction_tasks'
? '抽取任务'
: props.execution?.metadata?.progressUnit === 'storyboard_episodes'
? '分镜剧集'
: '已处理'
)
/** 后端执行终态与业务审核结果共同决定可读状态。 */
const statusLabel = computed(() => {
const labels = { pending: '等待开始', running: '执行中', completed: '已完成', failed: '失败' }
return props.execution ? labels[props.execution.status] : ''
return props.execution
? props.execution.status === 'completed' && breakdownInvalid.value
? '执行结束 · 校验未通过'
: labels[props.execution.status]
: ''
})
const finished = computed(() => ['completed', 'failed'].includes(props.execution?.status ?? ''))
/** 是否为剧本创作任务,避免使用镜头素材的提示文案。 */
@@ -48,7 +74,7 @@ const staleMotionPlanCount = computed(() => {
/** 视频流程结束但含过期候选时使用警告标签,不显示全成功的绿色状态。 */
const statusType = computed(() =>
props.execution?.status === 'completed'
? videoQuality.value && staleMotionPlanCount.value > 0
? breakdownInvalid.value || (videoQuality.value && staleMotionPlanCount.value > 0)
? 'warning'
: 'success'
: props.execution?.status === 'failed'
@@ -162,11 +188,19 @@ function isInputMode(value: unknown, inputMode: string): boolean {
class="mt-4"
/>
<p class="mt-3 text-xs">
<template v-if="execution.total > 0">已处理 {{ execution.current }} / {{ execution.total }}</template>
<template v-if="execution.total > 0"
>{{ progressLabel }} {{ execution.current }} / {{ execution.total }}</template
>
<template v-else>{{
finished ? '本次任务已结束' : scriptCreation ? '正在创作剧本' : '正在准备本次任务'
finished
? '本次任务已结束'
: breakdownTask
? '拆解进行中,等待下一阶段结果'
: scriptCreation
? '正在创作剧本'
: '正在准备本次任务'
}}</template>
<template v-if="execution.currentResourceId && !scriptCreation">
<template v-if="execution.currentResourceId && !scriptCreation && !breakdownTask">
· 当前镜头 <code>{{ execution.currentResourceId }}</code></template
>
</p>
@@ -183,27 +217,31 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<ContextNotice
v-else-if="execution.status === 'completed' && showStatusHint"
:type="
keyframeEdit
? result.passed === true
? 'success'
: result.validationSkipped === true
? 'info'
: 'warning'
: videoQuality && staleMotionPlanCount > 0
? 'warning'
: keyframeQuality &&
(!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
breakdownInvalid
? 'warning'
: keyframeEdit
? result.passed === true
? 'success'
: result.validationSkipped === true
? 'info'
: 'warning'
: videoQuality && staleMotionPlanCount > 0
? 'warning'
: 'success'
: keyframeQuality &&
(!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
? 'warning'
: 'success'
"
:show-icon="false"
class="mt-3"
>
<p>
{{
scriptCreation
? '剧本创作任务已结束,可查看最新剧本内容。'
: '本轮任务已结束,可查看最新镜头资产状态。'
breakdownTask
? '剧本拆解已结束,请查看候选与校验结果。'
: scriptCreation
? '剧本创作任务已结束,可查看最新剧本内容。'
: '本轮任务已结束,可查看最新镜头资产状态。'
}}
</p>
<p v-if="videoQuality" class="mt-2 text-xs">
@@ -237,12 +275,17 @@ function isInputMode(value: unknown, inputMode: string): boolean {
>
<template v-else>后端首帧质量统计不完整,请查看任务详情并刷新核对。</template>
</p>
<p v-else-if="!videoQuality && !scriptCreation" class="mt-2 text-xs">
<p v-else-if="!videoQuality && !scriptCreation && !breakdownTask" class="mt-2 text-xs">
共 {{ result.total ?? execution.total }} · 生成 {{ result.generated ?? execution.current }} · 跳过
{{ result.skipped ?? 0 }} · 阻塞 {{ result.blocked ?? 0 }} · 失败 {{ result.failed ?? 0 }}
</p>
</ContextNotice>
<ContextNotice v-else-if="execution.status === 'failed'" type="error" :show-icon="false" class="mt-3">
<ContextNotice
v-else-if="execution.status === 'failed' && showStatusHint"
type="error"
:show-icon="false"
class="mt-3"
>
<p>{{ execution.error || '制作任务执行失败。' }}</p>
<p class="mt-2 text-xs">
{{