fix: 同步制作接口并修复浅色主题层次

This commit is contained in:
GouJ committed 2026-09-14 10:08:54 +08:00
1 parent 2eea0ea72e
commit 7ea3f2a0b4
19 files changed
+641 -93

No files matched your search

@@ -0,0 +1,125 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NAlert, NCollapse, NCollapseItem, NScrollbar } from 'naive-ui'
import type { ProductionPlan, ProjectProductionStatus } from '../types'
/** 展示后端只读执行计划与真实资产状态,不自行推断阻塞是否可自动解除。 */
const props = defineProps<{ plan: ProductionPlan; status: ProjectProductionStatus }>()
const rows = computed(() => [
{ label: '主体参考图', stage: props.plan.subjectImages },
{ label: '首帧质量', stage: props.plan.keyframes },
{ label: '视频提示词', stage: props.plan.videoPrompts },
{ label: '视频任务', stage: props.plan.videos }
])
const stageNames = { subject_images: '主体参考图', keyframes: '首帧', videos: '视频', completed: '全部完成' }
/** 保留全部后端问题,包括预计可由前置阶段解决的问题,便于核对计划。 */
const problems = computed(() => [
...props.plan.details.subjectImages
.filter(item => item.issues.length)
.map(item => ({
key: `form:${item.subjectFormId}`,
label: `主体参考图 · ${item.subjectName} / ${item.formName}(${item.subjectRef})`,
issues: item.issues
})),
...[
{ label: '首帧', key: 'keyframe', items: props.plan.details.keyframes },
{ label: '视频提示词', key: 'prompt', items: props.plan.details.videoPrompts },
{ label: '视频', key: 'video', items: props.plan.details.videos }
].flatMap(group =>
group.items
.filter(item => item.issues.length)
.map(item => ({
key: `${group.key}:${item.shotId}`,
label: `${group.label} · 镜头 ${item.shotNo}(${item.shotId})`,
issues: item.issues
}))
)
])
</script>
<template>
<section class="surface-inset mt-3 p-4" aria-label="制作执行计划">
<h3 class="text-sm font-semibold">执行计划 · 仅检查,不产生生成费用</h3>
<p class="mt-2 text-xs" role="status">
当前制作状态:{{ status.completed ? '制作已完成' : `待完成${stageNames[status.stage]}` }} · 有效主体图
{{ status.subjectImages.current }}/{{ status.subjectImages.total }} · 有效首帧
{{ status.keyframes.skipped }}/{{ status.keyframes.total }} · 有效主视频 {{ status.videos.skipped }}/{{
status.videos.total
}}
· 视频进行中 {{ status.videos.inProgress }}
</p>
<NScrollbar x-scrollable class="mt-3">
<table class="production-plan-table">
<caption class="sr-only">
各阶段当前执行数量
</caption>
<thead>
<tr>
<th scope="col">阶段</th>
<th scope="col">总数</th>
<th scope="col">可执行</th>
<th scope="col">跳过</th>
<th scope="col">前置完成后可执行</th>
<th scope="col">需人工处理</th>
</tr>
</thead>
<tbody>
<tr v-for="row in rows" :key="row.label">
<th scope="row">{{ row.label }}</th>
<td>{{ row.stage.total }}</td>
<td>{{ row.stage.planned }}</td>
<td>{{ row.stage.skipped }}</td>
<td>{{ row.stage.upstreamResolvable }}</td>
<td>{{ row.stage.manualBlocked }}</td>
</tr>
</tbody>
</table>
</NScrollbar>
<p class="mt-2 text-xs text-muted">
计划按当前资产估算,前置生成后会重新检查。视频“跳过”包含已有有效视频和进行中的任务。已有过期主体主图生成新候选后,仍需在形态图库确认新主图。
</p>
<NAlert v-if="plan.hasManualBlockers" type="warning" :show-icon="false" class="mt-3">
各阶段合计
{{ plan.manualBlocked }}
项需人工处理(同一镜头可能重复计数)。可先生成就绪的主体参考图;成功结果会保留,遇到阻塞时后续阶段可能暂停。
</NAlert>
<NCollapse v-if="problems.length" class="mt-3">
<NCollapseItem name="issues" title="查看前置条件与阻塞原因">
<ul class="space-y-3 text-xs">
<li v-for="item in problems" :key="item.key">
<strong class="break-all">{{ item.label }}</strong>
<p v-for="(issue, index) in item.issues" :key="index" class="mt-1 break-words">
{{ issue.reason
}}<span v-if="issue.missingSubjects?.length">
· 关联主体:{{ issue.missingSubjects.join('、') }}</span
>
</p>
</li>
</ul>
</NCollapseItem>
</NCollapse>
</section>
</template>
<style scoped>
.production-plan-table {
width: 100%;
min-width: 540px;
border-collapse: collapse;
font-size: 12px;
}
.production-plan-table th,
.production-plan-table td {
padding: 9px 12px;
text-align: left;
}
.production-plan-table thead {
background: var(--app-control);
}
.production-plan-table tbody {
background: var(--app-surface);
}
.production-plan-table tbody tr:nth-child(even) {
background: var(--app-subtle);
}
</style>