feat(short-drama-agent-front): 接入人工动作修订与视频版本权限

This commit is contained in:
GJ committed 2026-10-14 13:44:02 +08:00
1 parent 7a60db3ced
commit fa76165960
38 files changed
+2003 -158

No files matched your search

@@ -32,13 +32,46 @@ const statusLabel = computed(() => {
const labels = { pending: '等待开始', running: '执行中', completed: '已完成', failed: '失败' }
return props.execution ? labels[props.execution.status] : ''
})
const statusType = computed(() =>
props.execution?.status === 'completed' ? 'success' : props.execution?.status === 'failed' ? 'error' : 'warning'
)
const finished = computed(() => ['completed', 'failed'].includes(props.execution?.status ?? ''))
/** 是否为剧本创作任务,避免使用镜头素材的提示文案。 */
const scriptCreation = computed(() => props.execution?.workflowName === 'create-drama')
/** 视频质量任务使用后端聚合后的候选终态统计。 */
const videoQuality = computed(() => props.execution?.workflowName === 'video-quality')
/** 旧任务没有版本过期计数时按零展示,仅接受后端非负整数计数。 */
const staleMotionPlanCount = computed(() => {
const count =
props.execution?.status === 'completed'
? result.value.staleMotionPlan
: props.execution?.metadata?.staleMotionPlan
return typeof count === 'number' && Number.isSafeInteger(count) && count >= 0 ? count : 0
})
/** 视频流程结束但含过期候选时使用警告标签,不显示全成功的绿色状态。 */
const statusType = computed(() =>
props.execution?.status === 'completed'
? videoQuality.value && staleMotionPlanCount.value > 0
? 'warning'
: 'success'
: props.execution?.status === 'failed'
? 'error'
: 'warning'
)
/** 逐镜终态从运行 metadata 或完成 result 读取,不根据历史通过猜测状态。 */
const settledItems = computed(() => {
const settled = props.execution?.status === 'completed' ? result.value.settled : props.execution?.metadata?.settled
if (!settled || typeof settled !== 'object' || Array.isArray(settled)) return []
return Object.entries(settled).flatMap(([shotId, item]) => {
if (
!item ||
typeof item !== 'object' ||
!('status' in item) ||
!('videoId' in item) ||
typeof item.status !== 'string' ||
typeof item.videoId !== 'string'
)
return []
return [{ shotId, status: item.status, videoId: item.videoId }]
})
})
/** 首帧质量后台任务使用独立的通过与修复失败统计,不套用普通生图字段。 */
const keyframeQuality = computed(() => props.execution?.workflowName === 'keyframe-quality')
/** 首帧编辑复用质量工作流,最终回执不属于批量质量统计。 */
@@ -156,10 +189,12 @@ function isInputMode(value: unknown, inputMode: string): boolean {
: result.validationSkipped === true
? 'info'
: 'warning'
: keyframeQuality &&
(!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
: videoQuality && staleMotionPlanCount > 0
? 'warning'
: 'success'
: keyframeQuality &&
(!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
? 'warning'
: 'success'
"
:show-icon="false"
class="mt-3"
@@ -174,7 +209,12 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<p v-if="videoQuality" class="mt-2 text-xs">
目标 {{ result.targetCount ?? execution.total }} · 通过 {{ result.passed ?? 0 }} · 修复耗尽
{{ result.exhausted ?? 0 }} · 模型失败 {{ result.providerFailed ?? 0 }} · 提交失败
{{ result.submissionFailed ?? 0 }}
{{ result.submissionFailed ?? 0 }} · 动作版本过期 {{ staleMotionPlanCount }}
</p>
<!-- 以下是动作版本变化后停止质量流程的候选说明模块 -->
<p v-if="videoQuality && staleMotionPlanCount > 0" class="mt-2 text-xs">
{{ staleMotionPlanCount }}
个镜头的候选因动作规划版本变化已停止质量流程。请先更新视频提示词,再按当前动作规划重新生成视频。
</p>
<p v-if="videoQuality && inputPlanCounts" class="mt-2 text-xs">
输入规划:首帧模式 {{ inputPlanCounts.firstFrame }} · 全模态参考
@@ -215,8 +255,27 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<details class="mt-3 text-[10px] text-muted">
<summary class="cursor-pointer">任务详情</summary>
<p class="mt-2 break-all font-mono">任务编号 · {{ execution.id }}</p>
<!-- 以下是逐镜已结束质量任务的持久化状态模块 -->
<ul v-if="videoQuality && settledItems.length" class="mt-2 space-y-2">
<li v-for="item in settledItems" :key="item.shotId" class="break-all">
<a
:href="`/projects/${encodeURIComponent(execution.projectId)}/production?shotId=${encodeURIComponent(item.shotId)}`"
class="text-button"
>查看镜头</a
>
· {{ executionStageLabel(item.status) }} · 视频 {{ item.videoId }}
</li>
</ul>
</details>
</template>
<!-- 以下是运行期间已经终止的过期候选统计模块 -->
<p
v-if="videoQuality && execution?.status === 'running' && staleMotionPlanCount > 0"
class="mt-3 text-xs"
role="status"
>
动作版本过期 {{ staleMotionPlanCount }} · 这些候选已停止质量流程,其余镜头继续处理。
</p>
<ContextNotice v-if="error" type="error" :show-icon="false" class="mt-3">
{{ error }}。任务可能仍在运行,请先重新读取状态;不要直接重复提交。
<NButton text class="ml-3" :loading="loading" @click="emit('refresh')">重试读取</NButton>
+19 -3
View File
@@ -76,6 +76,7 @@ export function executionStageLabel(stage: string | null) {
provider_failed: '模型生成失败',
submission_failed: '任务提交失败',
completed: '执行完成',
stale_motion_plan: '动作版本过期,质量流程已停止',
failed: '执行失败'
}
return labels[stage] ?? stage
@@ -193,9 +194,24 @@ export function useWorkflowExecution(projectId: Ref<string>, workflowName: strin
)
return
}
const failures = ['failed', 'repairFailed', 'exhausted', 'providerFailed', 'submissionFailed'].some(
field => typeof result[field] === 'number' && Number(result[field]) > 0
)
if (record.workflowName === 'motion-plan-start-state-validation') {
const passed = result.passed === true && result.stale === false
message[passed ? 'info' : 'warning'](
passed
? '动作起点视觉校验通过,请核对证据后手动激活。'
: '动作起点校验未通过或证据已失效,请查看任务结果。',
{ duration: 6000, closable: true }
)
return
}
const failures = [
'staleMotionPlan',
'failed',
'repairFailed',
'exhausted',
'providerFailed',
'submissionFailed'
].some(field => typeof result[field] === 'number' && Number(result[field]) > 0)
message[failures ? 'warning' : 'info'](
failures
? '本轮任务已结束,部分结果未通过或执行失败,请查看任务记录。'