perf(short-drama-agent-front): 优化记录加载与工作区体验
This commit is contained in:
1 parent
d0264c08ce
commit
db9aea1694
111 files changed
+1680
-1290
No files matched your search
@@ -39,6 +39,9 @@
|
||||
- 英文技术术语优先改成易懂的中文,例如 `Checkpoint` 用“保存记录”、`Storyboard` 用“分镜”、`Prompt` 用“画面描述”或“提示词”、`Thinking` 用“深度思考”。不要把内部字段名、错误码、任务标识直接作为主要说明。
|
||||
- 接口返回的系统提示也需要在展示层转换为可读中文;错误详情只提取有助于操作的业务原因,不把调试对象、堆栈或整段原始数据直接输出给用户。原始错误和错误码保留在数据层,不改动业务判断依据。
|
||||
- 只调整展示文案,不翻译或改写请求字段、枚举值、接口地址、用户创作的剧本与提示词正文、文件名、自定义名称或模型品牌。分类等内部值使用中文选项展示,提交仍保留真实取值。
|
||||
- 用短句直说结果和下一步。同一个意思只写一次;标题和按钮已说明用途时,删掉重复说明。提示一行能说清就不写成段落,必需的限制和费用信息要保留。
|
||||
- 导航只显示名称。禁用原因放到可通过悬停和键盘聚焦查看的提示里,菜单行高保持一致。
|
||||
- 问题提示放在能直接处理它的页面。素材图库不常驻展示下游镜头的生产警告和列表;从镜头主动定位素材时,只保留定位所需的信息与返回入口。普通浏览不发仅供该定位使用的全项目检查请求。
|
||||
- 费用、覆盖、删除、适用范围与待审核限制必须保留并说清楚,不能为了简化文字改变功能含义。无法确认的能力不要用容易误解的描述代替。
|
||||
- 必要的原始技术数据放在默认收起的“高级详情”或导出结果中,日常操作先展示中文摘要。同一弹窗的操作统一放入公共 `footer`,避免正文操作与默认关闭按钮重复。
|
||||
|
||||
@@ -56,17 +59,18 @@
|
||||
|
||||
- 页面外边距、模块间距优先复用 `--app-content-padding`、`--app-content-gap`;表单与抽屉内部复用对应公共组件的间距,不在各页面随意添加不同数值。
|
||||
- 同级模块使用一致的标题、说明、字段间距和上下留白。需要说明时采用“模块标题 + 一句简短说明”,例如画布设置、图片配置、视频配置、动作与物理规则;优先复用 `WorkspaceSectionHeading`。
|
||||
- 页面、弹窗和抽屉中的同级模块共用左右边界。普通分区直接对齐;需要突出一组内容时,优先用已有的中性背景包住整组内容。背景外沿与相邻模块对齐,组内使用统一内边距,避免透明容器单独缩进。
|
||||
- 新建剧本等长表单默认每个字段单独占一行并铺满内容宽度;不因改成全屏就自动把原来的字段挤成两列。
|
||||
- 图片、视频等已有明确分组的并列模块可以保留协调的分栏,窄屏改为单列;同一行的标签、控件及操作必须分别对齐,不能因说明或校验消息出现而上下错位。
|
||||
- 行内按钮按输入控件本身的基线对齐,不能按包含标签的整块区域垂直居中。动态例外行中的移除按钮与输入框底部对齐,使用 `Trash2` 等现有图标,不再显示“移除”文字,并提供可访问名称。
|
||||
- 项目生成配置等普通表单分区不铺大块背景色,使用标题、说明和统一间距组织;错误、成功等有明确状态含义的提示区域才使用对应柔和底色。
|
||||
- 项目生成配置等普通表单分区不铺大块背景色,使用标题、说明和统一间距组织;常规错误沿用中性底色,只有明确的严重错误或通过检查的成功状态才使用对应状态底色。
|
||||
|
||||
### 按钮、图标与状态颜色
|
||||
|
||||
- 绿色背景、白色文字用于保存、提交、开始生成等主要执行操作;关闭、取消和普通辅助操作使用中性样式。
|
||||
- 错误、校验未通过、需要修复的区域使用柔和浅红背景,深色主题使用对应柔和深红底面。禁止使用上下两条绿色横线表示错误或待修复状态,也不能借用绿色选中态来标记错误。
|
||||
- 普通镜头定位仅使用中性提示,不能因点击“定位镜头”就标红;只有从当前明确问题定位时才使用错误底色,正文刷新后清除旧定位标记。
|
||||
- 错误入口按钮的文字、图标和焦点提示与红色底面保持一致;默认、悬停、按下、聚焦各状态都不能被主题主色覆盖成绿色。保留清晰的键盘焦点提示。
|
||||
- 普通请求失败、表单校验、审核未通过和可修复问题默认使用中性底面,配合短文字、图标或细线提示。红色底面只用于明确需要立即关注的严重错误,例如任务中断且可能重复计费。保留深浅主题对应的柔和状态色。
|
||||
- 普通镜头定位使用中性提示。从明确问题定位时,可加细线标记;正文刷新后清除旧标记。
|
||||
- 错误入口按钮使用中性底面,文字、图标和焦点保留错误语义。默认、悬停、按下和聚焦时保持清晰的键盘焦点与状态反馈。
|
||||
- 只有执行完成且结果明确通过校验时,成功任务区域才使用柔和浅绿背景。执行结束但校验失败、质量待审或结果未确认时,不能显示成绿色成功状态,也不能用满格绿色进度条暗示业务成功。
|
||||
- 卡片内的定位、复查、修订和历史入口使用带图标、独立中性底面的按钮,不添加边框,不能与说明文字混在一起;复用 `workspace-action-button` / `workspace-action-group`,不把辅助操作改成绿色主按钮。
|
||||
- 工具栏中相邻按钮保持一致的高度、内边距、图标大小和间距。问题入口使用图标加文字;分镜结构校验失败时文案为“分镜校验未通过”,其他问题按真实类型命名。
|
||||
@@ -102,6 +106,9 @@
|
||||
|
||||
- 涉及页面或交互的改动,必须在已有本地 Chrome 标签页使用 `localhost` 验证后才算完成,不能只根据代码、构建或 DOM 测试声称布局通过。
|
||||
- 验证本次改动涉及的桌面、移动端、长内容滚动、固定底栏及必要的加载、错误、成功状态;检查普通、悬停和键盘聚焦时的颜色、对齐与可访问名称。
|
||||
- 页面模块之间复用公共间距;按钮、标题和辅助说明须有清晰留白。已有相邻页面使用骨架屏时,同类入口也应在项目加载和正文加载阶段预留相同结构。
|
||||
- 骨架与图片占位默认静态显示,避免闪动。图库按真实卡片结构分别预留图片、文字和操作位置。
|
||||
- 图片卡片在请求图片前就预留画面区域,优先用已有宽高,缺少宽高时使用稳定比例。检查慢速、加载失败和无图时卡片都不会塌陷。
|
||||
- 界面验收不得为了制造状态而触发真实付费生成、覆盖正式结果或提交用户数据;使用现有状态、只读操作和合适的自动化测试验证。
|
||||
- 测试与检查按改动范围执行;纯文档变更无需启动页面或重复完整构建。报告时区分自动化检查与真实浏览器验证,并明确未完成项,不把尝试操作当作验收通过。
|
||||
|
||||
|
||||
+30
-23
@@ -9,6 +9,7 @@ import {
|
||||
NLayout,
|
||||
NLayoutHeader,
|
||||
NMenu,
|
||||
NTooltip,
|
||||
NScrollbar,
|
||||
zhCN,
|
||||
dateZhCN,
|
||||
@@ -120,6 +121,9 @@ function createMenuIcon(icon: typeof FolderOpen) {
|
||||
return () => h('span', { class: 'admin-menu-icon' }, [h(icon, { size: NAV_ICON_SIZE })])
|
||||
}
|
||||
|
||||
/** 禁用原因由同一个提示响应鼠标和键盘,菜单不额外占行。 */
|
||||
const blockedMenuHint = ref<string | null>(null)
|
||||
|
||||
/** 菜单链接使用 RouterLink,保留新标签打开和浏览器导航行为。 */
|
||||
const menuOptions = computed<MenuOption[]>(() => {
|
||||
return [
|
||||
@@ -147,16 +151,33 @@ const menuOptions = computed<MenuOption[]>(() => {
|
||||
label: () =>
|
||||
disabled
|
||||
? h(
|
||||
'span',
|
||||
NTooltip,
|
||||
{
|
||||
class: 'admin-menu-label admin-menu-label-blocked',
|
||||
title: reason,
|
||||
'aria-label': `${label},${reason}`,
|
||||
'aria-disabled': 'true'
|
||||
placement: 'right',
|
||||
trigger: 'manual',
|
||||
show: blockedMenuHint.value === target
|
||||
},
|
||||
sectionAccess
|
||||
? [h('span', label), h('small', { class: 'admin-menu-reason' }, reason)]
|
||||
: label
|
||||
{
|
||||
trigger: () =>
|
||||
h(
|
||||
'span',
|
||||
{
|
||||
class: 'admin-menu-label',
|
||||
tabindex: 0,
|
||||
onMouseenter: () => (blockedMenuHint.value = target),
|
||||
onMouseleave: () => (blockedMenuHint.value = null),
|
||||
onFocus: () => (blockedMenuHint.value = target),
|
||||
onBlur: () => (blockedMenuHint.value = null),
|
||||
onKeydown: (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape') blockedMenuHint.value = null
|
||||
},
|
||||
'aria-label': `${label},${reason}`,
|
||||
'aria-disabled': 'true'
|
||||
},
|
||||
label
|
||||
),
|
||||
default: () => reason
|
||||
}
|
||||
)
|
||||
: h(RouterLink, { to: target }, () =>
|
||||
h('span', { class: 'admin-menu-label' }, label)
|
||||
@@ -275,7 +296,7 @@ const menuOptions = computed<MenuOption[]>(() => {
|
||||
<main id="main-content" tabindex="-1" class="admin-content"><RouterView /></main>
|
||||
</NLayout>
|
||||
</div>
|
||||
<AppDialog v-model:open="settingsOpen" title="连接设置" description="查看当前服务地址。">
|
||||
<AppDialog v-model:open="settingsOpen" title="连接设置">
|
||||
<dl class="detail-grid mt-6">
|
||||
<dt>服务地址</dt>
|
||||
<dd>
|
||||
@@ -373,20 +394,6 @@ const menuOptions = computed<MenuOption[]>(() => {
|
||||
color 0.18s ease,
|
||||
opacity 0.18s ease;
|
||||
}
|
||||
/* 保留菜单行高,在禁用项名称下展示当前步骤的简短原因。 */
|
||||
.admin-menu-label-blocked {
|
||||
display: block;
|
||||
line-height: 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
.admin-menu-reason {
|
||||
display: block;
|
||||
font-size: 10px;
|
||||
line-height: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.admin-brand {
|
||||
@apply flex shrink-0 items-center gap-3 h-[74px] overflow-hidden py-0 px-5 text-ink whitespace-nowrap;
|
||||
min-width: var(--admin-sider-expanded);
|
||||
|
||||
@@ -12,15 +12,20 @@ withDefaults(
|
||||
title?: string
|
||||
/** 重要注意事项复用项目主题底面、图标与醒目标题,普通说明保持原有紧凑样式。 */
|
||||
emphasized?: boolean
|
||||
/** 仅在明确的严重错误中使用警示底色。 */
|
||||
critical?: boolean
|
||||
}>(),
|
||||
{ type: 'info', showIcon: true, emphasized: false }
|
||||
{ type: 'info', showIcon: true, emphasized: false, critical: false }
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="context-notice"
|
||||
:class="[`context-notice-${type}`, { 'context-notice-emphasized': emphasized }]"
|
||||
:class="[
|
||||
`context-notice-${type}`,
|
||||
{ 'context-notice-emphasized': emphasized, 'context-notice-critical': critical && type === 'error' }
|
||||
]"
|
||||
:role="emphasized && (type === 'error' || type === 'warning') ? 'alert' : undefined"
|
||||
>
|
||||
<component
|
||||
@@ -68,8 +73,8 @@ withDefaults(
|
||||
@apply mt-1;
|
||||
color: var(--app-ink);
|
||||
}
|
||||
/* 明确的失败和成功保留现有项目状态色,只在图标与柔和底面上提示。 */
|
||||
.context-notice-emphasized.context-notice-error {
|
||||
/* 普通错误使用中性底面,严重错误才使用警示底色。 */
|
||||
.context-notice-emphasized.context-notice-critical {
|
||||
background: color-mix(in srgb, var(--app-danger-soft) 45%, var(--app-surface));
|
||||
}
|
||||
.context-notice-emphasized.context-notice-error > svg {
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
import { NEmpty } from 'naive-ui'
|
||||
import { FileText } from '@lucide/vue'
|
||||
/** 没有数据时展示真实空态,不创建虚构项目或结果。 */
|
||||
defineProps<{ title: string; description: string }>()
|
||||
defineProps<{
|
||||
/** 当前状态。 */
|
||||
title: string
|
||||
/** 标题之外确实有必要的补充说明。 */
|
||||
description?: string
|
||||
}>()
|
||||
</script>
|
||||
<template>
|
||||
<NEmpty class="empty-state" :description="title">
|
||||
<template #icon><FileText :size="30" :stroke-width="1.4" /></template>
|
||||
<template #extra>
|
||||
<p class="max-w-md text-sm leading-6 text-muted">{{ description }}</p>
|
||||
<p v-if="description" class="max-w-md text-sm leading-6 text-muted">{{ description }}</p>
|
||||
<!-- 以下是统一居中、换行和间距的空态操作模块,加载图标不再影响按钮基线 -->
|
||||
<div class="empty-state-actions mt-5 flex flex-wrap items-center justify-center gap-3"><slot /></div>
|
||||
</template>
|
||||
|
||||
@@ -36,7 +36,7 @@ function reset() {
|
||||
loaded.value = false
|
||||
}
|
||||
|
||||
/** 图片加载完成后直接切换为淡入状态。 */
|
||||
/** 图片加载完成后用原图替换静态占位。 */
|
||||
function reveal() {
|
||||
loaded.value = true
|
||||
}
|
||||
@@ -85,7 +85,6 @@ watch(() => props.src, reset)
|
||||
/* 所有图片从顶部展示,裁切缩略图时优先保留人物头部。 */
|
||||
object-position: center top;
|
||||
opacity: 0;
|
||||
transition: opacity 220ms cubic-bezier(0.25, 1, 0.5, 1);
|
||||
}
|
||||
.reveal-image.is-loaded > .n-image img {
|
||||
opacity: 1;
|
||||
@@ -93,21 +92,5 @@ watch(() => props.src, reset)
|
||||
.reveal-image-placeholder {
|
||||
@apply absolute inset-0 pointer-events-none;
|
||||
background-color: var(--app-control);
|
||||
animation: reveal-image-pulse 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
|
||||
}
|
||||
@keyframes reveal-image-pulse {
|
||||
from {
|
||||
opacity: 0.72;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.reveal-image > .n-image img,
|
||||
.reveal-image-placeholder {
|
||||
animation: none;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,20 @@ import { statusLabels } from '../../lib/format'
|
||||
import type { ProjectStatus } from '../../features/projects/types'
|
||||
/** 状态使用 Naive 标签,同时保留文本,避免仅依赖颜色区分。 */
|
||||
const props = defineProps<{ status: string; label?: string }>()
|
||||
/** 素材和任务的公开状态不参与项目筛选选项。 */
|
||||
const workflowStatusLabels: Record<string, string> = {
|
||||
running: '进行中',
|
||||
pending: '等待中',
|
||||
queued: '排队中',
|
||||
processing: '处理中',
|
||||
submitted: '已提交',
|
||||
failed: '失败',
|
||||
cancelled: '已取消',
|
||||
ready: '已就绪',
|
||||
blocked: '暂不可用',
|
||||
unlocked: '未锁定',
|
||||
candidate_pending: '待确认候选'
|
||||
}
|
||||
/** 仅真实执行状态显示旋转图标,锁定或待确认状态不冒充加载。 */
|
||||
const running = computed(() =>
|
||||
['running', 'generating', 'pending', 'queued', 'processing', 'submitted'].includes(props.status)
|
||||
@@ -23,6 +37,6 @@ const type = computed(() =>
|
||||
<template>
|
||||
<NTag :type="type" size="small" :bordered="false" :data-status="status" :aria-busy="running"
|
||||
><template v-if="running" #icon><LoaderCircle :size="12" class="animate-spin" /></template
|
||||
>{{ label || statusLabels[status as ProjectStatus] || status }}</NTag
|
||||
>{{ label || workflowStatusLabels[status] || statusLabels[status as ProjectStatus] || '待确认' }}</NTag
|
||||
>
|
||||
</template>
|
||||
@@ -18,18 +18,20 @@ export function useQuery<T>(key: Ref<string>, loader: (key: string, signal: Abor
|
||||
async function refresh() {
|
||||
if (disposed) return
|
||||
const current = ++generation
|
||||
const target = key.value
|
||||
controller?.abort()
|
||||
controller = new AbortController()
|
||||
const signal = controller.signal
|
||||
loading.value = true
|
||||
try {
|
||||
const result = await loader(key.value, signal)
|
||||
if (current !== generation || disposed) return
|
||||
const result = await loader(target, signal)
|
||||
if (current !== generation || target !== key.value || disposed) return
|
||||
data.value = result
|
||||
error.value = ''
|
||||
updatedAt.value = new Date().toISOString()
|
||||
} catch (cause) {
|
||||
if (current === generation && !signal.aborted && !disposed) error.value = errorMessage(cause)
|
||||
if (current === generation && target === key.value && !signal.aborted && !disposed)
|
||||
error.value = errorMessage(cause)
|
||||
} finally {
|
||||
if (current === generation && !disposed) loading.value = false
|
||||
}
|
||||
|
||||
@@ -231,6 +231,8 @@ export function useTheme() {
|
||||
},
|
||||
Tag: {
|
||||
textColorPrimary: accentText,
|
||||
// 错误标签用文字区分状态,底面保持中性。
|
||||
colorError: subtle,
|
||||
border: 'none',
|
||||
borderPrimary: 'none',
|
||||
borderInfo: 'none',
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||||
import BreakdownSkeleton from './BreakdownSkeleton.vue'
|
||||
import AppForm from '../../components/ui/AppForm.vue'
|
||||
import { NFormItem } from 'naive-ui'
|
||||
import { integerRule, fieldRule } from '../../lib/form-rules'
|
||||
@@ -8,7 +10,7 @@ import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.v
|
||||
import { NScrollbar, NButton, NCheckbox, NCollapse, NCollapseItem, NInputNumber, NTab, NTable, NTabs } from 'naive-ui'
|
||||
import { computed, h, nextTick, onScopeDispose, ref, watch } from 'vue'
|
||||
import { useActionMessage } from '../../components/ui/useActionMessage'
|
||||
import { CircleAlert, Layers, LoaderCircle, Settings2, ShieldCheck } from '@lucide/vue'
|
||||
import { CircleAlert, LoaderCircle, Settings2, ShieldCheck } from '@lucide/vue'
|
||||
import { AppDialog, EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
|
||||
import QualityPolicySettings from '../generation-config/components/QualityPolicySettings.vue'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
@@ -35,7 +37,15 @@ import { ApiError, errorMessage } from '../../lib/http'
|
||||
import { downloadText } from '../../lib/format'
|
||||
|
||||
/** 拆解工作区:先预览真实分组,再启动;恢复操作根据 checkpoint 分阶段展示。 */
|
||||
const { project, checkpoints, refresh, refreshStageReadiness, stageReadiness, error } = useProjectContext()
|
||||
const context = useProjectContext()
|
||||
const { project, refreshStageReadiness, stageReadiness } = context
|
||||
/** 拆解候选、正式分镜与阶段恢复共用完整拆解记录。 */
|
||||
const breakdownRecords = context.useWorkflowCheckpoints('breakdown')
|
||||
const checkpoints = computed(() => breakdownRecords.data.value ?? [])
|
||||
/** 正文或摘要无法核对时暂停写操作,保留已读结果。 */
|
||||
const error = computed(() => context.error.value || breakdownRecords.error.value)
|
||||
/** 拆解写入后更新本工作流与摘要。 */
|
||||
const refresh = () => context.refreshWorkflow('breakdown')
|
||||
const groupSize = ref(3)
|
||||
const modules = ref<BreakdownModule[]>(['character', 'scene', 'prop'])
|
||||
const preview = ref<BreakdownPreview | null>(null)
|
||||
@@ -54,12 +64,12 @@ const pendingIssues = ref(false)
|
||||
const candidateSafetyOpen = ref(false)
|
||||
/** 从设置交接时绑定项目,离场后禁止打开旧项目预检。 */
|
||||
const pendingSafetyProject = ref('')
|
||||
/** 问题入口统一使用红色文字、图标和柔和底色,交互时保持错误语义。 */
|
||||
/** 问题入口使用中性底面,交互时保留提示文字和焦点颜色。 */
|
||||
const issueButtonTheme = {
|
||||
color: 'var(--app-danger-soft)',
|
||||
colorHover: 'color-mix(in srgb, var(--app-danger-soft), var(--app-danger) 8%)',
|
||||
colorPressed: 'color-mix(in srgb, var(--app-danger-soft), var(--app-danger) 14%)',
|
||||
colorFocus: 'var(--app-danger-soft)',
|
||||
color: 'var(--app-control)',
|
||||
colorHover: 'var(--app-control-hover)',
|
||||
colorPressed: 'var(--app-control-hover)',
|
||||
colorFocus: 'var(--app-control-hover)',
|
||||
textColor: 'var(--app-danger)',
|
||||
textColorHover: 'var(--app-danger)',
|
||||
textColorPressed: 'var(--app-danger)',
|
||||
@@ -270,8 +280,12 @@ const taskStopped = computed(() => execution.value?.status === 'failed' || execu
|
||||
watch(
|
||||
() => backgroundExecution.query.data.value?.status,
|
||||
(status, previous) => {
|
||||
if ((status === 'completed' || status === 'failed') && status !== previous)
|
||||
void Promise.all([refresh(), refreshStageReadiness()])
|
||||
const record = backgroundExecution.query.data.value
|
||||
if (record && previous && (status === 'completed' || status === 'failed') && status !== previous)
|
||||
void Promise.all([
|
||||
context.refreshWorkflow('breakdown', record.projectId, record.id + ':' + status),
|
||||
refreshStageReadiness()
|
||||
])
|
||||
}
|
||||
)
|
||||
/** 结构校验通过后仍可能存在服务端明确标记的质量待审剧集。 */
|
||||
@@ -340,6 +354,9 @@ const issueActionsDisabled = computed(
|
||||
() =>
|
||||
project.value?.status !== 'completed' ||
|
||||
!!error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
breakdownRecords.loading.value ||
|
||||
breakdownRecords.data.value === null ||
|
||||
operation.value.pending ||
|
||||
breakdownBusy.value ||
|
||||
backgroundExecution.discovering.value ||
|
||||
@@ -369,23 +386,27 @@ const issueSignature = computed(() =>
|
||||
problems: quality.value.problems
|
||||
})
|
||||
)
|
||||
/** 首次读取或问题变化时只显示一条汇总,保留可操作的详情入口。 */
|
||||
/** 等拆解记录和任务状态读完再判断,避免把已被正式结果替代的失败当成当前问题。 */
|
||||
const canNotifyIssues = computed(
|
||||
() =>
|
||||
breakdownRecords.data.value !== null &&
|
||||
!breakdownRecords.loading.value &&
|
||||
!breakdownRecords.error.value &&
|
||||
!quality.value.needsRefresh &&
|
||||
!quality.value.loading &&
|
||||
!breakdownBusy.value &&
|
||||
!backgroundExecution.discovering.value
|
||||
)
|
||||
/** 当前会话同一版本的相同问题只通知一次,重审或切集不重复弹出。 */
|
||||
const notifiedIssues = new Set<string>()
|
||||
watch(
|
||||
issueSignature,
|
||||
() => {
|
||||
[issueSignature, canNotifyIssues],
|
||||
([signature, canNotify]) => {
|
||||
if (!canNotify || notifiedIssues.has(signature)) return
|
||||
const executionError = currentWorkflowError.value
|
||||
const invalid = quality.value.issueCount > 0
|
||||
if (
|
||||
quality.value.needsRefresh ||
|
||||
quality.value.loading ||
|
||||
breakdownBusy.value ||
|
||||
backgroundExecution.discovering.value
|
||||
)
|
||||
return
|
||||
if ((!executionError && !invalid) || notifiedIssues.has(issueSignature.value)) return
|
||||
notifiedIssues.add(issueSignature.value)
|
||||
if (!executionError && !invalid) return
|
||||
notifiedIssues.add(signature)
|
||||
actionMessage?.warning(
|
||||
() =>
|
||||
h('div', { class: 'flex flex-wrap items-center gap-3' }, [
|
||||
@@ -427,6 +448,9 @@ const canStart = computed(
|
||||
!backgroundExecution.discovering.value &&
|
||||
!backgroundExecution.discoveryError.value &&
|
||||
!error.value &&
|
||||
!context.summaryBlocked.value &&
|
||||
!breakdownRecords.loading.value &&
|
||||
breakdownRecords.data.value !== null &&
|
||||
(!records.value.length || taskStopped.value)
|
||||
)
|
||||
/** 质量确认始终绑定本次真实预览输入,修改设置后立即撤销未完成启动。 */
|
||||
@@ -525,7 +549,15 @@ async function loadPreview() {
|
||||
* @param action 本次启动或恢复动作
|
||||
*/
|
||||
async function run(action: BreakdownAction) {
|
||||
if (project.value?.status !== 'completed' || operation.value.pending || error.value) return
|
||||
if (
|
||||
project.value?.status !== 'completed' ||
|
||||
operation.value.pending ||
|
||||
error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
breakdownRecords.loading.value ||
|
||||
breakdownRecords.data.value === null
|
||||
)
|
||||
return
|
||||
if (breakdownBusy.value || backgroundExecution.discovering.value || backgroundExecution.discoveryError.value) return
|
||||
if (action === 'start' && !canStart.value) return
|
||||
const permit = action === 'start' ? startPolicy.consumePermit() : null
|
||||
@@ -546,12 +578,12 @@ async function run(action: BreakdownAction) {
|
||||
action,
|
||||
action === 'start' ? { ...input.value, ...permit! } : undefined
|
||||
)
|
||||
await backgroundExecution.track(started.executionId)
|
||||
await backgroundExecution.track(started.executionId, id)
|
||||
return started
|
||||
},
|
||||
{ type: 'info', content: '拆解任务已提交,可在“拆解设置”中查看进度。' }
|
||||
)
|
||||
await refresh()
|
||||
await context.refreshWorkflow('breakdown', id)
|
||||
const cause = operation.value.cause
|
||||
if (
|
||||
!success &&
|
||||
@@ -601,7 +633,15 @@ const isInitialEmpty = computed(
|
||||
|
||||
<template>
|
||||
<!-- 以下是手机完成提示自然滚走、分类导航与设置入口吸顶的拆解工作区 -->
|
||||
<WorkspacePage split compact mobile-scroll class="breakdown-workspace-page" :header-visible="!isInitialEmpty">
|
||||
<BreakdownSkeleton v-if="breakdownRecords.loading.value && breakdownRecords.data.value === null" />
|
||||
<WorkspacePage
|
||||
v-else
|
||||
split
|
||||
compact
|
||||
mobile-scroll
|
||||
class="breakdown-workspace-page"
|
||||
:header-visible="!isInitialEmpty"
|
||||
>
|
||||
<template #header>
|
||||
<!-- 以下是拆解状态与设置 -->
|
||||
<div class="workspace-toolbar">
|
||||
@@ -653,9 +693,7 @@ const isInitialEmpty = computed(
|
||||
v-if="startPolicy.reviewOpen.value && startPolicy.policy.value"
|
||||
class="breakdown-policy-review"
|
||||
>
|
||||
<p class="text-sm leading-6 text-muted">
|
||||
请核对动作与物理规则,修改将在继续时保存。确认会保存到当前项目,规则未变时不再重复提醒。
|
||||
</p>
|
||||
<p class="text-sm leading-6 text-muted">确认后保存本项目规则。规则更新时会再次提醒。</p>
|
||||
<QualityPolicySettings
|
||||
ref="qualityForm"
|
||||
:key="startPolicy.editorKey.value"
|
||||
@@ -687,14 +725,9 @@ const isInitialEmpty = computed(
|
||||
{{ backgroundExecution.discoveryError.value }}
|
||||
<NButton text @click="backgroundExecution.discover">重新读取后台状态</NButton>
|
||||
</p>
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="flex items-center gap-2 font-semibold"><Layers :size="17" />拆解设置</h2>
|
||||
<p class="mt-2 text-xs leading-5 text-muted">
|
||||
按所选模块拆解已保存的 {{ project.episodes.length }} 集剧本。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs leading-5 text-muted">
|
||||
已保存 {{ project.episodes.length }} 集,可按模块拆解。
|
||||
</p>
|
||||
<AppForm
|
||||
class="breakdown-settings-form"
|
||||
:model="formModel"
|
||||
@@ -807,7 +840,7 @@ const isInitialEmpty = computed(
|
||||
{{ startPolicy.error.value }}
|
||||
</p>
|
||||
<p v-if="project.status === 'generating'" class="mt-4 text-xs text-danger">
|
||||
剧本仍在生成,暂不允许启动拆解,避免读取到不完整的剧集。
|
||||
剧本生成后可开始拆解。
|
||||
</p>
|
||||
<p v-if="breakdownBusy" class="mt-4 text-xs leading-5 text-muted">
|
||||
拆解进行中,结束后自动更新结果。
|
||||
@@ -908,11 +941,12 @@ const isInitialEmpty = computed(
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<ContextNotice v-if="breakdownRecords.error.value" type="error" role="alert">
|
||||
{{ breakdownRecords.error.value }}
|
||||
<NButton text size="small" @click="breakdownRecords.refresh">重试读取</NButton>
|
||||
</ContextNotice>
|
||||
<NScrollbar v-if="!project?.episodes.length" class="panel-scroll panel">
|
||||
<EmptyState
|
||||
title="还没有可拆解的剧集"
|
||||
description="先完成剧本创作。拆解会使用已保存的正式剧集,无需重新上传。"
|
||||
/>
|
||||
<EmptyState title="还没有可拆解的剧集" description="请先完成剧本创作。" />
|
||||
</NScrollbar>
|
||||
<template v-else>
|
||||
<section class="breakdown-results-section" :data-breakdown-source="quality.source">
|
||||
@@ -998,7 +1032,7 @@ const isInitialEmpty = computed(
|
||||
<EmptyState
|
||||
class="breakdown-initial-empty"
|
||||
title="还没有拆解结果"
|
||||
description="点击“拆解设置”,选择需要的模块和分组,预览后再确认生成。"
|
||||
description="在拆解设置中选择范围,再预览并确认。"
|
||||
>
|
||||
<NButton
|
||||
type="primary"
|
||||
@@ -1100,7 +1134,7 @@ const isInitialEmpty = computed(
|
||||
<EmptyState
|
||||
v-else
|
||||
title="尚无抽取任务记录"
|
||||
description="启动拆解后会持续保存进度;预览只展示本次处理范围,不会直接开始执行。"
|
||||
description="预览处理范围,确认后开始拆解。进度会自动保存。"
|
||||
/>
|
||||
</div>
|
||||
</NScrollbar>
|
||||
@@ -1149,7 +1183,7 @@ const isInitialEmpty = computed(
|
||||
role="status"
|
||||
class="text-xs leading-6 text-muted"
|
||||
>
|
||||
任务状态或结果尚未确认,请先重新读取状态与结果。
|
||||
请刷新任务状态。
|
||||
</p>
|
||||
<!-- 以下是从当前动作冲突带入角色和动作的例外入口,独立保存规则且保留旧例外 -->
|
||||
<ActionExceptionRepair
|
||||
@@ -1193,21 +1227,21 @@ const isInitialEmpty = computed(
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '正在重试失败抽取')"
|
||||
label="重试失败抽取"
|
||||
description="只重新提取失败的人物、场景或道具,不重做已完成内容。镜头问题请使用对应修复操作。"
|
||||
description="重试失败的主体提取。镜头问题请单独修复。"
|
||||
acknowledgement
|
||||
:disabled="issueActionsDisabled || !recovery.retry"
|
||||
@confirm="run('retry')"
|
||||
/><ConfirmAction
|
||||
:loading="isOperationRunning(operation, '正在补齐镜头')"
|
||||
label="继续整理镜头"
|
||||
description="复用已生成内容,修正可确定的状态标记并补齐缺失镜头,再执行完整质量检查。"
|
||||
description="补齐缺失镜头、修正状态并重新检查。已有内容会复用。"
|
||||
acknowledgement
|
||||
:disabled="issueActionsDisabled || !recovery.shots"
|
||||
@confirm="run('resume-shots')"
|
||||
/><ConfirmAction
|
||||
:loading="isOperationRunning(operation, '正在修复分镜绑定')"
|
||||
label="修复分镜绑定"
|
||||
description="保留已有镜头,补齐人物、场景、道具及其形态的对应关系,然后检查并保存。"
|
||||
description="补齐镜头关联的主体和形态,检查后保存。"
|
||||
acknowledgement
|
||||
:disabled="issueActionsDisabled || !recovery.storyboard"
|
||||
@confirm="run('resume-storyboard')"
|
||||
|
||||
@@ -260,10 +260,7 @@ onScopeDispose(() => {
|
||||
<template>
|
||||
<!-- 以下是拆解后从具体冲突添加动作例外的模块,角色和动作均不可自由输入 -->
|
||||
<section class="workspace-panel space-y-4" aria-label="动作例外修订">
|
||||
<WorkspaceSectionHeading
|
||||
title="动作例外"
|
||||
description="只为剧本明确允许的特殊动作添加例外。角色、部位和动作从当前问题自动带入,你只需填写允许原因。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="动作例外" description="仅为剧本明确允许的动作填写例外原因。" />
|
||||
<p v-if="loading" role="status" class="text-xs text-muted">正在读取已有动作例外…</p>
|
||||
<div v-if="error" role="alert" class="space-y-2 text-sm text-danger">
|
||||
<p>{{ error }}</p>
|
||||
@@ -271,7 +268,7 @@ onScopeDispose(() => {
|
||||
</div>
|
||||
<QualityPolicyExceptions :exceptions="exceptions" />
|
||||
<p v-if="!targets.length && !loading" class="text-xs leading-6 text-muted">
|
||||
当前没有能准确带入角色与动作的冲突。缺少动作证据或其他结构错误时,请先使用人工修订。
|
||||
缺少可确认的动作冲突,请先人工修订。
|
||||
</p>
|
||||
<article v-for="target in targets" :key="target.key" class="space-y-3" :data-exception-target="target.key">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
@@ -296,9 +293,7 @@ onScopeDispose(() => {
|
||||
</ul>
|
||||
<!-- 以下是只填写原因的例外草稿,后端实际范围是同一角色的对应部位 -->
|
||||
<div v-if="selected?.key === target.key" class="space-y-3">
|
||||
<p class="text-xs leading-6 text-muted">
|
||||
此例外按项目保存,同一角色或物品在其他镜头中的同类占用冲突也会受影响;其他错误仍会检查。
|
||||
</p>
|
||||
<p class="text-xs leading-6 text-muted">例外也适用于本项目中同一角色或物品的同类冲突。</p>
|
||||
<NFormItem label="允许原因"
|
||||
><NInput
|
||||
v-model:value="reason"
|
||||
|
||||
@@ -234,7 +234,7 @@ function refreshPreview() {
|
||||
* @returns 当前版本核对完成
|
||||
*/
|
||||
async function assertCheckpoint(id: string, cp: string | undefined): Promise<void> {
|
||||
const records = await projectsApi.checkpoints(id)
|
||||
const records = await projectsApi.checkpoints(id, undefined, 'breakdown')
|
||||
const latest = workflowCheckpoints(records, 'breakdown').at(-1)
|
||||
if (
|
||||
!cp ||
|
||||
@@ -366,7 +366,7 @@ async function commit() {
|
||||
v-model:open="open"
|
||||
title="候选安全预检"
|
||||
:busy="writing"
|
||||
description="核对剧本来源、活动任务和已有制作成果。无来源关系需逐条人工确认;全部预检通过后再确认采用正式结果。"
|
||||
description="逐条核对来源不明的关系,检查通过后再采用。"
|
||||
>
|
||||
<div class="space-y-6" :aria-busy="checking">
|
||||
<p v-if="checking" role="status" class="text-sm text-muted">正在读取安全预检…</p>
|
||||
@@ -375,7 +375,7 @@ async function commit() {
|
||||
正在等待最新保存记录,请刷新状态后继续核对。
|
||||
</p>
|
||||
<p v-else-if="!canCheck && !current" role="status" class="text-sm text-muted">
|
||||
当前任务或候选审核状态尚未满足预检条件,请刷新状态。
|
||||
候选暂不能检查,请刷新状态。
|
||||
</p>
|
||||
<p v-if="actionError" role="alert" class="text-sm text-danger">{{ actionError }}</p>
|
||||
<template v-if="current && !committed">
|
||||
@@ -408,7 +408,7 @@ async function commit() {
|
||||
<section class="min-w-0 space-y-4" aria-label="无来源关系">
|
||||
<WorkspaceSectionHeading
|
||||
title="核对关系来源"
|
||||
description="移除仅影响这条候选关系,不删除主体或镜头,也不会改写剧本。每次处理一条。"
|
||||
description="仅移除这条候选关联。主体、镜头和剧本会保留。"
|
||||
/>
|
||||
<article
|
||||
v-for="(item, index) in targets"
|
||||
@@ -475,7 +475,7 @@ async function commit() {
|
||||
</section>
|
||||
</div>
|
||||
<p v-if="ready" class="text-sm leading-7 text-muted">
|
||||
采用候选将替换正式主体、形态与分镜。保存时还会检查剧本变化及已有制作成果,关系修复不会自动执行这一步。
|
||||
采用后将替换正式主体、形态和分镜。保存前会检查剧本及已有成果。
|
||||
</p>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -101,10 +101,7 @@ const plans = computed(() => {
|
||||
<template>
|
||||
<!-- 以下是正式时长与候选来源的只读诊断 -->
|
||||
<section class="space-y-4" aria-label="时长预算诊断">
|
||||
<WorkspaceSectionHeading
|
||||
title="时长预算"
|
||||
description="分别核对正式剧集目标和拆解时采用的预算。失败候选可用于复盘。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="时长预算" description="核对剧集目标时长与拆解预算。" />
|
||||
<p v-if="query.loading.value" class="text-sm text-muted">正在读取时长预算…</p>
|
||||
<div v-else-if="query.error.value" class="space-y-2 text-sm">
|
||||
<p>{{ query.error.value }}</p>
|
||||
|
||||
@@ -185,7 +185,7 @@ function finish() {
|
||||
</p>
|
||||
</article>
|
||||
<p v-if="!quality && !groups.length && !workflowError" class="py-5 text-sm text-muted">
|
||||
当前没有具体错误描述,可读取修复清单确认待处理镜头。
|
||||
请查看修复清单中的待处理镜头。
|
||||
</p>
|
||||
</div>
|
||||
<!-- 以下是独立的问题修订与阶段恢复模块,不承载生成配置或候选提交 -->
|
||||
|
||||
@@ -257,10 +257,7 @@ async function repairActions() {
|
||||
<template>
|
||||
<!-- 以下是仅针对候选的主体与形态补齐模块 -->
|
||||
<section v-if="targets.length" class="workspace-panel space-y-4" aria-label="候选主体修复">
|
||||
<WorkspaceSectionHeading
|
||||
title="补齐候选主体引用"
|
||||
description="选择当前缺失引用及该主体已有形态,确认后保存为新的候选版本。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="补齐候选主体引用" description="选择缺失的主体关联和形态,保存为新候选。" />
|
||||
<div class="grid grid-cols-1 gap-4 lg:grid-cols-3">
|
||||
<NFormItem label="目标镜头"
|
||||
><NSelect
|
||||
@@ -300,12 +297,9 @@ async function repairActions() {
|
||||
</section>
|
||||
<!-- 以下是动作质量阻断的批量语义修订模块,不提供 kind 修改或自动修复 -->
|
||||
<section v-if="review?.actionQualityBlocks.length" class="workspace-panel space-y-4" aria-label="候选批量动作修复">
|
||||
<WorkspaceSectionHeading
|
||||
title="批量修订候选动作"
|
||||
description="仅展示当前阻断镜头。逐项选择并填写可观察的动作过程,提交前核对修复摘要。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="批量修订候选动作" description="填写镜头中能看到的动作,提交前核对修订。" />
|
||||
<p v-if="!actionDrafts.length" class="text-xs text-muted">
|
||||
此处仅支持填写结果状态引用的动作修订。其它问题可先使用下方“继续整理镜头”,由系统检查可修正项并保留剩余阻断。
|
||||
此处仅补写动作过程。其他问题可用“继续整理镜头”检查。
|
||||
</p>
|
||||
<article
|
||||
v-for="draft in actionDrafts"
|
||||
@@ -318,9 +312,7 @@ async function repairActions() {
|
||||
{{ draft.actionId }}</NCheckbox
|
||||
>
|
||||
<p class="text-xs leading-6 text-muted">原始状态:{{ draft.original }}</p>
|
||||
<p v-if="draft.parallel" class="text-xs text-danger">
|
||||
这个动作与其他动作同时发生。请先核对它们的关系,避免修改后互相冲突。
|
||||
</p>
|
||||
<p v-if="draft.parallel" class="text-xs text-danger">此动作与其他动作同时发生,请核对是否冲突。</p>
|
||||
<NInput
|
||||
v-model:value="draft.description"
|
||||
type="textarea"
|
||||
|
||||
@@ -167,9 +167,7 @@ onScopeDispose(reset)
|
||||
<p v-for="reason in readiness.blockingReasons" :key="reason" class="text-muted">
|
||||
{{ diagnosisReason(reason) }}
|
||||
</p>
|
||||
<p v-if="repairEligible" class="text-muted">
|
||||
可点击“查看并修订动作”,读取当前正式规划后再明确保存。
|
||||
</p>
|
||||
<p v-if="repairEligible" class="text-muted">查看并修订动作后,可保存修改。</p>
|
||||
<article
|
||||
v-for="(candidate, index) in readiness.repairCandidates"
|
||||
:key="index"
|
||||
|
||||
@@ -138,9 +138,7 @@ function updateTransition(resource: ResourceOccupancy, value: 'release' | 'trans
|
||||
<h3 class="text-sm font-medium">动作阶段</h3>
|
||||
<NButton size="small" :disabled="disabled" @click="addPhase">添加阶段</NButton>
|
||||
</div>
|
||||
<p class="text-xs leading-6 text-muted">
|
||||
同阶段动作视为同时发生;需要释放资源后再执行的动作,请安排在不同阶段。已有证据会完整保留。
|
||||
</p>
|
||||
<p class="text-xs leading-6 text-muted">同阶段动作同时发生。需要先后完成的动作请分开安排。</p>
|
||||
<section
|
||||
v-for="(phase, index) in draft.durationPlanning.phases"
|
||||
:key="index"
|
||||
|
||||
@@ -987,10 +987,7 @@ defineExpose({ open })
|
||||
</div>
|
||||
<p v-else class="text-muted">尚未预览,可在底部预览范围。</p>
|
||||
</section>
|
||||
<p class="text-muted">
|
||||
仅查看已有记录,不调用
|
||||
AI;未填写记录不代表镜头有误,也不改变正式审核结果。
|
||||
</p>
|
||||
<p class="text-muted">缺少记录不代表镜头有误。请以正式审核为准。</p>
|
||||
</div>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
@@ -1033,7 +1030,7 @@ defineExpose({ open })
|
||||
</div>
|
||||
<p v-if="previewError" class="text-danger" role="alert">{{ previewError }}</p>
|
||||
<p class="text-xs text-muted mt-3">
|
||||
AI 复查会产生模型费用,仅保存检查记录,不修改镜头。请先在底部预览范围,再确认启动。
|
||||
先预览范围,再确认 AI 复查。复查收费,只保存检查结果。
|
||||
</p>
|
||||
<p v-if="execution.active.value" class="text-xs text-muted mt-3">
|
||||
诊断任务进行中,可关闭弹窗继续查看分镜。
|
||||
@@ -1134,7 +1131,7 @@ defineExpose({ open })
|
||||
.diagnosis-scope-bar .diagnosis-scope-controls {
|
||||
margin-top: 0;
|
||||
}
|
||||
/* 主结论先于记录统计展示,只有真实问题使用错误底色。 */
|
||||
/* 主结论先于记录统计展示,问题摘要沿用公共提示样式。 */
|
||||
.diagnosis-result-overview {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
@@ -1143,7 +1140,6 @@ defineExpose({ open })
|
||||
}
|
||||
.diagnosis-result-overview.problem-surface {
|
||||
padding: 20px;
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
/* 成功摘要仅强调当前审核已通过,沿用公共主题的柔和成功底色。 */
|
||||
.diagnosis-result-overview.diagnosis-result-success {
|
||||
@@ -1233,9 +1229,6 @@ defineExpose({ open })
|
||||
.diagnosis-result-item {
|
||||
@apply p-3 bg-(--app-control) space-y-2;
|
||||
}
|
||||
.diagnosis-result-item.problem-surface {
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
/* 卡片操作在所有尺寸保留图标和完整文字,空间不足时按按钮自然换行。 */
|
||||
.diagnosis-card-actions {
|
||||
display: flex;
|
||||
|
||||
@@ -117,7 +117,7 @@ defineExpose({ locate })
|
||||
</p>
|
||||
</div>
|
||||
<ContextNotice v-if="!episode" type="info" :show-icon="false" class="mb-5">
|
||||
本集已完成节拍规划,镜头尚未生成。请等待进度更新,或在确认中断后使用“继续整理镜头”。
|
||||
本集镜头尚未生成。若任务已中断,可继续整理镜头。
|
||||
</ContextNotice>
|
||||
<section
|
||||
v-for="beat in plan.beats"
|
||||
@@ -134,7 +134,7 @@ defineExpose({ locate })
|
||||
<div class="beat-heading">
|
||||
<span class="beat-number">{{ String(beat.beatNo).padStart(2, '0') }}</span>
|
||||
<h3 class="text-sm font-semibold">{{ beat.title }}</h3>
|
||||
<NTag size="small" :bordered="false">{{ purposeLabels[beat.purpose] || beat.purpose }}</NTag>
|
||||
<NTag size="small" :bordered="false">{{ purposeLabels[beat.purpose] ?? '用途待确认' }}</NTag>
|
||||
<NButton
|
||||
v-if="plan && !diagnosisDisabled"
|
||||
size="tiny"
|
||||
@@ -201,11 +201,7 @@ defineExpose({ locate })
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
<EmptyState
|
||||
v-else
|
||||
title="分镜规划尚未生成"
|
||||
description="完成主体整理后,工作流会先规划每集的剧情节拍,再逐集生成镜头。"
|
||||
/>
|
||||
<EmptyState v-else title="分镜规划尚未生成" description="整理主体后会逐集生成镜头。" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -218,7 +214,8 @@ defineExpose({ locate })
|
||||
outline: none;
|
||||
}
|
||||
.breakdown-storyboard .diagnosis-problem-located {
|
||||
background: var(--app-danger-soft);
|
||||
background: var(--app-control-hover);
|
||||
box-shadow: inset 2px 0 color-mix(in srgb, var(--app-danger) 45%, transparent);
|
||||
}
|
||||
.beat-section {
|
||||
@apply mt-[25px] pt-[23px];
|
||||
|
||||
@@ -202,7 +202,7 @@ onScopeDispose(() => {
|
||||
<p class="text-xs leading-6 text-muted">仅修订尚未入库的镜头,保存后再恢复拆解。</p>
|
||||
<p v-if="error" role="alert" class="text-xs leading-6 text-danger">{{ error }}</p>
|
||||
<p v-if="plan && !plan.repairPlan.length && !error" role="status" class="text-xs text-muted">
|
||||
当前没有可人工修订的质量阻断镜头,不代表未诊断镜头已通过。
|
||||
暂无可人工修订的镜头。未检查的镜头仍待确认。
|
||||
</p>
|
||||
<article
|
||||
v-for="item in plan?.repairPlan"
|
||||
@@ -222,7 +222,7 @@ onScopeDispose(() => {
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
:title="targetLabel"
|
||||
description="调整镜头中的动作和先后顺序,保存时会重新检查这个镜头。此操作不调用模型。"
|
||||
description="可免费修订动作顺序,保存时会检查本镜。"
|
||||
:busy="operation.pending"
|
||||
wide
|
||||
>
|
||||
@@ -245,7 +245,7 @@ onScopeDispose(() => {
|
||||
><ConfirmAction
|
||||
:key="draftVersion"
|
||||
label="保存人工修订"
|
||||
description="保存当前镜头的动作安排。如果内容版本已变化或检查仍未通过,需要先处理问题。保存后还需继续拆解并提交正式结果。"
|
||||
description="保存动作后,请继续拆解并提交结果。若版本已变或检查未通过,请先处理。"
|
||||
:disabled="disabled || operation.pending || !current || !!issue"
|
||||
@confirm="save"
|
||||
/></template>
|
||||
|
||||
@@ -116,7 +116,7 @@ const filtered = computed(() =>
|
||||
<EmptyState
|
||||
v-else
|
||||
:title="subjects.length ? '没有匹配的主体' : '尚无主体结果'"
|
||||
description="主体会在抽取、合并与档案整理完成后出现在这里。若未启用该模块,则不会生成此类主体。"
|
||||
description="启用此模块并完成拆解后,即可查看主体。"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -21,13 +21,16 @@ import DramaReviewPanel from './review/DramaReviewPanel.vue'
|
||||
import DramaRewriteAction from './review/DramaRewriteAction.vue'
|
||||
|
||||
/** 剧本创作工作区,正式数据库内容为准,checkpoint 只补充计划与恢复信息。 */
|
||||
const { project, checkpoints, refresh, refreshStageReadiness, error } = useProjectContext()
|
||||
const context = useProjectContext()
|
||||
const { project, refreshStageReadiness, error } = context
|
||||
/** 规划和审核仅来自创作工作流正文。 */
|
||||
const dramaCheckpoints = context.useWorkflowCheckpoints('create-drama')
|
||||
/** 当前阅读的正式内容标签。 */
|
||||
const tab = ref('episodes')
|
||||
/** 任务详情按需查看;关闭弹窗不会停止任务观察。 */
|
||||
const taskOpen = ref(false)
|
||||
/** 仅使用创作工作流记录,避免混入拆解或改写候选。 */
|
||||
const dramaRecords = computed(() => workflowCheckpoints(checkpoints.value, 'create-drama'))
|
||||
const dramaRecords = computed(() => workflowCheckpoints(dramaCheckpoints.data.value ?? [], 'create-drama'))
|
||||
/** 最新保存状态,不回退历史规划或审核。 */
|
||||
const state = computed(() => dramaRecords.value.at(-1)?.state)
|
||||
/** 正文始终来自正式项目详情。 */
|
||||
@@ -46,10 +49,15 @@ const projectId = computed(() => project.value?.id ?? '')
|
||||
const initialTabProject = ref('')
|
||||
/** 首次进入按正式项目和当前审核记录定位;这里只引导阅读,不决定审核或改写权限。 */
|
||||
watch(
|
||||
[projectId, () => project.value?.status, () => state.value?.reviewPassed],
|
||||
[projectId, () => project.value?.status, () => state.value?.reviewPassed, dramaCheckpoints.data],
|
||||
() => {
|
||||
const current = project.value
|
||||
if (!current || initialTabProject.value === current.id) return
|
||||
if (
|
||||
!current ||
|
||||
initialTabProject.value === current.id ||
|
||||
(current.status === 'failed' && dramaCheckpoints.data.value === null)
|
||||
)
|
||||
return
|
||||
initialTabProject.value = current.id
|
||||
const needsReview =
|
||||
current.status === 'need_review' ||
|
||||
@@ -86,9 +94,12 @@ watch(
|
||||
return record ? ([record.id, record.stage, record.status] as const) : null
|
||||
},
|
||||
(record, previous) => {
|
||||
if (!record || (previous && record.every((value, index) => value === previous[index]))) return
|
||||
void refresh()
|
||||
if (record[2] === 'completed' || record[2] === 'failed') void refreshStageReadiness()
|
||||
if (!record || !previous || record.every((value, index) => value === previous[index])) return
|
||||
const current = backgroundExecution.query.data.value
|
||||
if (current?.projectId !== projectId.value) return
|
||||
const terminal = record[2] === 'completed' || record[2] === 'failed'
|
||||
void refreshDrama(current.projectId, terminal ? record[0] + ':' + record[2] : undefined)
|
||||
if (terminal) void refreshStageReadiness()
|
||||
}
|
||||
)
|
||||
/** 正式项目完成状态独立于任务结束与审核执行状态。 */
|
||||
@@ -126,13 +137,27 @@ const recoveryBlocked = computed(
|
||||
backgroundExecution.discovering.value ||
|
||||
!!backgroundExecution.discoveryError.value ||
|
||||
!!backgroundExecution.query.error.value ||
|
||||
!!error.value
|
||||
!!error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
dramaCheckpoints.loading.value ||
|
||||
!!dramaCheckpoints.error.value ||
|
||||
dramaCheckpoints.data.value === null
|
||||
)
|
||||
/** 用后端最新保存输出及当前节点呈现六个阶段。 */
|
||||
const stages = computed(() =>
|
||||
dramaStages(project.value, dramaRecords.value.at(-1), backgroundExecution.query.data.value)
|
||||
)
|
||||
|
||||
/**
|
||||
* 更新正式剧本、摘要及创作记录。
|
||||
* @param id 操作归属项目
|
||||
* @param executionKey 同一个任务终态的共享标识
|
||||
* @returns 数据刷新结束
|
||||
*/
|
||||
async function refreshDrama(id = projectId.value, executionKey?: string) {
|
||||
if (!id || projectId.value !== id) return
|
||||
await Promise.all([context.refreshProject(), context.refreshWorkflow('create-drama', id, executionKey)])
|
||||
}
|
||||
/** 用户明确确认后恢复未完成的生成,改写单独执行范围预检。 */
|
||||
async function resumeGeneration() {
|
||||
if (!project.value || recoveryBlocked.value || !canGenerate.value) return
|
||||
@@ -142,13 +167,13 @@ async function resumeGeneration() {
|
||||
await backgroundExecution.track(started.executionId, id)
|
||||
return started
|
||||
})
|
||||
await refresh()
|
||||
await refreshDrama(id)
|
||||
}
|
||||
|
||||
/** 重读项目、保存记录与任务状态,不启动或恢复生成。 */
|
||||
async function refreshTask() {
|
||||
await Promise.all([
|
||||
refresh(),
|
||||
refreshDrama(),
|
||||
backgroundExecution.discoveryError.value || !backgroundExecution.executionId.value
|
||||
? backgroundExecution.discover()
|
||||
: Promise.resolve(),
|
||||
@@ -168,7 +193,20 @@ function exportScript() {
|
||||
|
||||
<template>
|
||||
<WorkspacePage split compact class="script-workspace-page" :class="{ 'script-creation-complete': complete }"
|
||||
><template #header
|
||||
><template #notice>
|
||||
<ContextNotice v-if="dramaCheckpoints.error.value" type="error" role="alert">
|
||||
{{ dramaCheckpoints.error.value }}
|
||||
<NButton text size="small" @click="dramaCheckpoints.refresh">重试读取</NButton>
|
||||
</ContextNotice>
|
||||
<p
|
||||
v-else-if="!dramaCheckpoints.data.value && dramaCheckpoints.loading.value"
|
||||
class="text-xs text-muted"
|
||||
role="status"
|
||||
>
|
||||
正在读取创作记录…
|
||||
</p>
|
||||
</template>
|
||||
<template #header
|
||||
><div class="stage-strip">
|
||||
<!-- 以下是创作阶段进度 -->
|
||||
<div class="stage-strip-track">
|
||||
@@ -248,11 +286,7 @@ function exportScript() {
|
||||
<main class="h-full min-h-0 min-w-0">
|
||||
<div v-show="tab === 'episodes'" class="h-full">
|
||||
<EpisodeReader v-if="episodes.length" :episodes="episodes" />
|
||||
<EmptyState
|
||||
v-else
|
||||
title="剧本正在酝酿"
|
||||
description="先规划全剧故事,再展开分集剧本;剧集保存后会自动出现在这里。"
|
||||
/>
|
||||
<EmptyState v-else title="剧本正在酝酿" description="先规划故事,再编写分集剧本。" />
|
||||
</div>
|
||||
<NScrollbar v-if="tab !== 'episodes'" class="panel-scroll"
|
||||
><div v-if="tab === 'characters'" class="p-6 lg:p-8">
|
||||
@@ -324,12 +358,7 @@ function exportScript() {
|
||||
></WorkspacePage>
|
||||
|
||||
<!-- 以下是创作任务弹窗,后台观察独立于弹窗显隐,正文可滚动、底栏固定 -->
|
||||
<AppDialog
|
||||
v-model:open="taskOpen"
|
||||
title="创作任务"
|
||||
description="查看当前进度与保存记录,需要时继续未完成的创作。"
|
||||
:width="800"
|
||||
>
|
||||
<AppDialog v-model:open="taskOpen" title="创作任务" :width="800">
|
||||
<div v-if="taskOpen" class="script-task-sections">
|
||||
<ContextNotice v-if="historicalTask" type="info" title="当前剧本已完成审核" emphasized
|
||||
>当前结果已更新;下方保留的是最近一次任务的执行记录。</ContextNotice
|
||||
@@ -366,7 +395,7 @@ function exportScript() {
|
||||
aria-label="恢复提示"
|
||||
>
|
||||
<ContextNotice type="warning" title="暂不能恢复生成" emphasized>
|
||||
缺少已保存的故事规划。需要重新生成时,请新建剧本。
|
||||
暂无故事规划,请新建剧本。
|
||||
</ContextNotice>
|
||||
</section>
|
||||
<!-- 以下是默认收起的技术详情,不与日常进度和恢复提示混排 -->
|
||||
@@ -394,7 +423,7 @@ function exportScript() {
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '恢复剧集生成')"
|
||||
label="恢复生成"
|
||||
description="从已保存的故事规划继续编写剧集,再生成角色设定、世界观并审核。已有完整剧集时会核对来源并继续未完成的设定。可能产生模型调用费用。"
|
||||
description="从已有规划继续编写剧集、补齐设定并审核。可能产生费用。"
|
||||
acknowledgement
|
||||
:disabled="!canGenerate || recoveryBlocked"
|
||||
@confirm="resumeGeneration"
|
||||
@@ -403,7 +432,7 @@ function exportScript() {
|
||||
:project-id="projectId"
|
||||
label="恢复改写"
|
||||
:disabled="recoveryBlocked"
|
||||
@started="refresh"
|
||||
@started="refreshDrama()"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -28,12 +28,28 @@ const props = withDefaults(
|
||||
)
|
||||
/** 正式项目、保存记录与导航状态共用同一个数据源。 */
|
||||
const context = useProjectContext()
|
||||
/** 审核需要完整创作保存记录中的原始结论和裁决。 */
|
||||
const dramaCheckpoints = context.useWorkflowCheckpoints('create-drama')
|
||||
/** 当前入口绑定的项目,异步响应必须核对归属。 */
|
||||
const projectId = computed(() => props.projectId)
|
||||
/** 外部项目错误只限制写入,仍可只读查看。 */
|
||||
const disabled = computed(() => props.disabled || !!context.error.value)
|
||||
const disabled = computed(
|
||||
() =>
|
||||
props.disabled ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
dramaCheckpoints.loading.value ||
|
||||
!!dramaCheckpoints.error.value ||
|
||||
dramaCheckpoints.data.value === null
|
||||
)
|
||||
/** 人工确认与稳定原始索引选择。 */
|
||||
const flow = useDramaReview(projectId, context.refresh, disabled)
|
||||
/** 审核、改写及人工裁决只刷新创作记录和项目详情。 */
|
||||
async function refreshReview() {
|
||||
const id = projectId.value
|
||||
if (!id) return
|
||||
await Promise.all([context.refreshWorkflow('create-drama', id), context.refreshProject()])
|
||||
}
|
||||
const flow = useDramaReview(projectId, refreshReview, disabled)
|
||||
/** 最新正式审核。 */
|
||||
const latest = computed(() => flow.query.data.value?.latest ?? null)
|
||||
/** 当前已核对的处理预检。 */
|
||||
@@ -188,7 +204,7 @@ const groups = computed(() =>
|
||||
const recordedIssues = computed(() => latest.value?.qualityReview?.issues ?? [])
|
||||
/** 现有延期等裁决只作追溯,不能把接受视为已完成后续核验。 */
|
||||
const decisions = computed(() => {
|
||||
const checkpoint = workflowCheckpoints(context.checkpoints.value, 'create-drama').at(-1)
|
||||
const checkpoint = workflowCheckpoints(dramaCheckpoints.data.value ?? [], 'create-drama').at(-1)
|
||||
return preview.value && checkpoint?.checkpointId === preview.value.checkpointId
|
||||
? (savedReviewDecisions(checkpoint.state.review, preview.value.reviewId) ??
|
||||
latest.value?.manualUncertaintyDecisions ??
|
||||
@@ -200,9 +216,12 @@ watch(sourceEpisodes, value => {
|
||||
})
|
||||
/** 其它入口改写结束时,保存记录变化会触发一次重读,不定时查询。 */
|
||||
watch(
|
||||
() => workflowCheckpoints(context.checkpoints.value, 'create-drama').at(-1)?.checkpointId,
|
||||
(id, previous) => {
|
||||
if (id && id !== previous && !flow.writing.value) void flow.query.refresh()
|
||||
() => {
|
||||
const record = workflowCheckpoints(dramaCheckpoints.data.value ?? [], 'create-drama').at(-1)
|
||||
return record ? record.checkpointId + ':' + (record.updatedAt ?? '') : ''
|
||||
},
|
||||
(version, previous) => {
|
||||
if (previous && version && version !== previous && !flow.writing.value) void flow.query.refresh()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -289,7 +308,7 @@ function editorClosed() {
|
||||
:project-id="projectId"
|
||||
:primary="primaryAction === 'review'"
|
||||
:disabled="disabled || flow.locked.value"
|
||||
@started="context.refresh"
|
||||
@started="refreshReview"
|
||||
/>
|
||||
<NButton
|
||||
v-if="hasManualIssues"
|
||||
@@ -306,7 +325,7 @@ function editorClosed() {
|
||||
:project-id="projectId"
|
||||
:primary="primaryAction === 'rewrite'"
|
||||
:disabled="disabled || flow.writing.value || latest?.passed === true"
|
||||
@started="context.refresh"
|
||||
@started="refreshReview"
|
||||
/>
|
||||
</template>
|
||||
</WorkspaceSectionHeading>
|
||||
@@ -320,7 +339,7 @@ function editorClosed() {
|
||||
<EmptyState
|
||||
v-else-if="!latest && !flow.query.error.value"
|
||||
title="暂无审核记录"
|
||||
description="正式审核完成后会显示结果;刷新不会重新启动审核。"
|
||||
description="审核完成后可查看结果。"
|
||||
/>
|
||||
<template v-if="latest">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
@@ -445,7 +464,7 @@ function editorClosed() {
|
||||
v-model:open="flow.editorOpen.value"
|
||||
class="review-confirm-drawer"
|
||||
title="审核人工确认"
|
||||
description="对照正式正文逐项核对。本次确认不调用模型,也不会自动改写。"
|
||||
description="对照剧本核对问题。确认免费,改写需另行启动。"
|
||||
:busy="flow.writing.value"
|
||||
@closed="editorClosed"
|
||||
>
|
||||
@@ -493,7 +512,7 @@ function editorClosed() {
|
||||
"
|
||||
class="text-muted"
|
||||
>
|
||||
原错误与警告选择已撤销,请对照当前问题重新选择。
|
||||
问题已更新,请重新选择。
|
||||
</p>
|
||||
</div>
|
||||
</NCollapseItem>
|
||||
@@ -513,7 +532,7 @@ function editorClosed() {
|
||||
<section v-if="groups.length || !flow.uncertaintyRows.value.length">
|
||||
<WorkspaceSectionHeading
|
||||
title="待确认问题"
|
||||
description="确认错误用于后续改写;接受警告表示保留当前处理。未选择的条目继续保留。"
|
||||
description="确认错误供改写使用。接受警告或未选条目会保留原处理。"
|
||||
/>
|
||||
<NCollapse
|
||||
v-if="groups.length"
|
||||
@@ -533,7 +552,7 @@ function editorClosed() {
|
||||
:data-review-issue="row.originalIndex"
|
||||
class="review-issue-card"
|
||||
:class="{
|
||||
'review-issue-error':
|
||||
'problem-surface':
|
||||
row.issue.severity === 'error' && !row.issue.policyException
|
||||
}"
|
||||
>
|
||||
@@ -615,7 +634,7 @@ function editorClosed() {
|
||||
<section>
|
||||
<WorkspaceSectionHeading
|
||||
title="待核对说明"
|
||||
description="默认保留待处理。可选择标有“建议”的处理方式,也可核对原文后另行决定;确认保存后才会生效。"
|
||||
description="可采纳建议,也可核对原文后决定。保存后生效。"
|
||||
/>
|
||||
<div v-if="flow.uncertaintyRows.value.length" class="mt-4 grid gap-4">
|
||||
<ReviewUncertaintyCard
|
||||
@@ -638,10 +657,7 @@ function editorClosed() {
|
||||
</section>
|
||||
<!-- 以下是人工补充表单,首次打开和新增空行不立即报错 -->
|
||||
<section v-if="!latest?.passed" ref="manualElement">
|
||||
<WorkspaceSectionHeading
|
||||
title="人工补充证据"
|
||||
description="仅补充你已核实的真实错误,不自动将不确定说明转换为错误。"
|
||||
>
|
||||
<WorkspaceSectionHeading title="人工补充证据" description="只补充已核实的错误。">
|
||||
<template #actions
|
||||
><NButton
|
||||
:disabled="flow.locked.value || !preview?.episodes.length"
|
||||
@@ -678,9 +694,7 @@ function editorClosed() {
|
||||
<NCollapse v-model:expanded-names="sourceExpanded">
|
||||
<NCollapseItem name="source" title="正式剧本原文">
|
||||
<div class="review-source-fields grid gap-4">
|
||||
<p class="text-xs leading-6 text-muted">
|
||||
引用必须逐字出现在所选剧集中,不能用事件编号代替。
|
||||
</p>
|
||||
<p class="text-xs leading-6 text-muted">请引用所选剧集的原句。</p>
|
||||
<NSelect
|
||||
v-model:value="sourceEpisode"
|
||||
:options="episodeOptions"
|
||||
@@ -768,9 +782,6 @@ function editorClosed() {
|
||||
padding: var(--app-content-gap);
|
||||
background: var(--app-subtle);
|
||||
}
|
||||
.review-issue-card.review-issue-error {
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
.review-source-quote {
|
||||
@apply whitespace-pre-wrap wrap-anywhere text-sm leading-7;
|
||||
padding: var(--app-content-gap);
|
||||
|
||||
@@ -133,7 +133,7 @@ async function confirm() {
|
||||
本次核查已保存的 {{ query.data.value.episodeCount }} 集,不会重写正文、角色设定或世界观。
|
||||
</p>
|
||||
<ContextNotice type="info" title="本次操作会调用模型"
|
||||
>系统会检查完整正文,必要时再复核一次疑点。明确错误会保留为改写依据,无法确认的关键问题仍会保留;请勿重复提交。</ContextNotice
|
||||
>检查完整剧本,记录改写依据和待确认问题。请勿重复提交。</ContextNotice
|
||||
>
|
||||
<ContextNotice v-if="query.error.value || actionError" type="error" title="暂不能开始核查">{{
|
||||
actionError || query.error.value
|
||||
|
||||
@@ -148,7 +148,7 @@ function viewSource() {
|
||||
v-if="suggestion?.requiresEpisodeSelection || suggestion?.confidence !== 'high'"
|
||||
class="text-xs leading-6 text-muted"
|
||||
>
|
||||
请明确选择负责验证的剧集;建议候选之外的正式剧集也可选择。
|
||||
请选择用于验证的剧集,也可选建议之外的剧集。
|
||||
</p>
|
||||
<NFormItem label="负责验证的剧集" required>
|
||||
<NSelect
|
||||
|
||||
@@ -270,15 +270,12 @@ onScopeDispose(() => {
|
||||
type="warning"
|
||||
:show-icon="false"
|
||||
>
|
||||
当前没有可用的完整图片和视频模型,暂时无法保存项目生成配置。
|
||||
请先配置可用的图片和视频模型。
|
||||
</ContextNotice>
|
||||
<div v-if="profile" class="creative-profile-grid">
|
||||
<!-- 以下是独占一行的画布设置,与下方两个模型分组共用边界 -->
|
||||
<section class="creative-profile-canvas space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="画布设置"
|
||||
description="设置作品画面比例,后续制作使用已保存的项目画布。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="画布设置" description="用于后续图片和视频制作。" />
|
||||
<NFormItem label="作品宽高比">
|
||||
<NSelect
|
||||
:value="profile.aspectRatio"
|
||||
@@ -290,11 +287,7 @@ onScopeDispose(() => {
|
||||
</section>
|
||||
<!-- 以下是项目图片生成配置模块 -->
|
||||
<section class="model-section min-w-0">
|
||||
<WorkspaceSectionHeading
|
||||
class="mb-4"
|
||||
title="图片配置"
|
||||
description="选择图片模型和默认生成参数,后续图片制作将继承此配置。"
|
||||
/>
|
||||
<WorkspaceSectionHeading class="mb-4" title="图片配置" />
|
||||
<NFormItem label="图片模型">
|
||||
<NSelect
|
||||
:value="imageSelection"
|
||||
@@ -311,11 +304,7 @@ onScopeDispose(() => {
|
||||
</section>
|
||||
<!-- 以下是项目视频生成配置模块 -->
|
||||
<section class="model-section min-w-0">
|
||||
<WorkspaceSectionHeading
|
||||
class="mb-4"
|
||||
title="视频配置"
|
||||
description="选择视频模型和默认生成参数,后续视频制作将继承此配置。"
|
||||
/>
|
||||
<WorkspaceSectionHeading class="mb-4" title="视频配置" />
|
||||
<NFormItem label="视频模型">
|
||||
<NSelect
|
||||
:value="videoSelection"
|
||||
|
||||
@@ -44,9 +44,6 @@ const activeForm = computed(() => (tab.value === 'quality' ? qualityForm.value :
|
||||
<template>
|
||||
<!-- 以下是内容铺满视口的项目全局配置抽屉模块 -->
|
||||
<AppDrawer v-model:open="open" title="项目全局配置" :busy="saving">
|
||||
<template #description
|
||||
>生成配置用于后续生图和视频;质量规则用于拆解与分镜检查,启动拆解时会引导核对确认。</template
|
||||
>
|
||||
<!-- 以下是生成配置与质量规则分类导航,保存期间禁止切换 -->
|
||||
<NTabs v-if="open" v-model:value="tab" type="line" size="small">
|
||||
<NTabPane name="generation" tab="生成配置" :disabled="saving" display-directive="show:lazy">
|
||||
|
||||
@@ -229,7 +229,7 @@ defineExpose({ save, canSave, validatedDraft })
|
||||
<section class="space-y-4" aria-label="动作与物理规则">
|
||||
<WorkspaceSectionHeading
|
||||
title="动作与物理规则"
|
||||
description="先选整体表现方式,再勾选故事中允许的动作。切换方式不会自动勾选,也不会自动添加剧情或重新生成已有内容。"
|
||||
description="选择表现方式和允许的动作。已有内容保留。"
|
||||
/>
|
||||
<NFormItem label="物理表现方式" :label-props="{ id: 'quality-physics-mode-label' }">
|
||||
<div class="quality-policy-field">
|
||||
@@ -267,7 +267,7 @@ defineExpose({ save, canSave, validatedDraft })
|
||||
<NFormItem label="自定义规则" :label-props="{ for: 'quality-custom-rules' }">
|
||||
<div class="quality-policy-field">
|
||||
<p id="quality-custom-rules-help" class="text-xs leading-6 text-muted">
|
||||
补充这个故事允许的特殊情况或需要遵守的要求,每行一条,最多 30 条。
|
||||
填写例外或要求,每行一条,最多 30 条。
|
||||
</p>
|
||||
<NInput
|
||||
v-model:value="rulesText"
|
||||
|
||||
@@ -46,6 +46,7 @@ const {
|
||||
videoStatusItem,
|
||||
query,
|
||||
episodeSourceUnavailable,
|
||||
breakdownRecords,
|
||||
operation,
|
||||
session,
|
||||
concurrency,
|
||||
@@ -308,9 +309,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
<div>
|
||||
<p class="eyebrow">镜头制作</p>
|
||||
<h2 class="text-lg font-semibold">镜头生产</h2>
|
||||
<p class="mt-2 text-sm text-muted">
|
||||
从可生成的提示词和首帧,到异步视频任务与最终成片。
|
||||
</p>
|
||||
<p class="mt-2 text-sm text-muted">制作首帧、视频和成片。</p>
|
||||
</div>
|
||||
</div>
|
||||
<section class="production-batch-config workspace-panel" aria-label="项目生产配置">
|
||||
@@ -351,7 +350,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
<section class="production-tool-section workspace-panel">
|
||||
<h3 class="text-sm font-semibold">处理范围与覆盖规则</h3>
|
||||
<p class="mt-3 text-xs leading-6 text-muted">
|
||||
提示词与视频就绪检查面向全项目;视频实际提交受本批镜头上限控制,并使用严格质量流水线。首帧默认补当前剧集,存在过期主首帧时优先更新全项目过期项,覆盖模式处理全项目;过期首帧成功后会自动接替旧主图,其余新增候选。图片模型、视频模型与视觉校验均可能产生费用。
|
||||
提示词和视频准备情况按全项目检查,视频按本批上限提交。首帧默认补当前集,有过期主首帧时先更新全项目过期项。覆盖模式处理全项目。更新成功会替换过期主首帧,其余只新增候选。生成和质量检查可能收费。
|
||||
</p>
|
||||
</section>
|
||||
<section class="workspace-overview-panel production-tool-section workspace-panel">
|
||||
@@ -595,7 +594,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
:show-icon="false"
|
||||
class="text-xs"
|
||||
>
|
||||
输入规划暂不可用,仍可按“全部推荐模式”提交;刷新后可重试规划。
|
||||
暂未读取生成方案。可刷新,或使用推荐模式。
|
||||
</ContextNotice>
|
||||
<NFormItem path="videoInputMode" label="输入规划范围">
|
||||
<NSelect
|
||||
@@ -643,9 +642,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold">视频任务状态</h3>
|
||||
<p class="mt-2 text-xs text-muted">
|
||||
状态统计取每个镜头最近一次任务,不等同于主视频数量。
|
||||
</p>
|
||||
<p class="mt-2 text-xs text-muted">按每个镜头最近一次任务统计。</p>
|
||||
</div>
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '重试失败视频任务')"
|
||||
@@ -654,7 +651,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
blocked || !batchValid || !query.data.value.videoStatus.failed
|
||||
"
|
||||
acknowledgement
|
||||
description="只重新提交可以重试的失败视频;其他项目会跳过,并在结果中显示数量。"
|
||||
description="重试可恢复的失败视频,其余跳过。"
|
||||
@confirm="run('retry-videos')"
|
||||
/>
|
||||
</div>
|
||||
@@ -710,8 +707,19 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
@dismiss="keyframeQualityExecution.dismiss"
|
||||
/>
|
||||
<!-- 以下是重生成后正文缺省的真实数据说明模块 -->
|
||||
<ContextNotice v-if="breakdownRecords.error.value" type="error" role="alert">
|
||||
{{ breakdownRecords.error.value }}
|
||||
<NButton text size="small" @click="breakdownRecords.refresh">重试读取</NButton>
|
||||
</ContextNotice>
|
||||
<p
|
||||
v-if="!breakdownRecords.data.value && breakdownRecords.loading.value"
|
||||
class="text-xs text-muted"
|
||||
role="status"
|
||||
>
|
||||
正在读取分镜记录…
|
||||
</p>
|
||||
<ContextNotice v-if="episodeSourceUnavailable" type="info" :show-icon="false">
|
||||
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
|
||||
本集镜头已更新。标题和剧情详情待补齐。
|
||||
</ContextNotice>
|
||||
<NScrollbar v-if="query.error.value" class="workspace-feedback"
|
||||
><ContextNotice role="alert" type="error" :show-icon="false"
|
||||
@@ -880,11 +888,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
<EmptyState
|
||||
v-else-if="query.data.value"
|
||||
title="本集还没有正式镜头"
|
||||
description="先完成剧本拆解和分镜设计,再进入镜头生产。"
|
||||
/>
|
||||
<EmptyState v-else-if="query.data.value" title="本集还没有正式镜头" description="请先完成拆解和分镜设计。" />
|
||||
<p v-else-if="query.loading.value" class="panel mt-5 p-8 text-sm text-muted" role="status">
|
||||
正在检查全项目生产就绪状态……
|
||||
</p>
|
||||
|
||||
@@ -81,10 +81,10 @@ const confirmationDescription = computed(
|
||||
<NCollapse v-model:expanded-names="expanded" class="production-tool-section"
|
||||
><NCollapseItem name="advanced" title="高级:串联生产(全项目)">
|
||||
<ContextNotice type="warning" :show-icon="false"
|
||||
>依次补齐形态提示词、参考图、首帧质量校验与修复、视频提示词,再提交视频任务。视觉风格、身份母版、导演设计和即时状态仍需提前准备。</ContextNotice
|
||||
>先准备风格、身份母版和镜头设计,再补齐参考图、首帧和视频描述。</ContextNotice
|
||||
>
|
||||
<p class="mt-3 text-xs leading-6 text-muted">
|
||||
处理整个项目,并保留已有可用结果。试运行可以整理文字、检查图片、生成主体图片和少量首帧,并准备视频描述;会在真正生成视频前停止。试运行中的文字和图片处理仍可能产生费用。
|
||||
试运行保留可用结果,准备文字、主体图片和少量首帧,生成视频前停止。文字和图片处理可能收费。
|
||||
</p>
|
||||
<!-- 以下是生产范围配置模块,修改任一参数后须重新预检。 -->
|
||||
<div class="surface-inset mt-4 p-4">
|
||||
@@ -130,7 +130,7 @@ const confirmationDescription = computed(
|
||||
scopeError
|
||||
}}</ContextNotice>
|
||||
<ContextNotice v-if="!safeMode && !stopAfter" type="warning" :show-icon="false" class="mt-3">
|
||||
已关闭测试安全模式。启动后会进入视频任务提交阶段并产生较高视频生成费用。
|
||||
安全模式已关闭。启动后会提交视频生成并收费。
|
||||
</ContextNotice>
|
||||
</div>
|
||||
<!-- 以下是无消耗预检与费用确认模块。 -->
|
||||
@@ -216,9 +216,7 @@ const confirmationDescription = computed(
|
||||
{{ receipt.stableIdentityAnchorResult.generated }} · 失败
|
||||
{{ receipt.stableIdentityAnchorResult.failed }}
|
||||
</p>
|
||||
<p class="mt-3 text-xs text-muted">
|
||||
流程返回不等于成片完成。已保存结果不会回滚,最终结果以各资产页为准。
|
||||
</p>
|
||||
<p class="mt-3 text-xs text-muted">已保存的成果会保留。成片进度请到素材页查看。</p>
|
||||
<p v-for="row in rows" :key="row.name" class="mt-2 text-xs">
|
||||
{{ row.name }}:<template v-if="row.result"
|
||||
>共 {{ row.result.total }} · 生成 {{ row.result.generated }} · 跳过 {{ row.result.skipped }} ·
|
||||
|
||||
@@ -66,9 +66,7 @@ onScopeDispose(() => controller?.abort())
|
||||
<NCollapseItem name="episode-assembly" title="单集成片拼接">
|
||||
<NSpin :show="loading">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<p class="text-xs text-muted">
|
||||
按剧情段落和镜头顺序拼接当前选用的视频。目前只生成无声视频,不包含对白、配乐、字幕和转场。
|
||||
</p>
|
||||
<p class="text-xs text-muted">按镜头顺序拼接所选视频。成片无声,无字幕和转场。</p>
|
||||
<NButton size="small" :disabled="loading" @click="refresh">刷新就绪状态</NButton>
|
||||
</div>
|
||||
<FeedbackMessage v-if="error" :message="error" />
|
||||
|
||||
@@ -43,10 +43,7 @@ const qualityIssues = computed(() =>
|
||||
<template>
|
||||
<!-- 以下是道具结构规格准备模块,可准备不等于已经完成 -->
|
||||
<section v-if="specs" class="space-y-4" aria-label="道具结构规格">
|
||||
<WorkspaceSectionHeading
|
||||
title="道具结构规格"
|
||||
description="仅检查已有资料。待准备项需先补齐画面描述或规格,尚未执行。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="道具结构规格" description="先补齐缺少的画面描述或规格。" />
|
||||
<div class="flex flex-wrap gap-x-5 gap-y-2 text-xs">
|
||||
<span>共 {{ specs.total }} 项</span><span>已就绪 {{ specs.ready }}</span
|
||||
><span>待准备 {{ specs.upstreamResolvable }}</span
|
||||
@@ -85,10 +82,7 @@ const qualityIssues = computed(() =>
|
||||
</section>
|
||||
<!-- 以下是已确认母版依赖及准备顺序模块 -->
|
||||
<section v-if="anchors.length" class="space-y-4" aria-label="母版准备顺序">
|
||||
<WorkspaceSectionHeading
|
||||
title="母版准备顺序"
|
||||
description="按已确认的共享关系排列;锁定资产和人工阻断需要先核对。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="母版准备顺序" description="按已确认的共享关系排列。" />
|
||||
<ol class="space-y-4 text-xs leading-6">
|
||||
<li v-for="(item, index) in anchors" :key="item.subjectId" class="min-w-0">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
@@ -115,10 +109,7 @@ const qualityIssues = computed(() =>
|
||||
</section>
|
||||
<!-- 以下是图片质量问题处理入口模块,保留旧图且不自动生成 -->
|
||||
<section v-if="qualityIssues.length" class="space-y-4 lg:col-span-2" aria-label="图片质量待处理">
|
||||
<WorkspaceSectionHeading
|
||||
title="图片质量待处理"
|
||||
description="审核失败或证据过期时,先核对候选并明确重新审核。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="图片质量待处理" description="请核对候选后重新审核。" />
|
||||
<article v-for="item in qualityIssues" :key="item.subjectFormId" class="space-y-2 text-xs leading-6">
|
||||
<strong>{{ item.subjectName }} · {{ item.formName }}</strong>
|
||||
<p
|
||||
|
||||
@@ -128,7 +128,7 @@ watch(
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
:title="`${replacePrimary ? '生成替代候选' : '生成首帧候选'} · ${shotTitle}`"
|
||||
description="新图先作为候选;完成质量检查并通过后,才能设为主首帧。"
|
||||
description="新图通过检查后可设为主首帧。"
|
||||
:busy="submitting"
|
||||
>
|
||||
<AppForm
|
||||
@@ -140,14 +140,11 @@ watch(
|
||||
@submit="submit"
|
||||
>
|
||||
<ContextNotice v-if="replacePrimary" type="info" :show-icon="false" class="mt-5 text-xs">
|
||||
当前主首帧使用的主体参考资产已经变化。新图成功后应设为主首帧,旧图会继续保留为历史候选。
|
||||
参考图已变化。新候选通过后可设为主首帧,旧图会保留。
|
||||
</ContextNotice>
|
||||
<section v-if="generationCatalog" class="dialog-section mt-5" aria-label="本次首帧生成模型设置">
|
||||
<p class="text-xs font-medium">
|
||||
<FieldLabel
|
||||
label="本次生成设置"
|
||||
description="仅覆盖当前镜头本次首帧生成,不修改项目默认图片模型。"
|
||||
/>
|
||||
<FieldLabel label="本次生成设置" description="仅用于本次首帧生成。" />
|
||||
</p>
|
||||
<GenerationModelControls
|
||||
class="mt-4"
|
||||
|
||||
@@ -50,7 +50,7 @@ const display = computed<ImagePreview | null>(() => {
|
||||
|
||||
<template>
|
||||
<!-- 以下是当前候选生成输入的按需详情 -->
|
||||
<NCollapse v-model:expanded-names="expanded" class="mb-4">
|
||||
<NCollapse v-model:expanded-names="expanded">
|
||||
<NCollapseItem name="generation" title="当次参考图和画面描述">
|
||||
<p v-if="query.loading.value" role="status" class="text-xs text-muted">正在读取生成记录…</p>
|
||||
<NButton
|
||||
@@ -62,12 +62,6 @@ const display = computed<ImagePreview | null>(() => {
|
||||
>刷新生成记录</NButton
|
||||
>
|
||||
<template v-if="display && snapshot">
|
||||
<p class="text-xs text-muted">
|
||||
快照版本 {{ snapshot.version
|
||||
}}<template v-if="snapshot.width && snapshot.height">
|
||||
· {{ snapshot.width }} × {{ snapshot.height }}</template
|
||||
>
|
||||
</p>
|
||||
<ImageGenerationPreview
|
||||
:preview="display"
|
||||
:historical-references="snapshot.references"
|
||||
@@ -80,8 +74,8 @@ const display = computed<ImagePreview | null>(() => {
|
||||
<p v-else-if="query.data.value" class="text-xs text-muted">
|
||||
{{
|
||||
query.data.value.inputSnapshotStatus === 'not-recorded'
|
||||
? '这张首帧没有保存当次生成输入。'
|
||||
: '这张首帧的生成证据已损坏,无法读取。'
|
||||
? '暂无这张首帧的生成记录。'
|
||||
: '这张首帧的生成记录无法读取。'
|
||||
}}
|
||||
</p>
|
||||
</NCollapseItem>
|
||||
|
||||
@@ -78,6 +78,14 @@ const reviewQuery = useQuery(key, (value, signal) => {
|
||||
return qualityApi.keyframeQualityReview(shotId, keyframeId, signal)
|
||||
})
|
||||
const review = computed(() => reviewQuery.data.value)
|
||||
/** 视线复核的系统选项只在展示层转成中文。 */
|
||||
const gazeEvidenceLabels: Record<string, string> = {
|
||||
aligned: '符合预期',
|
||||
misaligned: '偏离目标',
|
||||
clear: '清楚',
|
||||
ambiguous: '不明确',
|
||||
unverifiable: '无法核实'
|
||||
}
|
||||
const decisionLabel = (value: string) =>
|
||||
({
|
||||
passed: 'AI 校验通过',
|
||||
@@ -85,7 +93,7 @@ const decisionLabel = (value: string) =>
|
||||
needs_review: '需要人工复核',
|
||||
manual_accepted: '人工已接受',
|
||||
unknown: '未校验'
|
||||
})[value] ?? value
|
||||
})[value] ?? '待确认'
|
||||
const reviewAction = ref<'accepted' | 'rejected' | null>(null)
|
||||
const reviewReason = ref('')
|
||||
const reviewer = ref('user')
|
||||
@@ -155,7 +163,6 @@ const records = computed(() =>
|
||||
:collapsible="!initialOpen"
|
||||
:show-header="!initialOpen"
|
||||
title="首帧校验历史"
|
||||
description="查看记录不收费;设置主首帧前仍需完成本次检查。"
|
||||
:loading="query.loading.value"
|
||||
:error="query.error.value"
|
||||
@refresh="
|
||||
@@ -167,20 +174,18 @@ const records = computed(() =>
|
||||
>
|
||||
<section v-if="review" class="panel p-3 text-xs leading-6">
|
||||
<p class="font-semibold">当前质量复核</p>
|
||||
<p>原始模型判定:{{ decisionLabel(review.qualityDecision) }}</p>
|
||||
<p>当前有效状态:{{ decisionLabel(review.effectiveQualityStatus) }}</p>
|
||||
<p>AI 检查:{{ decisionLabel(review.qualityDecision) }}</p>
|
||||
<p>当前状态:{{ decisionLabel(review.effectiveQualityStatus) }}</p>
|
||||
<p v-if="review.manualReview">
|
||||
人工审核:{{ review.manualReview.decision === 'accepted' ? '已接受' : '已拒绝' }} ·
|
||||
{{ review.manualReview.reason || '未填写理由' }}
|
||||
</p>
|
||||
<p v-else-if="review.manualReviewAvailable" class="text-muted">
|
||||
已发现可人工复核的证据分歧;当前仅展示信息,不会自动接受候选。
|
||||
</p>
|
||||
<p v-else-if="review.manualReviewAvailable" class="text-muted">有待人工核对的问题。</p>
|
||||
<div v-for="(item, index) in review.historicalGazePreview" :key="index" class="mt-2 bg-muted/10 p-2">
|
||||
<p>{{ item.subjectRef }} → {{ item.targetDescription }}:{{ decisionLabel(item.decision) }}</p>
|
||||
<p>
|
||||
结构判断:{{ item.physicalAlignment || '未知' }};独立观察:{{
|
||||
item.observationCertainty || '未知'
|
||||
结构判断:{{ gazeEvidenceLabels[item.physicalAlignment || ''] ?? '待确认' }};独立观察:{{
|
||||
gazeEvidenceLabels[item.observationCertainty || ''] ?? '待确认'
|
||||
}}
|
||||
</p>
|
||||
<p class="text-muted">{{ item.reason }}</p>
|
||||
@@ -242,12 +247,12 @@ const records = computed(() =>
|
||||
role="status"
|
||||
class="text-sm text-muted"
|
||||
>
|
||||
{{ userFacingText(state.unknown?.recoveryReason, '审核结果或费用待核查,请勿重复提交。') }}
|
||||
{{ userFacingText(state.unknown?.recoveryReason, '结果或费用待核对,请勿重试。') }}
|
||||
</p>
|
||||
<p v-else-if="state.active" role="status" class="text-sm text-muted">
|
||||
审核{{ execution.data.value?.status === 'pending' ? '等待开始' : '在后台进行' }},关闭页面后仍会保存记录。
|
||||
审核{{ execution.data.value?.status === 'pending' ? '等待开始' : '在后台进行' }}。
|
||||
</p>
|
||||
<p v-else-if="state.resumable" class="text-sm text-muted">可在质量检查中使用原参数继续;已保存的步骤会复用。</p>
|
||||
<p v-else-if="state.resumable" class="text-sm text-muted">可继续原审核。</p>
|
||||
<p v-if="!records.length" class="text-muted">暂无校验记录。</p>
|
||||
<!-- 以下是实际校验结论、问题与调用错误模块 -->
|
||||
<article v-for="record in records" :key="record.id" class="panel mt-3 p-3">
|
||||
@@ -259,7 +264,7 @@ const records = computed(() =>
|
||||
? record.validation.passed
|
||||
? '视觉通过'
|
||||
: '视觉未通过'
|
||||
: '未取得完整视觉结论'
|
||||
: '暂无结论'
|
||||
}}
|
||||
</p>
|
||||
<p v-if="record.allowedTexts !== undefined" class="text-muted">
|
||||
@@ -287,15 +292,19 @@ const records = computed(() =>
|
||||
:name="step.name"
|
||||
:title="`${stepNames[step.name]} · ${stepLabels[step.status]}`"
|
||||
>
|
||||
<dl class="grid gap-1 wrap-anywhere text-xs text-muted">
|
||||
<div v-if="step.startedAt">开始:{{ formatDate(step.startedAt) }}</div>
|
||||
<div v-if="step.finishedAt">完成:{{ formatDate(step.finishedAt) }}</div>
|
||||
<div v-if="step.requestId">请求编号:{{ step.requestId }}</div>
|
||||
<div v-if="step.providerRequestId">模型服务请求编号:{{ step.providerRequestId }}</div>
|
||||
<div v-for="(count, unit) in step.usage" :key="unit">
|
||||
{{ usageLabels[unit] }}词元:{{ count }}
|
||||
</div>
|
||||
</dl>
|
||||
<NCollapse>
|
||||
<NCollapseItem name="diagnostics" title="高级详情">
|
||||
<dl class="grid gap-1 wrap-anywhere text-xs text-muted">
|
||||
<div v-if="step.startedAt">开始:{{ formatDate(step.startedAt) }}</div>
|
||||
<div v-if="step.finishedAt">完成:{{ formatDate(step.finishedAt) }}</div>
|
||||
<div v-if="step.requestId">请求编号:{{ step.requestId }}</div>
|
||||
<div v-if="step.providerRequestId">模型服务请求编号:{{ step.providerRequestId }}</div>
|
||||
<div v-for="(count, unit) in step.usage" :key="unit">
|
||||
{{ usageLabels[unit] }}词元:{{ count }}
|
||||
</div>
|
||||
</dl>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
<ul v-if="step.issues?.length" class="mt-2 space-y-1 text-xs">
|
||||
<li v-for="(issue, index) in step.issues" :key="index" class="text-danger">
|
||||
{{ issue.subjectRef ? issue.subjectRef + ' · ' : ''
|
||||
@@ -303,7 +312,7 @@ const records = computed(() =>
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else class="mt-2 text-xs text-muted">
|
||||
{{ step.issues ? '本步骤未发现结构化问题。' : '尚无此步骤的结构化问题记录。' }}
|
||||
{{ step.issues ? '未发现问题。' : '暂无问题记录。' }}
|
||||
</p>
|
||||
<p v-if="step.error" class="mt-2 text-danger">{{ userFacingText(step.error) }}</p>
|
||||
</NCollapseItem>
|
||||
|
||||
@@ -96,9 +96,7 @@ const problems = computed(() => [
|
||||
</tbody>
|
||||
</table>
|
||||
</NScrollbar>
|
||||
<p class="mt-2 text-xs text-muted">
|
||||
计划只反映当前准备情况。图片生成完成后仍需通过质量和来源检查;失败候选会保留,不能用重新生图自动消除质量阻断。
|
||||
</p>
|
||||
<p class="mt-2 text-xs text-muted">图片通过质量和来源检查后才可使用。失败候选会保留,请先处理失败原因。</p>
|
||||
<ContextNotice v-if="plan.hasManualBlockers" type="warning" :show-icon="false" class="mt-3">
|
||||
当前有
|
||||
{{ plan.manualBlocked }}
|
||||
|
||||
@@ -54,10 +54,10 @@ function exportReceipt() {
|
||||
:show-icon="false"
|
||||
class="mt-3"
|
||||
>
|
||||
严格质量候选已经创建,但尚未代表成片完成。后台会继续查询视频模型、执行视觉校验,并在失败时有限修复;只有校验通过的候选才会晋升主视频。
|
||||
视频候选已创建。系统会继续检查并按需修复,通过后设为主视频。
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="receipt.result.failed" role="alert" type="error" :show-icon="false" class="mt-3">
|
||||
本次存在部分失败,成功提交或生成的结果不会回滚。请查看逐镜错误后再重试。
|
||||
部分失败。成功结果已保留,请先查看失败原因。
|
||||
</ContextNotice>
|
||||
<ul v-if="receipt.result.failures.length" class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="failure in receipt.result.failures" :key="failure.shotId">
|
||||
|
||||
@@ -285,12 +285,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
|
||||
<template>
|
||||
<!-- 以下是质量操作与显式费用确认模块 -->
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
:title="`质量检查 · ${target?.title ?? ''}`"
|
||||
description="查看质量结果,或按需发起新的视觉检查。"
|
||||
wide
|
||||
>
|
||||
<AppDialog v-model:open="open" :title="`质量检查 · ${target?.title ?? ''}`" wide>
|
||||
<ContextNotice
|
||||
v-if="target?.kind === 'video' && (videoQuery.error.value || videoQuery.data.value?.staleReason)"
|
||||
type="warning"
|
||||
@@ -322,7 +317,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
}}</NRadioButton>
|
||||
</NRadioGroup>
|
||||
<ContextNotice v-if="target?.kind === 'video'" type="info" :show-icon="false" class="mt-4"
|
||||
>视频校验会按镜头启用抽样帧、运动及道具专项检查,不含音频和口型。普通候选只校验;修复候选复检通过后会自动设为主视频。</ContextNotice
|
||||
>仅检查画面、动作和道具。修复候选复检通过后自动设为主视频。</ContextNotice
|
||||
>
|
||||
<div v-if="generating" class="quality-fields mt-4">
|
||||
<NFormItem path="attempts" :label="videoRepair ? '修复链次数上限' : '每镜最多修复'"
|
||||
@@ -349,9 +344,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
仅第 {{ target.episodeNo }} 集{{ singleShot ? `,指定镜头 ${target.shotId}` : '' }},最多
|
||||
{{ singleShot ? 1 : (limit ?? '—') }} 镜;非重做模式处理符合条件的过期和缺失首帧。
|
||||
</p>
|
||||
<p v-if="videoRepair" class="mt-3 text-xs text-muted">
|
||||
本次仅创建一个修复视频,不自动等待或复检。完成后请打开新候选的质量检查;修复约束沿用上次失败校验,不使用额外参数。
|
||||
</p>
|
||||
<p v-if="videoRepair" class="mt-3 text-xs text-muted">按上次检查的问题修复一个视频。生成后请手动复检。</p>
|
||||
<ContextNotice v-if="!repairAvailable" type="warning" :show-icon="false" class="mt-3"
|
||||
>当前候选暂时不能执行这项检查,请查看原因或刷新任务状态。</ContextNotice
|
||||
>
|
||||
@@ -426,10 +419,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
<ContextNotice type="warning" :show-icon="false" class="mt-4">
|
||||
<template v-if="videoRepair"
|
||||
>本次最多提交 1
|
||||
个视频生成任务,可能产生费用;生成完成不会切换主视频,需再次付费复检通过后才会晋升。</template
|
||||
>
|
||||
<template v-if="videoRepair">最多生成 1 个候选,可能收费。付费复检通过后才会设为主视频。</template>
|
||||
<template v-else-if="target?.kind === 'video'"
|
||||
>本次会检查视频画面,可能使用多个识图模型并产生费用。</template
|
||||
>
|
||||
@@ -482,9 +472,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
<p class="mt-3 text-xs text-muted">此为历史抽样结论,不保证当前上游素材仍然一致。</p></NCollapseItem
|
||||
></NCollapse
|
||||
>
|
||||
<p v-if="target?.kind !== 'batch'" class="mt-3 text-xs text-muted">
|
||||
本会话回执可导出;首帧已有校验可在历史中只读查看,后台质量任务刷新后继续恢复。
|
||||
</p>
|
||||
<p v-if="target?.kind !== 'batch'" class="mt-3 text-xs text-muted">可导出结果或查看首帧检查历史。</p>
|
||||
<!-- 以下是底栏左侧费用确认与右侧操作按钮模块 -->
|
||||
<template #footer>
|
||||
<div class="quality-dialog-footer">
|
||||
|
||||
@@ -772,7 +772,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:show-icon="false"
|
||||
class="mt-3 text-xs"
|
||||
>
|
||||
当前主首帧在本次质量检查中未通过,已阻止继续生成视频。请从候选中选择质量通过的图片。
|
||||
主首帧未通过检查,请更换合格候选后生成视频。
|
||||
</ContextNotice>
|
||||
<ContextNotice
|
||||
v-if="query.data.value?.qualityStatusError"
|
||||
@@ -780,7 +780,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:show-icon="false"
|
||||
class="mt-3 text-xs"
|
||||
>
|
||||
视频质量链状态暂时无法读取;视频资产仍可查看。请稍后刷新。
|
||||
暂时无法读取检查结果,请刷新。
|
||||
</ContextNotice>
|
||||
<div class="production-stage-actions">
|
||||
<NButton
|
||||
@@ -967,9 +967,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
]"
|
||||
@update:value="videoInputModeOverride = $event"
|
||||
/>
|
||||
<p class="mt-1.5 text-[11px] leading-5 text-muted">
|
||||
自动选择合适的生成方式;手动选择只影响本次生成。
|
||||
</p>
|
||||
<p class="mt-1.5 text-[11px] leading-5 text-muted">可手动调整本次生成方式。</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1073,7 +1071,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
<AppDialog
|
||||
v-model:open="candidatesOpen"
|
||||
title="首帧候选管理"
|
||||
description="读取已保存质量结论;通过质量检查或完成有效人工复核的候选可以设为主首帧。"
|
||||
description="通过检查或人工复核后可设为主首帧。"
|
||||
:width="keyframeCandidatesWidth"
|
||||
>
|
||||
<!-- 候选图片和对应的人工复核入口按相同候选 ID 分组。 -->
|
||||
@@ -1137,12 +1135,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
<p v-else class="text-xs text-muted">暂无其它视频候选。</p>
|
||||
</AppDialog>
|
||||
<!-- 以下是指定视频质量记录弹窗模块,打开后直接展示结果与修改建议 -->
|
||||
<AppDialog
|
||||
v-model:open="videoHistoryOpen"
|
||||
title="视频质量记录"
|
||||
description="查看此视频已有的画面检查结果与本镜头的相关记录,不收费。"
|
||||
wide
|
||||
>
|
||||
<AppDialog v-model:open="videoHistoryOpen" title="视频质量记录" description="免费查看视频检查记录。" wide>
|
||||
<VideoQualityDiagnostics
|
||||
v-if="videoHistoryOpen && videoHistoryId"
|
||||
:key="`${shot.shotId}:${videoHistoryId}`"
|
||||
@@ -1152,30 +1145,19 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:stale-reason="videoHistoryId === currentVideo?.id ? videoStaleReason : videoHistoryAsset?.staleReason"
|
||||
/>
|
||||
</AppDialog>
|
||||
<AppDialog
|
||||
v-model:open="historyOpen"
|
||||
title="首帧记录"
|
||||
description="核对当前候选的生成输入、视觉审核与人工复核。"
|
||||
wide
|
||||
>
|
||||
<!-- 以下是按需读取的候选生成证据 -->
|
||||
<KeyframeInputDetails
|
||||
v-if="historyOpen && historyKeyframeId"
|
||||
:key="historyKeyframeId"
|
||||
:project-id="projectId"
|
||||
:shot-id="shot.shotId"
|
||||
:keyframe-id="historyKeyframeId"
|
||||
/>
|
||||
<KeyframeValidationHistory
|
||||
v-if="historyOpen && historyKeyframeId"
|
||||
:key="historyKeyframeId"
|
||||
:project-id="projectId"
|
||||
:shot-id="shot.shotId"
|
||||
:keyframe-id="historyKeyframeId"
|
||||
:disabled="historyBlocked"
|
||||
initial-open
|
||||
@reviewed="refreshAfterReview"
|
||||
/>
|
||||
<AppDialog v-model:open="historyOpen" title="首帧记录" wide>
|
||||
<div v-if="historyOpen && historyKeyframeId" :key="historyKeyframeId" class="workspace-section-stack">
|
||||
<!-- 以下是按需读取的候选生成证据 -->
|
||||
<KeyframeInputDetails :project-id="projectId" :shot-id="shot.shotId" :keyframe-id="historyKeyframeId" />
|
||||
<KeyframeValidationHistory
|
||||
:project-id="projectId"
|
||||
:shot-id="shot.shotId"
|
||||
:keyframe-id="historyKeyframeId"
|
||||
:disabled="historyBlocked"
|
||||
initial-open
|
||||
@reviewed="refreshAfterReview"
|
||||
/>
|
||||
</div>
|
||||
</AppDialog>
|
||||
<KeyframeDialog
|
||||
v-model:open="keyframeOpen"
|
||||
|
||||
@@ -62,7 +62,7 @@ const orderedChain = computed(() => {
|
||||
const analysis = computed(() => query.data.value?.analysis)
|
||||
|
||||
/**
|
||||
* 将后端回退层级转成业务标签,未知值保持原文。
|
||||
* 将建议检查的范围转成中文标签。
|
||||
* @param target 后端建议回退层级
|
||||
* @returns 中文标签
|
||||
*/
|
||||
@@ -75,7 +75,30 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
|
||||
video_prompt: '视频提示词',
|
||||
provider: '视频模型'
|
||||
}
|
||||
return labels[target] ?? target
|
||||
return labels[target] ?? '待核对环节'
|
||||
}
|
||||
/** 视频画面与运动检查的问题类别。 */
|
||||
const issueTypeLabels: Record<string, string> = {
|
||||
identity_drift: '主体外观变化',
|
||||
identity_mismatch: '主体外观不符',
|
||||
form_drift: '形态变化',
|
||||
form_mismatch: '形态不符',
|
||||
subject_count_mismatch: '主体数量不符',
|
||||
scene_drift: '场景变化',
|
||||
visual_artifact: '画面瑕疵',
|
||||
unauthorized_text: '出现未指定文字',
|
||||
unnatural_start_stop: '动作起停不自然',
|
||||
motion_discontinuity: '动作衔接不连贯',
|
||||
weight_inertia_mismatch: '重量或惯性不符',
|
||||
contact_inconsistency: '接触不自然',
|
||||
subject_motion_integrity: '主体动作异常',
|
||||
camera_motion_discontinuity: '镜头移动不连贯',
|
||||
motion_plan_mismatch: '动作与设计不符',
|
||||
spatial_interaction_mismatch: '空间互动不符',
|
||||
physical_structure_mismatch: '结构不符',
|
||||
physical_joint_mismatch: '连接关系不符',
|
||||
state_mismatch: '画面状态不符',
|
||||
temporal_inconsistency: '前后画面不一致'
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -157,16 +180,22 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
|
||||
:show-icon="false"
|
||||
>
|
||||
<p class="font-semibold">镜头最近一次质量流程的修改建议</p>
|
||||
{{ analysis.summary }}
|
||||
{{
|
||||
analysis.persistentIssues?.length
|
||||
? `有 ${analysis.persistentIssues.length} 类问题反复出现。`
|
||||
: '暂无重复问题。'
|
||||
}}
|
||||
<p v-if="analysis.recommendedRollback.length" class="mt-1">
|
||||
建议检查:{{ analysis.recommendedRollback.map(rollbackLabel).join('、') }}
|
||||
</p>
|
||||
</ContextNotice>
|
||||
<article v-for="issue in analysis?.persistentIssues ?? []" :key="issue.type" class="mt-3">
|
||||
<strong>{{ issue.type }} · 出现 {{ issue.occurrences }} 次</strong>
|
||||
<p>{{ issue.suspectedCause }}</p>
|
||||
<strong>{{ issueTypeLabels[issue.type] ?? '其他画面问题' }} · 出现 {{ issue.occurrences }} 次</strong>
|
||||
<p>{{ userFacingText(issue.suspectedCause) }}</p>
|
||||
<ul class="text-muted">
|
||||
<li v-for="description in issue.descriptions" :key="description">{{ description }}</li>
|
||||
<li v-for="description in issue.descriptions" :key="description">
|
||||
{{ userFacingText(description) }}
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
@@ -84,7 +84,7 @@ export function issueLabel(code: ProductionIssueCode): string {
|
||||
/**
|
||||
* 将生产任务状态转换为中文标签,包含首帧与视频的生成中状态。
|
||||
* @param status 后端返回的生产任务状态
|
||||
* @returns 状态对应的中文名称,未知状态保留原值
|
||||
* @returns 状态对应的中文名称,未知状态显示待确认
|
||||
*/
|
||||
export function productionStatusLabel(status: string): string {
|
||||
const labels: Record<string, string> = {
|
||||
@@ -99,9 +99,11 @@ export function productionStatusLabel(status: string): string {
|
||||
completed: '已完成',
|
||||
failed: '失败',
|
||||
cancelled: '已取消',
|
||||
submitted: '已提交',
|
||||
processing: '处理中',
|
||||
not_started: '未开始'
|
||||
}
|
||||
return labels[status] ?? status
|
||||
return labels[status] ?? '待确认'
|
||||
}
|
||||
|
||||
/** 视频质量链状态标签与后端状态机保持一致。 */
|
||||
@@ -115,5 +117,5 @@ export function videoQualityStatusLabel(status: string): string {
|
||||
exhausted: '自动修复次数已用完',
|
||||
stale_motion_plan: '动作版本过期,质量流程已停止'
|
||||
}
|
||||
return labels[status] ?? status
|
||||
return labels[status] ?? '待确认'
|
||||
}
|
||||
@@ -76,8 +76,8 @@ export async function checkPipeline(projectId: string, scope: ProductionStartInp
|
||||
imageGenerationOptions: { ...profile.imageOptions },
|
||||
videoGenerationOptions: { ...profile.videoOptions }
|
||||
}
|
||||
const [checkpoints, forms, plan, status] = await Promise.all([
|
||||
projectsApi.checkpoints(projectId),
|
||||
const [summaries, forms, plan, status] = await Promise.all([
|
||||
projectsApi.checkpointSummaries(projectId),
|
||||
subjectImagesApi.listForms(projectId),
|
||||
productionApi.plan(projectId, undefined, providers),
|
||||
productionApi.status(projectId)
|
||||
@@ -111,7 +111,7 @@ export async function checkPipeline(projectId: string, scope: ProductionStartInp
|
||||
)
|
||||
issues.push('各阶段资产列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
if (project.status !== 'completed') issues.push('剧本尚未完成,请先完成剧本创作。')
|
||||
if (hasRunningWorkflow(checkpoints)) issues.push('项目仍有后台任务或工作流进行中。')
|
||||
if (hasRunningWorkflow(summaries)) issues.push('项目仍有后台任务或工作流进行中。')
|
||||
if (!forms.length || !plan.keyframes.total) issues.push('尚无正式形态或镜头,请先完成拆解和分镜。')
|
||||
if (forms.some(form => hasRunningImages(form.images))) issues.push('形态图片仍在生成中。')
|
||||
if (
|
||||
@@ -191,6 +191,7 @@ export function useAdvancedProduction() {
|
||||
operation.value.pending ||
|
||||
execution.active.value ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
context.project.value?.status !== 'completed'
|
||||
)
|
||||
let version = 0
|
||||
@@ -275,7 +276,8 @@ export function useAdvancedProduction() {
|
||||
disposed ||
|
||||
id.value !== projectId ||
|
||||
context.project.value?.status !== 'completed' ||
|
||||
context.error.value
|
||||
context.error.value ||
|
||||
context.summaryBlocked.value
|
||||
)
|
||||
return
|
||||
if (JSON.stringify(result.input) !== confirmedInput) {
|
||||
|
||||
@@ -20,6 +20,8 @@ export type ProductionCommand = 'prompts' | 'keyframes' | 'videos' | 'retry-vide
|
||||
/** 镜头生产页的查询、筛选、就绪状态与批量操作。 */
|
||||
export function useProduction() {
|
||||
const context = useProjectContext()
|
||||
/** 制作正文只使用正式采用的拆解记录。 */
|
||||
const breakdownRecords = context.useWorkflowCheckpoints('breakdown')
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const id = computed(() => context.project.value?.id ?? '')
|
||||
/** 两个镜头工作区共用地址选择,刷新恢复同一正式镜头。 */
|
||||
@@ -43,7 +45,7 @@ export function useProduction() {
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const videoInputMode = ref<VideoInputMode | 'all'>('all')
|
||||
/** 生产页只关联正式镜头和正式正文,未提交候选不能补入当前资产。 */
|
||||
const snapshot = computed(() => formalBreakdownSnapshot(context.checkpoints.value))
|
||||
const snapshot = computed(() => formalBreakdownSnapshot(breakdownRecords.data.value ?? []))
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const sourceEpisodes = computed(
|
||||
() => snapshot.value?.storyboardEpisodeShots ?? snapshot.value?.breakdownResult?.storyboardEpisodeShots ?? []
|
||||
@@ -168,6 +170,10 @@ export function useProduction() {
|
||||
promptExecution.active.value ||
|
||||
videoExecution.active.value ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
breakdownRecords.loading.value ||
|
||||
!!breakdownRecords.error.value ||
|
||||
breakdownRecords.data.value === null ||
|
||||
!!query.error.value ||
|
||||
!query.data.value ||
|
||||
context.project.value?.status !== 'completed'
|
||||
@@ -296,6 +302,7 @@ export function useProduction() {
|
||||
videoStatusItem,
|
||||
query,
|
||||
episodeSourceUnavailable,
|
||||
breakdownRecords,
|
||||
operation,
|
||||
session,
|
||||
concurrency,
|
||||
|
||||
@@ -155,14 +155,14 @@ export function useQuality(
|
||||
: '首帧自动修复'
|
||||
: '视觉质量校验',
|
||||
async () => {
|
||||
const [project, readiness, checkpoints] = await Promise.all([
|
||||
const [project, readiness, summaries] = await Promise.all([
|
||||
projectsApi.detail(projectId),
|
||||
productionApi.keyframeReadiness(projectId, target.kind === 'batch' ? input.force : true),
|
||||
projectsApi.checkpoints(projectId)
|
||||
projectsApi.checkpointSummaries(projectId)
|
||||
])
|
||||
if (project.id !== projectId || project.status !== 'completed')
|
||||
throw new Error('剧本未完成或项目已变化,未提交质量任务。')
|
||||
if (hasRunningWorkflow(checkpoints)) throw new Error('项目还有后台任务,请结束后再执行质量检查。')
|
||||
if (hasRunningWorkflow(summaries)) throw new Error('项目还有后台任务,请结束后再执行质量检查。')
|
||||
if (
|
||||
!Array.isArray(readiness.items) ||
|
||||
readiness.items.length !== readiness.total ||
|
||||
|
||||
@@ -394,12 +394,7 @@ async function refreshLibrary() {
|
||||
</p>
|
||||
|
||||
<!-- 以下是上传资料确认模块 -->
|
||||
<AppDialog
|
||||
v-model:open="uploadOpen"
|
||||
title="上传资产图片"
|
||||
description="选择所属剧本并确认名称和分类,提交后仍停留在当前资产库。"
|
||||
:busy="busy"
|
||||
>
|
||||
<AppDialog v-model:open="uploadOpen" title="上传资产图片" :busy="busy">
|
||||
<FeedbackMessage v-if="actionError" :message="actionError" />
|
||||
<AppForm
|
||||
id="library-upload-form"
|
||||
@@ -436,13 +431,7 @@ async function refreshLibrary() {
|
||||
</AppDialog>
|
||||
|
||||
<!-- 以下是素材详情与管理模块 -->
|
||||
<AppDialog
|
||||
v-model:open="editOpen"
|
||||
title="素材详情与管理"
|
||||
description="查看文件详情,也可在当前页面修改名称和分类或删除素材。"
|
||||
:busy="busy"
|
||||
wide
|
||||
>
|
||||
<AppDialog v-model:open="editOpen" title="素材详情与管理" :busy="busy" wide>
|
||||
<FeedbackMessage v-if="actionError" :message="actionError" />
|
||||
<AppForm
|
||||
id="library-edit-form"
|
||||
@@ -503,7 +492,7 @@ async function refreshLibrary() {
|
||||
<template #icon><Trash2 :size="14" /></template>删除素材
|
||||
</NButton>
|
||||
</template>
|
||||
删除后图片文件也会移除。正在用于视觉风格的素材需要先取消引用,才能删除。
|
||||
删除会移除图片文件。风格参考图需先取消引用。
|
||||
</NPopconfirm>
|
||||
<div class="ml-auto flex gap-2">
|
||||
<NButton :disabled="busy" @click="editOpen = false">取消</NButton>
|
||||
|
||||
@@ -291,7 +291,7 @@ watch(projectId, () => {
|
||||
<template #icon><Trash2 :size="14" /></template>删除
|
||||
</NButton>
|
||||
</template>
|
||||
删除后图片文件也会移除。正在用于视觉风格的素材需要先取消引用,才能删除。
|
||||
删除会移除图片文件。风格参考图需先取消引用。
|
||||
</NPopconfirm>
|
||||
</div>
|
||||
</div>
|
||||
@@ -310,12 +310,7 @@ watch(projectId, () => {
|
||||
</p>
|
||||
|
||||
<!-- 以下是单文件上传确认模块 -->
|
||||
<AppDialog
|
||||
v-model:open="uploadOpen"
|
||||
title="上传项目素材"
|
||||
description="填写名称并选择分类,方便之后查找和使用这张图片。"
|
||||
:busy="mutationPending"
|
||||
>
|
||||
<AppDialog v-model:open="uploadOpen" title="上传项目素材" :busy="mutationPending">
|
||||
<AppForm
|
||||
id="project-upload-form"
|
||||
:model="uploadForm"
|
||||
@@ -348,12 +343,7 @@ watch(projectId, () => {
|
||||
</AppDialog>
|
||||
|
||||
<!-- 以下是当前素材编辑模块 -->
|
||||
<AppDialog
|
||||
v-model:open="editOpen"
|
||||
title="编辑素材信息"
|
||||
description="只修改名称和分类,不会替换图片文件或修改已保存的引用地址。"
|
||||
:busy="mutationPending"
|
||||
>
|
||||
<AppDialog v-model:open="editOpen" title="编辑素材信息" :busy="mutationPending">
|
||||
<AppForm
|
||||
id="project-edit-form"
|
||||
:model="editForm"
|
||||
|
||||
@@ -3,6 +3,7 @@ const labels: Record<string, string> = {
|
||||
overall: '综合',
|
||||
character: '人物',
|
||||
scene: '场景',
|
||||
'scene-layout': '场景布局',
|
||||
prop: '道具',
|
||||
reference: '参考素材',
|
||||
'visual-style': '视觉风格',
|
||||
@@ -17,7 +18,7 @@ const labels: Record<string, string> = {
|
||||
* @returns 分类展示名称
|
||||
*/
|
||||
export function assetCategoryLabel(value: string): string {
|
||||
return labels[value] ?? value
|
||||
return Object.hasOwn(labels, value) ? labels[value]! : value
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { Settings2 } from '@lucide/vue'
|
||||
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis, NSkeleton } from 'naive-ui'
|
||||
import { EmptyState, WorkspaceRefreshButton } from '../../components/ui'
|
||||
import { projectContextKey, useProjectData } from './context'
|
||||
import { projectContextKey, useProjectData, type CheckpointWorkflow } from './context'
|
||||
import { getOperation, operationErrorText } from '../workflows/operations'
|
||||
import { projectAccessKey, projectSectionFromPath, type ProjectAccess, type ProjectSectionAccess } from './access'
|
||||
import { useProjectStageAccess } from './useProjectStageAccess'
|
||||
@@ -22,12 +22,13 @@ import type { ProjectSettingsTab } from '../generation-config/context'
|
||||
import CreateDramaSkeleton from '../create-drama/CreateDramaSkeleton.vue'
|
||||
import BreakdownSkeleton from '../breakdown/BreakdownSkeleton.vue'
|
||||
import VisualStyleSkeleton from '../visual-style/VisualStyleSkeleton.vue'
|
||||
import ProjectWorkspaceSkeleton from './components/ProjectWorkspaceSkeleton.vue'
|
||||
import SubjectIdentitySkeleton from '../subject-identity/SubjectIdentitySkeleton.vue'
|
||||
|
||||
/** 项目标题只保留名称;下游工作区在剧本完成前不挂载,直接链接也无法越过限制。 */
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const id = computed(() => String(route.params.projectId))
|
||||
const id = computed(() => String(route.params.projectId ?? ''))
|
||||
const context = useProjectData(id)
|
||||
provide(projectContextKey, context)
|
||||
/** 项目全局配置保存后更新已挂载生成表单。 */
|
||||
@@ -68,10 +69,43 @@ watch(id, () => {
|
||||
generationRevision.value = 0
|
||||
})
|
||||
const operation = computed(() => getOperation(id.value))
|
||||
/**
|
||||
* 跨页面观察真实终态并刷新对应数据,不因读取历史终态重复刷新。
|
||||
* @param observer 已挂载的后台观察器
|
||||
* @param workflow 需要刷新的正文所属工作流
|
||||
*/
|
||||
function refreshOnTerminal(observer: ReturnType<typeof useWorkflowExecution>, workflow: CheckpointWorkflow | null) {
|
||||
watch(
|
||||
() => observer.query.data.value,
|
||||
(record, previous) => {
|
||||
if (
|
||||
!record ||
|
||||
record.projectId !== id.value ||
|
||||
previous?.id !== record.id ||
|
||||
!['pending', 'running'].includes(previous.status) ||
|
||||
!['completed', 'failed'].includes(record.status)
|
||||
)
|
||||
return
|
||||
void context.refreshWorkflow(workflow, record.projectId, record.id + ':' + record.status)
|
||||
if (workflow === 'create-drama' && currentSection.value !== 'create-drama') {
|
||||
void context.refreshProject()
|
||||
void context.refreshStageReadiness()
|
||||
} else if (
|
||||
workflow === 'breakdown' &&
|
||||
currentSection.value !== 'breakdown' &&
|
||||
currentSection.value !== 'storyboard'
|
||||
) {
|
||||
void context.refreshStageReadiness()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/** 从服务端发现创作任务,刷新或换浏览器后也能继续观察故事规划等节点。 */
|
||||
const createDramaExecution = useWorkflowExecution(id, 'create-drama', { discover: true })
|
||||
refreshOnTerminal(createDramaExecution, 'create-drama')
|
||||
/** 项目内跨页面继续观察首帧后台任务,维持活动锁并在真实终态后释放。 */
|
||||
useWorkflowExecution(id, 'keyframe-quality')
|
||||
refreshOnTerminal(useWorkflowExecution(id, 'keyframe-quality'), null)
|
||||
/** 派生设计从服务端发现新任务;其它既有入口继续观察已知任务,保持项目活动锁。 */
|
||||
for (const workflowName of [
|
||||
'storyboard-direction',
|
||||
@@ -80,12 +114,16 @@ for (const workflowName of [
|
||||
'keyframe-generation',
|
||||
'video-quality'
|
||||
]) {
|
||||
useWorkflowExecution(id, workflowName, {
|
||||
discover: ['storyboard-direction', 'storyboard-visual-state'].includes(workflowName)
|
||||
})
|
||||
refreshOnTerminal(
|
||||
useWorkflowExecution(id, workflowName, {
|
||||
discover: ['storyboard-direction', 'storyboard-visual-state'].includes(workflowName)
|
||||
}),
|
||||
null
|
||||
)
|
||||
}
|
||||
/** 即使直接刷新到生产页,也按真实重生成任务恢复旧剧情快照的失效标记。 */
|
||||
const breakdownExecution = useWorkflowExecution(id, 'breakdown', { discover: true })
|
||||
refreshOnTerminal(breakdownExecution, 'breakdown')
|
||||
/** 只有后端确认有效的新分镜才废弃旧正文,不推测未完成或失败任务。 */
|
||||
watchEffect(() => {
|
||||
const record = breakdownExecution.query.data.value
|
||||
@@ -105,12 +143,6 @@ watchEffect(() => {
|
||||
)
|
||||
invalidateEpisodeSource(record.projectId, number)
|
||||
})
|
||||
watchEffect(() => {
|
||||
const status = createDramaExecution.query.data.value?.status
|
||||
if ((status === 'completed' || status === 'failed') && context.project.value?.status === 'generating') {
|
||||
void context.refresh()
|
||||
}
|
||||
})
|
||||
const stageAccess = useProjectStageAccess(id, context.stageReadiness)
|
||||
const complete = stageAccess.scriptReady
|
||||
/** 当前路由所属的制作步骤;项目素材不是制作步骤。 */
|
||||
@@ -127,7 +159,14 @@ const currentAccess = computed<ProjectSectionAccess | null>(() => {
|
||||
})
|
||||
const isCreation = computed(() => currentSection.value === 'create-drama')
|
||||
/** 各工作区共用首次读取判定;切换项目显示占位,刷新已有项目保留内容。 */
|
||||
const isProjectInitialLoading = computed(() => context.loading.value && context.project.value?.id !== id.value)
|
||||
const isProjectInitialLoading = computed(
|
||||
() =>
|
||||
(context.projectQuery.loading.value && !context.project.value) ||
|
||||
(!isCreation.value &&
|
||||
!isProjectAssets.value &&
|
||||
context.readinessQuery.loading.value &&
|
||||
!context.stageReadiness.value)
|
||||
)
|
||||
type OperationGuide = {
|
||||
title: string
|
||||
description: string
|
||||
@@ -295,7 +334,9 @@ onScopeDispose(() => {
|
||||
:key="id"
|
||||
:project-id="id"
|
||||
:disabled="!!context.error.value"
|
||||
:can-open-storyboard="stageAccess.sections.value.storyboard.enabled"
|
||||
@changed="context.refresh()"
|
||||
@open-storyboard="router.push(`/projects/${id}/storyboard`)"
|
||||
/>
|
||||
<WorkspaceActionTooltip label="项目配置" mobile-only>
|
||||
<NButton
|
||||
@@ -335,10 +376,9 @@ onScopeDispose(() => {
|
||||
<div class="project-view">
|
||||
<RouterView v-if="context.project.value?.id === id && currentAccess?.enabled" :key="id" />
|
||||
<EmptyState
|
||||
v-else-if="context.project.value?.id === id"
|
||||
v-else-if="context.project.value?.id === id && !isProjectInitialLoading"
|
||||
class="project-access-gate"
|
||||
:title="currentAccess?.reason || '当前步骤还不能开始'"
|
||||
description="如刚完成前置步骤,请刷新项目状态。正式分镜的复检详情可在「制作前检查」查看。"
|
||||
>
|
||||
<NButton
|
||||
v-if="currentAccess?.nextPath"
|
||||
@@ -362,6 +402,13 @@ onScopeDispose(() => {
|
||||
<VisualStyleSkeleton v-else-if="isProjectInitialLoading && currentSection === 'visual-style'" />
|
||||
<!-- 以下是主体身份项目首次读取的骨架屏模块 -->
|
||||
<SubjectIdentitySkeleton v-else-if="isProjectInitialLoading && currentSection === 'subject-identity'" />
|
||||
<!-- 以下是项目首次进入图库和分镜时的骨架,项目门禁返回后再显示正文 -->
|
||||
<ProjectWorkspaceSkeleton
|
||||
v-else-if="
|
||||
isProjectInitialLoading && (currentSection === 'subject-images' || currentSection === 'storyboard')
|
||||
"
|
||||
:variant="currentSection"
|
||||
/>
|
||||
<NSpin v-else-if="context.loading.value" class="workspace-loading" description="正在读取项目内容…" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { request, optionalResource } from '../../lib/http'
|
||||
import type { Checkpoint } from '../workflows/types'
|
||||
import type { Checkpoint, CheckpointSummary } from '../workflows/types'
|
||||
import type { WorkflowExecutionStart } from '../workflows/execution.types'
|
||||
import type {
|
||||
CreateProjectInput,
|
||||
@@ -71,8 +71,57 @@ export const projectsApi = {
|
||||
request<{ id: string; deleted: boolean }>(`/projects/${encodeURIComponent(id)}`, { method: 'DELETE' }),
|
||||
state: (id: string, signal?: AbortSignal) =>
|
||||
optionalResource(request<DramaState>(`/projects/${encodeURIComponent(id)}/state`, { signal })),
|
||||
checkpoints: (id: string, signal?: AbortSignal) =>
|
||||
request<Checkpoint[]>(`/projects/${encodeURIComponent(id)}/checkpoints`, { signal }),
|
||||
/**
|
||||
* 读取每个工作流最新的执行状态,供导航与操作门禁使用。
|
||||
* @param id 当前项目
|
||||
* @param signal 请求取消信号
|
||||
* @returns 最新保存记录摘要
|
||||
*/
|
||||
async checkpointSummaries(id: string, signal?: AbortSignal) {
|
||||
const rows = await request<CheckpointSummary[]>(
|
||||
`/projects/${encodeURIComponent(id)}/checkpoints?view=summary`,
|
||||
{ signal }
|
||||
)
|
||||
if (
|
||||
!Array.isArray(rows) ||
|
||||
rows.some(
|
||||
row =>
|
||||
!row?.workflowName ||
|
||||
!row.checkpointId ||
|
||||
!row.createdAt ||
|
||||
!row.updatedAt ||
|
||||
!row.state ||
|
||||
typeof row.state !== 'object' ||
|
||||
Array.isArray(row.state) ||
|
||||
Object.keys(row.state).some(key => key !== 'workflowExecution') ||
|
||||
(row.state.workflowExecution !== undefined &&
|
||||
typeof row.state.workflowExecution?.status !== 'string')
|
||||
) ||
|
||||
new Set(rows.map(row => row.workflowName)).size !== rows.length
|
||||
)
|
||||
throw new Error('任务摘要无法核对,请刷新后再试。')
|
||||
return rows
|
||||
},
|
||||
/**
|
||||
* 读取完整记录,页面按实际需要指定工作流。
|
||||
* @param id 当前项目
|
||||
* @param signal 请求取消信号
|
||||
* @param workflowName 完整记录所属的工作流
|
||||
* @returns 保留历史顺序及来源信息的完整记录
|
||||
*/
|
||||
async checkpoints(id: string, signal?: AbortSignal, workflowName?: string) {
|
||||
const rows = await request<Checkpoint[]>(
|
||||
`/projects/${encodeURIComponent(id)}/checkpoints` +
|
||||
(workflowName === undefined ? '' : `?${new URLSearchParams({ workflowName })}`),
|
||||
{ signal }
|
||||
)
|
||||
if (
|
||||
!Array.isArray(rows) ||
|
||||
(workflowName !== undefined && rows.some(row => row?.workflowName !== workflowName))
|
||||
)
|
||||
throw new Error('工作流记录无法核对,请刷新后再试。')
|
||||
return rows
|
||||
},
|
||||
/**
|
||||
* 用户确认后恢复创作;改写明确携带服务端要求的确认标记。
|
||||
* @param id 当前项目编号
|
||||
|
||||
@@ -134,13 +134,7 @@ const rules = computed(() => ({
|
||||
<template>
|
||||
<!-- 以下是新建剧本入口与从右侧展开的全屏抽屉模块 -->
|
||||
<NButton @click="open = true" type="primary"><Plus :size="16" />新建剧本</NButton>
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="新建剧本"
|
||||
description="从一个故事想法开始。提交后,先规划全剧故事,再编写分集剧本、生成角色设定与世界观,最后审核。"
|
||||
:busy="busy"
|
||||
class="create-project-drawer"
|
||||
>
|
||||
<AppDrawer v-model:open="open" title="新建剧本" :busy="busy" class="create-project-drawer">
|
||||
<AppForm
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
|
||||
@@ -64,7 +64,7 @@ async function remove() {
|
||||
<!-- 删除范围与后台任务状态属于同组,保持 8px 间距 -->
|
||||
<div class="space-y-2">
|
||||
<ContextNotice type="error" :show-icon="false">
|
||||
会永久删除这个项目的剧本、人物、场景、道具、形态、分镜、首帧、视频和制作记录,以及上传或生成的素材文件。
|
||||
永久删除项目及其剧本、分镜、素材、视频和任务记录。
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="readinessPending" type="info" :show-icon="false"
|
||||
>正在检查项目后台任务…</ContextNotice
|
||||
|
||||
@@ -73,7 +73,6 @@ async function save() {
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
:title="`编辑项目 · ${project?.title || project?.topic || ''}`"
|
||||
description="仅更新项目基础信息,不自动重生成剧本或制作资产。"
|
||||
:busy="state.pending"
|
||||
>
|
||||
<!-- 以下是保存失败提示模块 -->
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
<script setup lang="ts">
|
||||
import { NSkeleton } from 'naive-ui'
|
||||
import WorkspacePage from '../../../components/ui/WorkspacePage.vue'
|
||||
|
||||
/** 骨架与页面共用图库列宽和分镜分栏,可独立用于正文加载。 */
|
||||
defineProps<{
|
||||
/** 对应侧栏的当前工作区。 */
|
||||
variant: 'subject-images' | 'storyboard'
|
||||
/** 切换剧集时保留已有工具栏,只占满正文。 */
|
||||
bodyOnly?: boolean
|
||||
}>()
|
||||
|
||||
/** 用四条等高线表示卡片文字和操作。 */
|
||||
const galleryCaptionWidths = ['38%', '64%', '80%', '48%'] as const
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是工具栏和正文的加载占位 -->
|
||||
<component
|
||||
:is="bodyOnly ? 'div' : WorkspacePage"
|
||||
v-bind="bodyOnly ? {} : { split: true, compact: true }"
|
||||
class="project-workspace-skeleton"
|
||||
:class="{ 'compact-shot-workspace': variant === 'storyboard' }"
|
||||
role="status"
|
||||
aria-busy="true"
|
||||
:aria-label="variant === 'subject-images' ? '正在读取形态图片' : '正在读取分镜设计'"
|
||||
>
|
||||
<template v-if="!bodyOnly" #header>
|
||||
<!-- 以下是与真实图库共用筛选栏布局的占位 -->
|
||||
<div v-if="variant === 'subject-images'" class="form-image-filter-region" aria-hidden="true">
|
||||
<div class="form-image-filters">
|
||||
<NSkeleton class="search-filter" :height="34" />
|
||||
<NSkeleton class="module-filter" :height="34" />
|
||||
<NSkeleton class="status-filter" :height="34" />
|
||||
<div class="form-image-display-controls">
|
||||
<NSkeleton v-for="index in 4" :key="index" :width="34" :height="34" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 以下是分镜剧集、统计和操作区占位 -->
|
||||
<div v-else class="workspace-toolbar" aria-hidden="true">
|
||||
<div class="toolbar-episode"><NSkeleton :height="34" /></div>
|
||||
<div class="toolbar-metrics">
|
||||
<NSkeleton :width="90" :height="14" />
|
||||
<NSkeleton :width="90" :height="14" />
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<NSkeleton :width="34" :height="34" />
|
||||
<NSkeleton :width="96" :height="34" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 以下是形态图库卡片骨架 -->
|
||||
<div v-if="variant === 'subject-images'" aria-hidden="true" class="form-image-grid gallery-loading-grid">
|
||||
<article v-for="index in 24" :key="index" class="panel form-image-card overflow-hidden">
|
||||
<!-- 以下是图库方形图片区占位 -->
|
||||
<div class="relative aspect-square">
|
||||
<NSkeleton class="absolute inset-0" width="100%" height="100%" />
|
||||
</div>
|
||||
<!-- 以下是等高、等间距的文字骨架 -->
|
||||
<div class="gallery-loading-caption grid gap-3 p-4">
|
||||
<NSkeleton v-for="width in galleryCaptionWidths" :key="width" :width="width" :height="12" />
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<!-- 以下是分镜目录、镜头摘要和标签骨架 -->
|
||||
<div v-else aria-hidden="true" class="storyboard-loading-grid">
|
||||
<div class="panel directory-panel storyboard-loading-directory">
|
||||
<div class="directory-heading">
|
||||
<NSkeleton :width="90" :height="16" />
|
||||
<NSkeleton :width="52" :height="12" />
|
||||
</div>
|
||||
<div v-for="index in 6" :key="index" class="storyboard-loading-beat grid gap-2 px-3.5 py-3">
|
||||
<NSkeleton :width="66" :height="12" />
|
||||
<NSkeleton :height="46" />
|
||||
<NSkeleton :height="46" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel grid min-w-0 content-start gap-5 p-5 lg:p-7">
|
||||
<NSkeleton :width="100" :height="12" />
|
||||
<NSkeleton :width="'min(100%, 210px)'" :height="22" />
|
||||
<NSkeleton :width="'90%'" :height="16" />
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<NSkeleton v-for="index in 4" :key="index" :width="64" :height="24" />
|
||||
</div>
|
||||
<NSkeleton :width="'min(100%, 150px)'" :height="16" />
|
||||
<NSkeleton :width="'76%'" :height="16" />
|
||||
<div v-for="index in 5" :key="index" class="grid gap-3">
|
||||
<NSkeleton :width="84" :height="14" />
|
||||
<NSkeleton :width="'min(100%, 520px)'" :height="48" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@reference "../../../styles/styles.css";
|
||||
/* 图库骨架和真实卡片使用同一响应式列宽。 */
|
||||
.form-image-grid {
|
||||
display: grid;
|
||||
--gallery-card-min-width: 260px;
|
||||
--gallery-gap: 12px;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(var(--gallery-card-min-width), 100%), 1fr));
|
||||
gap: var(--gallery-gap);
|
||||
}
|
||||
/* 图库筛选布局与加载占位共用宽度和断点。 */
|
||||
.gallery-sticky-controls > .form-image-filter-region {
|
||||
@apply my-0;
|
||||
}
|
||||
.form-image-filter-region {
|
||||
@apply my-3 p-3;
|
||||
/* 外层使用浅灰分组,输入与下拉恢复为表面色,避免同色后失去控件边界。 */
|
||||
--app-field: var(--app-surface);
|
||||
--app-field-hover: var(--app-surface);
|
||||
background: var(--app-subtle);
|
||||
container-type: inline-size;
|
||||
}
|
||||
.form-image-toolbar {
|
||||
@apply grid grid-cols-[minmax(0,_1fr)] items-center gap-y-3 gap-x-4;
|
||||
}
|
||||
.form-image-toolbar.has-impact-picker {
|
||||
@apply grid-cols-[auto_minmax(0,_1fr)];
|
||||
}
|
||||
.asset-impact-picker {
|
||||
@apply flex items-center gap-2 min-w-0;
|
||||
}
|
||||
.form-image-toolbar > * {
|
||||
@apply min-w-0;
|
||||
}
|
||||
.form-image-filters {
|
||||
@apply grid grid-cols-[minmax(200px,_360px)_152px_160px_auto] items-center gap-y-3 gap-x-4;
|
||||
}
|
||||
.form-image-filters > * {
|
||||
@apply min-w-0;
|
||||
}
|
||||
.filter-result-count {
|
||||
@apply justify-self-end text-muted text-xs whitespace-nowrap;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
@apply flex items-center justify-self-end gap-4;
|
||||
}
|
||||
.gallery-layout-switch {
|
||||
@apply flex items-center gap-2;
|
||||
}
|
||||
/* 未选中的排版按钮与图库操作按钮共用浅灰底,同时不覆盖选中布局的绿色状态。 */
|
||||
.gallery-layout-switch .layout-option-button:not(.layout-option-active),
|
||||
.gallery-layout-switch .gallery-action-button {
|
||||
background: var(--app-control-hover);
|
||||
}
|
||||
@container (max-width: 1200px) {
|
||||
.form-image-toolbar.has-impact-picker {
|
||||
@apply grid-cols-[minmax(0,_1fr)];
|
||||
}
|
||||
}
|
||||
@container (max-width: 900px) {
|
||||
.form-image-filters {
|
||||
@apply grid-cols-[minmax(0,_1fr)_152px];
|
||||
}
|
||||
.status-filter {
|
||||
@apply col-start-1 row-start-2;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
@apply col-start-2 row-start-2;
|
||||
}
|
||||
}
|
||||
@container (max-width: 460px) {
|
||||
.form-image-filters {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
/* 移动端固定为两行:搜索给类型选择让位,状态可收缩以优先保留四个完整操作按钮。 */
|
||||
.search-filter {
|
||||
flex: 1 1 calc(100% - 130px);
|
||||
min-width: 0;
|
||||
}
|
||||
.module-filter {
|
||||
flex: 0 0 120px;
|
||||
}
|
||||
.status-filter {
|
||||
flex: 0 1 110px;
|
||||
min-width: 90px;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
flex: 1 0 152px;
|
||||
width: auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.filter-result-count {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
.project-workspace-skeleton .form-image-filter-region {
|
||||
margin: 0;
|
||||
}
|
||||
.project-workspace-skeleton {
|
||||
container-type: inline-size;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.gallery-loading-grid,
|
||||
.storyboard-loading-grid {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.gallery-loading-grid {
|
||||
align-content: start;
|
||||
grid-auto-rows: max-content;
|
||||
}
|
||||
.storyboard-loading-grid > .panel {
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.project-workspace-skeleton .n-skeleton {
|
||||
--n-color-start: var(--app-border) !important;
|
||||
}
|
||||
.storyboard-loading-grid {
|
||||
display: grid;
|
||||
grid-template-columns: clamp(240px, 22%, 280px) minmax(0, 1fr);
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.storyboard-loading-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
}
|
||||
.project-workspace-skeleton .toolbar-episode > .n-skeleton,
|
||||
.project-workspace-skeleton .toolbar-actions > .n-skeleton {
|
||||
height: 44px !important;
|
||||
}
|
||||
.project-workspace-skeleton .toolbar-actions > .n-skeleton {
|
||||
width: 44px !important;
|
||||
}
|
||||
.storyboard-loading-beat:nth-child(n + 3) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,45 +1,120 @@
|
||||
import { computed, inject, type InjectionKey } from 'vue'
|
||||
import { computed, inject, ref, watch, type InjectionKey, type Ref } from 'vue'
|
||||
import { useQuery } from '../../composables/useQuery'
|
||||
import { projectsApi } from './api'
|
||||
import type { ProjectDetail } from './types'
|
||||
import type { Checkpoint } from '../workflows/types'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
/** 同一项目的各个 graph 共用一份查询,避免每个面板重复请求。 */
|
||||
/** 页面需要回读完整记录的工作流。 */
|
||||
export type CheckpointWorkflow = 'create-drama' | 'breakdown'
|
||||
|
||||
/** 项目布局共享轻量读取,完整记录只有消费者进入时才加载。 */
|
||||
export function useProjectData(id: Ref<string>) {
|
||||
const query = useQuery(id, async (projectId, signal) => {
|
||||
const [project, checkpoints, stageReadiness] = await Promise.all([
|
||||
projectsApi.detail(projectId, signal),
|
||||
projectsApi.checkpoints(projectId, signal),
|
||||
projectsApi.stageReadiness(projectId, signal)
|
||||
])
|
||||
return { project, checkpoints, stageReadiness }
|
||||
})
|
||||
const project = computed<ProjectDetail | null>(() => query.data.value?.project ?? null)
|
||||
const checkpoints = computed<Checkpoint[]>(() => query.data.value?.checkpoints ?? [])
|
||||
/** 导航只消费当前项目的准入响应。 */
|
||||
const stageReadiness = computed(() => {
|
||||
const readiness = query.data.value?.stageReadiness
|
||||
return readiness?.projectId === id.value ? readiness : null
|
||||
})
|
||||
/** 同项目并发轻量刷新只采用最后一次请求。 */
|
||||
let readinessRefresh = 0
|
||||
/** 子页面完成当前步骤后调用,只刷新轻量项目状态与导航门禁。 */
|
||||
async function refreshStageReadiness() {
|
||||
const projectId = id.value
|
||||
const snapshot = query.data.value
|
||||
if (!projectId || snapshot?.project.id !== projectId) return
|
||||
const request = ++readinessRefresh
|
||||
const nextReadiness = await projectsApi.stageReadiness(projectId)
|
||||
if (
|
||||
request === readinessRefresh &&
|
||||
id.value === projectId &&
|
||||
query.data.value === snapshot &&
|
||||
nextReadiness.projectId === projectId
|
||||
/** 正式项目正文与导航条件分别读取。 */
|
||||
const projectQuery = useQuery(id, (projectId, signal) =>
|
||||
projectId ? projectsApi.detail(projectId, signal) : Promise.resolve(null)
|
||||
)
|
||||
const readinessQuery = useQuery(id, (projectId, signal) =>
|
||||
projectId ? projectsApi.stageReadiness(projectId, signal) : Promise.resolve(null)
|
||||
)
|
||||
/** 摘要失败会阻断写操作,但不阻塞工作区浏览。 */
|
||||
const summaryQuery = useQuery(id, (projectId, signal) =>
|
||||
projectId ? projectsApi.checkpointSummaries(projectId, signal) : Promise.resolve(null)
|
||||
)
|
||||
/** 当前项目已请求过的工作流,页面卸载时保留。 */
|
||||
const requested = ref<Partial<Record<CheckpointWorkflow, string>>>({})
|
||||
/** 页面与布局可能同时观察到同一个终态,只处理一次。 */
|
||||
const handledExecutions = new Map<string, Promise<void>>()
|
||||
watch(
|
||||
id,
|
||||
() => {
|
||||
requested.value = {}
|
||||
handledExecutions.clear()
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
|
||||
/**
|
||||
* 用项目编号作为查询键;离开项目会取消旧请求并清除旧结果。
|
||||
* @param workflow 当前工作流
|
||||
* @returns 完整记录及其独立查询状态
|
||||
*/
|
||||
function createCheckpointQuery(workflow: CheckpointWorkflow) {
|
||||
const key = computed(() => (requested.value[workflow] === id.value ? id.value : ''))
|
||||
return useQuery(key, (projectId, signal) =>
|
||||
projectId ? projectsApi.checkpoints(projectId, signal, workflow) : Promise.resolve(null)
|
||||
)
|
||||
query.data.value = { ...snapshot, stageReadiness: nextReadiness }
|
||||
}
|
||||
return { ...query, project, checkpoints, stageReadiness, refreshStageReadiness }
|
||||
/** 两个查询在布局生命周期内存活,同项目切页直接复用。 */
|
||||
const checkpointQueries = {
|
||||
'create-drama': createCheckpointQuery('create-drama'),
|
||||
breakdown: createCheckpointQuery('breakdown')
|
||||
}
|
||||
/** 只发布当前项目的正式数据。 */
|
||||
const project = computed(() => (projectQuery.data.value?.id === id.value ? projectQuery.data.value : null))
|
||||
const stageReadiness = computed(() =>
|
||||
project.value && readinessQuery.data.value?.projectId === id.value ? readinessQuery.data.value : null
|
||||
)
|
||||
/** 摘要未取得或刷新失败时禁止依赖其作出写入判断。 */
|
||||
const summaryBlocked = computed(
|
||||
() =>
|
||||
!project.value ||
|
||||
summaryQuery.data.value === null ||
|
||||
summaryQuery.loading.value ||
|
||||
!!summaryQuery.error.value
|
||||
)
|
||||
/** 页面外壳加载与错误不包含按需正文。 */
|
||||
const loading = computed(() => projectQuery.loading.value || readinessQuery.loading.value)
|
||||
const error = computed(() => projectQuery.error.value || readinessQuery.error.value || summaryQuery.error.value)
|
||||
|
||||
/**
|
||||
* 声明页面需要某个工作流的正文;重复声明不会发出新请求。
|
||||
* @param workflow 当前工作流
|
||||
* @returns 完整记录查询
|
||||
*/
|
||||
function useWorkflowCheckpoints(workflow: CheckpointWorkflow) {
|
||||
if (requested.value[workflow] !== id.value) requested.value[workflow] = id.value
|
||||
return checkpointQueries[workflow]
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入或任务终态后只刷新摘要和受影响的已加载正文。
|
||||
* @param workflow 受影响的工作流,没有对应正文时仅刷新摘要
|
||||
* @param projectId 操作开始时绑定的项目
|
||||
* @param executionKey 共享观察器使用的终态标识
|
||||
* @returns 本次刷新结束
|
||||
*/
|
||||
async function refreshWorkflow(workflow: CheckpointWorkflow | null, projectId = id.value, executionKey?: string) {
|
||||
if (!projectId || id.value !== projectId) return
|
||||
const existing = executionKey ? handledExecutions.get(executionKey) : undefined
|
||||
if (existing) return existing
|
||||
const update = Promise.all([
|
||||
summaryQuery.refresh(),
|
||||
workflow && requested.value[workflow] === projectId
|
||||
? checkpointQueries[workflow].refresh()
|
||||
: Promise.resolve()
|
||||
]).then(() => {})
|
||||
if (executionKey) handledExecutions.set(executionKey, update)
|
||||
await update
|
||||
}
|
||||
|
||||
/** 刷新工作区入口数据,不读取完整工作流历史。 */
|
||||
async function refresh() {
|
||||
await Promise.all([projectQuery.refresh(), readinessQuery.refresh(), summaryQuery.refresh()])
|
||||
}
|
||||
|
||||
return {
|
||||
project,
|
||||
projectQuery,
|
||||
stageReadiness,
|
||||
readinessQuery,
|
||||
summaryQuery,
|
||||
summaryBlocked,
|
||||
loading,
|
||||
error,
|
||||
refresh,
|
||||
refreshProject: projectQuery.refresh,
|
||||
refreshStageReadiness: readinessQuery.refresh,
|
||||
useWorkflowCheckpoints,
|
||||
refreshWorkflow
|
||||
}
|
||||
}
|
||||
|
||||
/** 项目布局向子页面提供的类型安全上下文。 */
|
||||
|
||||
@@ -32,12 +32,7 @@ function saved() {
|
||||
|
||||
<template>
|
||||
<!-- 以下是独立正式修订抽屉,正文与底栏同步铺满视口 -->
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="修订当前正式镜头"
|
||||
:busy="busy"
|
||||
description="读取当前正式动作,保存前会再次核对版本、任务和已有素材。修订后仍需重新检查。"
|
||||
>
|
||||
<AppDrawer v-model:open="open" title="修订当前正式镜头" :busy="busy" description="修订动作后,请重新检查镜头。">
|
||||
<FormalRepairEditor
|
||||
v-if="open && issue"
|
||||
ref="editor"
|
||||
|
||||
@@ -402,7 +402,7 @@ defineExpose({ save, canSave })
|
||||
<section v-if="beat" class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
:title="`补齐主体:${beat.subjectName}`"
|
||||
description="先核对剧情段落是否包含这个主体,再核对镜头引用。每次只保存当前明确的修订,不改写原始剧本。"
|
||||
description="对照剧情核对主体,再修订镜头关联。原剧本保留。"
|
||||
/>
|
||||
<p class="text-sm leading-6">剧情段落:{{ beat.beat.description }}</p>
|
||||
<p class="text-sm leading-6">当前镜头:{{ beat.shot.description }}</p>
|
||||
@@ -427,7 +427,7 @@ defineExpose({ save, canSave })
|
||||
<ConfirmAction
|
||||
v-if="preview.classification.status === 'needs_semantic_repair'"
|
||||
label="生成动作修复建议"
|
||||
description="会调用文字模型并产生费用,只生成当前镜头的修复建议,不保存镜头、不生成图片或视频。建议仍需人工核对。"
|
||||
description="付费生成本镜修订建议,核对后再保存。"
|
||||
:disabled="disabled || writing || loading"
|
||||
:loading="writing"
|
||||
@confirm="generateCandidate"
|
||||
@@ -437,7 +437,7 @@ defineExpose({ save, canSave })
|
||||
建议说明:{{ userFacingText(candidateReason) }}
|
||||
</p>
|
||||
<p v-if="preview.classification.status === 'unchanged'" class="text-sm text-muted">
|
||||
当前动作规划没有可直接修订的确定性问题,暂不开放保存。可返回诊断列表复查当前镜头。
|
||||
暂无可直接修订的动作问题,可返回复查。
|
||||
</p>
|
||||
<ShotActionEditor
|
||||
v-model="draft"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, inject, ref, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NFormItem, NInput, NTag } from 'naive-ui'
|
||||
import { ArrowLeft, CheckCheck, RefreshCw, Save, ShieldCheck, Wrench } from '@lucide/vue'
|
||||
import { ArrowLeft, ArrowRight, CheckCheck, RefreshCw, Save, ShieldCheck, Wrench } from '@lucide/vue'
|
||||
import AppDrawer from '../../components/ui/AppDrawer.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
import WorkspaceSectionHeading from '../../components/ui/WorkspaceSectionHeading.vue'
|
||||
@@ -16,7 +16,7 @@ import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { storyboardApi } from '../storyboard/api'
|
||||
import { projectsApi } from '../projects/api'
|
||||
import { useStoryboardPreparation } from './useStoryboardPreparation'
|
||||
import { currentStoryboardApproval } from './model'
|
||||
import { currentStoryboardApproval, storyboardDesignGap } from './model'
|
||||
import { preparationApi } from './api'
|
||||
import type { PreparationIssue } from './types'
|
||||
import {
|
||||
@@ -31,17 +31,20 @@ const props = withDefaults(
|
||||
defineProps<{
|
||||
/** 当前正式项目。 */ projectId: string
|
||||
/** 外部项目读取失败或主任务锁。 */ disabled?: boolean
|
||||
/** 分镜设计页当前是否可进入。 */ canOpenStoryboard?: boolean
|
||||
}>(),
|
||||
{ disabled: false }
|
||||
{ disabled: false, canOpenStoryboard: false }
|
||||
)
|
||||
/** 所有写入或后台终态后让调用方刷新实际导航状态。 */
|
||||
const emit = defineEmits<{ changed: [] }>()
|
||||
const emit = defineEmits<{ changed: []; openStoryboard: [] }>()
|
||||
/** 全屏入口,未打开不读取完整复检。 */
|
||||
const open = ref(false)
|
||||
/** 复用标题栏的唯一配置入口,跳转时指定质量规则分类。 */
|
||||
const openProjectSettings = inject(projectSettingsOpenKey, undefined)
|
||||
/** 只记录用户主动的抽屉交接,等待当前抽屉离场后再打开配置。 */
|
||||
const queuedSettingsProject = ref('')
|
||||
/** 等抽屉关闭后再切换到本项目的分镜设计。 */
|
||||
const queuedStoryboardProject = ref('')
|
||||
/** 当前项目任务观察与表单共同绑定项目。 */
|
||||
const id = computed(() => props.projectId)
|
||||
/** 首次打开后才观察派生任务,关闭不丢失正在运行的任务。 */
|
||||
@@ -63,6 +66,8 @@ const locked = computed(
|
||||
)
|
||||
/** 复检与独立人工确认流程。 */
|
||||
const flow = useStoryboardPreparation(id, locked)
|
||||
/** 分镜设计可打开时,详细覆盖状态由分镜页展示。 */
|
||||
const showStoryboardLink = computed(() => props.canOpenStoryboard && !!storyboardDesignGap(flow.data.value?.entry))
|
||||
/** 当前查看的正式修订目标,在同一抽屉中切换正文。 */
|
||||
const repairIssue = ref<PreparationIssue | null>(null)
|
||||
/** 正式修订编辑器,底栏调用统一保存。 */
|
||||
@@ -112,6 +117,7 @@ watch(flow.sourceKey, () => {
|
||||
/** 切项目后撤销旧项目尚未完成的配置交接。 */
|
||||
watch(id, () => {
|
||||
queuedSettingsProject.value = ''
|
||||
queuedStoryboardProject.value = ''
|
||||
})
|
||||
/** 打开时读取;关闭立即废弃旧结果及未完成只读请求。 */
|
||||
watch(
|
||||
@@ -144,11 +150,20 @@ function requestQualitySettings() {
|
||||
queuedSettingsProject.value = id.value
|
||||
open.value = false
|
||||
}
|
||||
/** 离场与焦点约束释放后,打开同项目的质量规则编辑入口。 */
|
||||
/** 从检查抽屉转到负责处理镜头设计的页面。 */
|
||||
function requestStoryboard() {
|
||||
if (busy.value || !showStoryboardLink.value) return
|
||||
queuedStoryboardProject.value = id.value
|
||||
open.value = false
|
||||
}
|
||||
/** 离场与焦点约束释放后,打开同项目的目标页面。 */
|
||||
function preparationClosed() {
|
||||
const projectId = queuedSettingsProject.value
|
||||
const storyboardProjectId = queuedStoryboardProject.value
|
||||
queuedSettingsProject.value = ''
|
||||
queuedStoryboardProject.value = ''
|
||||
if (projectId && projectId === id.value) openProjectSettings?.('quality')
|
||||
if (storyboardProjectId && storyboardProjectId === id.value && props.canOpenStoryboard) emit('openStoryboard')
|
||||
}
|
||||
/** 明确确认当前已保存规则,只核对版本,不在检查入口保存另一份草稿。 */
|
||||
async function confirmPolicy() {
|
||||
@@ -268,7 +283,7 @@ async function repaired() {
|
||||
v-model:open="open"
|
||||
:title="repairIssue ? '修订正式分镜问题' : '制作前检查'"
|
||||
:busy="busy"
|
||||
description="用于拆解后的正式分镜审核与制作检查;首次拆解无需先完成这里的分镜检查。"
|
||||
description="拆解完成后,可审核分镜并检查制作条件。"
|
||||
@closed="preparationClosed"
|
||||
>
|
||||
<!-- 以下是在同一抽屉内查看当前正式镜头的修订模块 -->
|
||||
@@ -317,10 +332,7 @@ async function repaired() {
|
||||
</section>
|
||||
<!-- 以下是同一份项目规则的只读核对,编辑统一交接到项目配置 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="项目质量规则"
|
||||
description="规则统一在项目配置中编辑。首次拆解会引导确认,也可在此提前核对当前版本。"
|
||||
>
|
||||
<WorkspaceSectionHeading title="项目质量规则" description="在项目配置中编辑规则,首次拆解时确认。">
|
||||
<template #actions
|
||||
><NButton
|
||||
class="workspace-action-button"
|
||||
@@ -340,7 +352,7 @@ async function repaired() {
|
||||
<section v-if="!flow.data.value.quality.provenance.qualityPolicyConsistent" class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="核对旧分镜采用的规则"
|
||||
description="旧分镜没有完整规则记录时,由复核人明确采用当前已确认规则重新检查。不会重写历史记录,也不会重新拆解。"
|
||||
description="旧分镜缺少规则记录时,可用当前规则重新检查。原分镜和历史会保留。"
|
||||
/>
|
||||
<p v-for="reason in flow.data.value.baseline.reasons" :key="reason" class="text-sm text-muted">
|
||||
{{ userFacingText(reason) }}
|
||||
@@ -369,12 +381,9 @@ async function repaired() {
|
||||
</section>
|
||||
<!-- 以下是正式主体、动作及来源问题,局部修订独立确认 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="处理正式分镜问题"
|
||||
description="只修订明确的问题镜头。涉及规则来源或现有素材保护时,先处理对应限制。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="处理正式分镜问题" description="仅修订有明确问题的镜头。" />
|
||||
<p v-if="!flow.issues.value.length" class="text-sm text-muted">
|
||||
当前未返回具体镜头问题,请继续核对上面的来源条件和人工审核。
|
||||
暂无具体镜头问题,请核对来源与审核状态。
|
||||
</p>
|
||||
<article
|
||||
v-for="(item, index) in flow.issues.value"
|
||||
@@ -399,12 +408,10 @@ async function repaired() {
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="人工确认整体分镜"
|
||||
description="检查通过后,由复核人核对动作、主体及镜头衔接。规则或镜头变化后原审核会失效。"
|
||||
description="请核对动作、主体和镜头衔接。规则或镜头修改后需重新审核。"
|
||||
/>
|
||||
<p v-if="flow.approved.value" class="text-sm text-muted">当前正式分镜已有有效审核记录。</p>
|
||||
<p v-else-if="!flow.reviewable.value" class="text-sm text-muted">
|
||||
请先处理规则来源、动作与主体问题,再进行整体审核。
|
||||
</p>
|
||||
<p v-else-if="!flow.reviewable.value" class="text-sm text-muted">先修订问题,再审核分镜。</p>
|
||||
<template v-else
|
||||
><NFormItem label="审核人"
|
||||
><NInput
|
||||
@@ -431,7 +438,7 @@ async function repaired() {
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="补齐镜头设计与画面状态"
|
||||
description="先更新镜头设计,再更新画面状态。只补齐缺失或过期结果,生成可能产生模型费用。"
|
||||
description="依次补齐缺失或过期的镜头设计和画面状态,可能收费。"
|
||||
/>
|
||||
<p
|
||||
class="text-sm"
|
||||
@@ -445,8 +452,8 @@ async function repaired() {
|
||||
: '待确认'
|
||||
}}。镜头设计和画面状态覆盖单独检查,入口就绪不代表图片质量已通过。
|
||||
</p>
|
||||
<p class="text-sm text-muted">
|
||||
已保存镜头设计 {{ flow.data.value.entry.derivedAssets.directionCount }} /
|
||||
<p v-if="!showStoryboardLink" class="text-sm text-muted">
|
||||
有效镜头设计 {{ flow.data.value.entry.derivedAssets.directionCount }} /
|
||||
{{ flow.data.value.entry.derivedAssets.shotCount }} · 画面状态
|
||||
{{ flow.data.value.entry.derivedAssets.visualStateCount }} /
|
||||
{{ flow.data.value.entry.derivedAssets.shotCount }}
|
||||
@@ -454,7 +461,7 @@ async function repaired() {
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<ConfirmAction
|
||||
label="补齐或更新镜头设计"
|
||||
description="处理整个项目中缺失或过期的镜头设计,已有当前有效结果会跳过。会调用文字模型并产生费用,不生成图片或视频。"
|
||||
description="付费补齐全项目缺失或过期的镜头设计。"
|
||||
:disabled="
|
||||
!flow.approved.value ||
|
||||
flow.data.value.entry.ready ||
|
||||
@@ -465,7 +472,7 @@ async function repaired() {
|
||||
@confirm="generate('direction')"
|
||||
/><ConfirmAction
|
||||
label="补齐或更新画面状态"
|
||||
description="根据正式镜头和最新镜头设计处理整个项目的画面状态,已有当前有效结果会跳过。会调用文字模型并可能进行最多两次修复,可能产生费用。"
|
||||
description="补齐全项目缺失或过期的画面状态。最多修复两次,可能收费。"
|
||||
:disabled="
|
||||
!flow.approved.value ||
|
||||
flow.data.value.entry.ready ||
|
||||
@@ -477,8 +484,19 @@ async function repaired() {
|
||||
"
|
||||
@confirm="generate('visual')"
|
||||
/>
|
||||
<!-- 以下是与补齐操作并排的分镜设计入口。 -->
|
||||
<NButton
|
||||
v-if="showStoryboardLink"
|
||||
class="workspace-action-button"
|
||||
icon-placement="right"
|
||||
:disabled="busy"
|
||||
@click="requestStoryboard"
|
||||
>
|
||||
<template #icon><ArrowRight :size="15" aria-hidden="true" /></template>
|
||||
前往分镜设计
|
||||
</NButton>
|
||||
</div>
|
||||
<p class="text-sm" :class="flow.data.value.entry.ready ? 'text-muted' : 'text-danger'">
|
||||
<p v-if="!showStoryboardLink" class="text-sm text-muted">
|
||||
{{
|
||||
flow.data.value.entry.ready
|
||||
? '正式分镜已满足制作入口条件。制作计划还会继续检查主体素材和镜头资产。'
|
||||
@@ -487,11 +505,7 @@ async function repaired() {
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
<EmptyState
|
||||
v-else
|
||||
title="尚无正式分镜"
|
||||
description="请先在剧本拆解中生成并提交分镜,再回来检查问题和整体审核;这些检查不作为首次拆解的前置条件。"
|
||||
/>
|
||||
<EmptyState v-else title="尚无正式分镜" description="请先在剧本拆解中生成并提交分镜。" />
|
||||
</template>
|
||||
<!-- 以下是服务持久化的派生任务,关闭抽屉后仍可观察 -->
|
||||
<WorkflowExecutionPanel
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
import type { StoryboardApprovalState } from './types'
|
||||
import type { ProductionEntryReadiness, StoryboardApprovalState } from './types'
|
||||
|
||||
/**
|
||||
* 只识别制作入口明确返回的设计覆盖不足,保留审核等其他阻断的原展示位置。
|
||||
* @param entry 制作入口检查结果
|
||||
* @returns 待补齐的全项目设计进度,其他原因返回空
|
||||
*/
|
||||
export function storyboardDesignGap(entry: ProductionEntryReadiness | null | undefined) {
|
||||
if (!entry || entry.ready || !/^Storyboard (Direction|VisualState) 尚未完整或已过期[::]/.test(entry.reason ?? ''))
|
||||
return null
|
||||
return entry.derivedAssets
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前有效审核必须同时绑定项目、规则、保存记录及正式镜头内容,不能只看 valid 或旧记录存在。
|
||||
|
||||
@@ -114,13 +114,15 @@ export interface ProductionEntryReadiness {
|
||||
/** 存在拆解结构检查。 */ hasStoryboardValidation: boolean
|
||||
/** 明确结构结论。 */ storyboardValid: boolean | null
|
||||
/** 当前阻断原因。 */ reason: string | null
|
||||
/** 已保存的派生设计数量,不能代替新旧版本检查。 */
|
||||
/** 当前有效的派生设计数量及已过期数量。 */
|
||||
derivedAssets: {
|
||||
/** 正式镜头数。 */ shotCount: number
|
||||
/** 镜头设计数。 */ directionCount: number
|
||||
/** 镜头设计覆盖。 */ directionCoverage: number
|
||||
/** 画面状态数。 */ visualStateCount: number
|
||||
/** 画面状态覆盖。 */ visualStateCoverage: number
|
||||
/** 已过期镜头设计数。 */ staleDirectionCount?: number
|
||||
/** 已过期画面状态数。 */ staleVisualStateCount?: number
|
||||
}
|
||||
}
|
||||
/** 通过真实坐标查询得到的正式镜头身份。 */
|
||||
|
||||
@@ -19,6 +19,7 @@ import GenerationReceipt from './components/GenerationReceipt.vue'
|
||||
import { useQuery } from '../../composables/useQuery'
|
||||
import { productionApi } from '../production/api'
|
||||
import ShotProductionAssets from '../production/components/ShotProductionAssets.vue'
|
||||
import ProjectWorkspaceSkeleton from '../projects/components/ProjectWorkspaceSkeleton.vue'
|
||||
import ShotDerivedReview from './components/ShotDerivedReview.vue'
|
||||
import ShotDesign from './components/ShotDesign.vue'
|
||||
import MotionPlanPanel from './components/MotionPlanPanel.vue'
|
||||
@@ -68,6 +69,7 @@ const {
|
||||
data,
|
||||
episodeSourceUnavailable,
|
||||
prerequisites,
|
||||
breakdownRecords,
|
||||
projectAssetsReady,
|
||||
session,
|
||||
operation,
|
||||
@@ -79,6 +81,7 @@ const {
|
||||
directionComplete,
|
||||
approval,
|
||||
approved,
|
||||
projectDesignGap,
|
||||
visualStateComplete,
|
||||
hasCurrentEpisodeShots,
|
||||
executions,
|
||||
@@ -96,7 +99,15 @@ const shotReadiness = computed(() =>
|
||||
)
|
||||
/** 切换详情标签后仍观察起点视觉任务,重新进入项目时恢复真实终态。 */
|
||||
useWorkflowExecution(id, 'motion-plan-start-state-validation')
|
||||
const productionReady = computed(() => directionComplete.value && visualStateComplete.value)
|
||||
/** 无全项目覆盖结果时,使用本集设计接口显示本集缺口。 */
|
||||
const episodeDesignGap = computed(
|
||||
() =>
|
||||
!projectDesignGap.value &&
|
||||
!query.loading.value &&
|
||||
!query.error.value &&
|
||||
!!data.value?.directions.shotCount &&
|
||||
(!directionComplete.value || !visualStateComplete.value)
|
||||
)
|
||||
/** 分镜时长审计为只读预警,接口失败不能影响分镜设计。 */
|
||||
const durationAudit = ref<StoryboardDurationAudit | null>(null)
|
||||
/** 项目预算汇总为只读数据,失败不影响现有分镜操作。 */
|
||||
@@ -239,8 +250,17 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage split compact mobile-scroll class="storyboard-workspace-page compact-shot-workspace">
|
||||
<template #notice>
|
||||
<WorkspacePage
|
||||
split
|
||||
compact
|
||||
:mobile-scroll="Boolean(data) || !query.loading.value"
|
||||
class="storyboard-workspace-page compact-shot-workspace"
|
||||
>
|
||||
<template v-if="data || !query.loading.value || breakdownRecords.error.value" #notice>
|
||||
<ContextNotice v-if="breakdownRecords.error.value" type="error" role="alert">
|
||||
{{ breakdownRecords.error.value }}
|
||||
<NButton text size="small" @click="breakdownRecords.refresh">重试读取</NButton>
|
||||
</ContextNotice>
|
||||
<!-- 以下是正式分镜审核先于派生生成的明确提示,查看已有设计仍可继续 -->
|
||||
<ContextNotice v-if="!approved" type="info" :show-icon="false"
|
||||
><p>
|
||||
@@ -257,7 +277,22 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
></ContextNotice
|
||||
>
|
||||
<ContextNotice v-if="episodeSourceUnavailable" type="info" :show-icon="false">
|
||||
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
|
||||
本集镜头已更新。标题和剧情详情待补齐。
|
||||
</ContextNotice>
|
||||
<!-- 以下是镜头生产所需的全项目设计进度,生成操作仍需单独确认。 -->
|
||||
<ContextNotice v-if="projectDesignGap" type="info">
|
||||
<div class="flex flex-wrap items-center gap-x-3">
|
||||
<span>
|
||||
全项目有效进度:镜头设计 {{ projectDesignGap.directionCount }}/{{
|
||||
projectDesignGap.shotCount
|
||||
}}, 画面状态 {{ projectDesignGap.visualStateCount }}/{{ projectDesignGap.shotCount }}。
|
||||
<template v-if="projectDesignGap.staleDirectionCount || projectDesignGap.staleVisualStateCount">
|
||||
需更新:镜头设计 {{ projectDesignGap.staleDirectionCount ?? 0 }} 个、画面状态
|
||||
{{ projectDesignGap.staleVisualStateCount ?? 0 }} 个。
|
||||
</template>
|
||||
</span>
|
||||
<NButton text size="small" @click="toolsOpen = true">查看生成选项</NButton>
|
||||
</div>
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="currentEpisodeDurationIssues.length" type="warning" :show-icon="false">
|
||||
<div class="text-sm font-medium">
|
||||
@@ -339,6 +374,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 以下是全屏分镜生成配置与回执,标题与关闭栏固定。 -->
|
||||
<WorkspaceTools
|
||||
:pending="operation.pending"
|
||||
:pending-label="operation.label"
|
||||
@@ -346,6 +382,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
title="分镜生成配置与回执"
|
||||
label="生成与恢复"
|
||||
:has-receipt="!!session.receipt"
|
||||
fullscreen
|
||||
>
|
||||
<div class="flex flex-wrap items-end justify-between gap-4">
|
||||
<div>
|
||||
@@ -391,8 +428,12 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</div>
|
||||
</AppForm>
|
||||
</section>
|
||||
<div class="storyboard-coverage grid grid-cols-2 gap-3">
|
||||
<div v-for="item in coverage" :key="item.title" class="panel px-3 py-2">
|
||||
<!-- 以下是共用中性底色的本集设计进度模块。 -->
|
||||
<section
|
||||
class="storyboard-coverage workspace-panel grid grid-cols-1 gap-4 sm:grid-cols-2"
|
||||
aria-label="本集设计进度"
|
||||
>
|
||||
<div v-for="item in coverage" :key="item.title" class="min-w-0">
|
||||
<div class="mb-3 flex items-center justify-between text-xs">
|
||||
<span>{{ item.title }}</span
|
||||
><span class="font-mono text-muted">{{ item.count }} / {{ item.total }} 镜头</span>
|
||||
@@ -408,10 +449,9 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
Math.max(0, (item.count / Math.max(1, Math.max(item.total, 1))) * 100)
|
||||
)
|
||||
"
|
||||
class=""
|
||||
></NProgress>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="workspace-overview-panel">
|
||||
<div class="overview-content workspace-section-stack">
|
||||
<!-- 以下是零费用主体引用覆盖检查模块 -->
|
||||
@@ -443,7 +483,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
:label="`重生成第 ${episodeNo} 集镜头`"
|
||||
:disabled="!allowed['shots-current']"
|
||||
acknowledgement
|
||||
:description="`将删除并重建第 ${episodeNo} 集的正式镜头。该集已有导演设计、即时状态、首帧、提示词和视频结果会随旧镜头一并失效,且无法撤销;其他剧集保持不变。`"
|
||||
:description="`重建第 ${episodeNo} 集会清除本集旧镜头、设计、首帧、提示词和视频。无法撤销。`"
|
||||
@confirm="run('shots-current')"
|
||||
/>
|
||||
</div>
|
||||
@@ -457,7 +497,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
<span class="mr-2 font-mono text-xs text-muted">01</span>导演摄影设计
|
||||
</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
景别、机位、运镜与构图。正式项目生成默认跳过已完整剧集,覆盖模式会重新生成全部剧集。
|
||||
设置景别、机位、运镜和构图。覆盖模式会重做全部剧集。
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@@ -472,7 +512,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
:description="
|
||||
force
|
||||
? '重新生成项目全部剧集的导演设计,覆盖已有结果。'
|
||||
: '对整个项目生成导演设计,跳过已完整保存的剧集,可用于重试失败或未完成的剧集。'
|
||||
: '补齐全项目导演设计,跳过已完成的剧集。'
|
||||
"
|
||||
@confirm="run('direction-all')"
|
||||
/>
|
||||
@@ -484,7 +524,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
<span class="mr-2 font-mono text-xs text-muted">02</span>即时视觉状态
|
||||
</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
表情、姿态、位置、环境与连续性。每集需要完整导演设计;批量中缺少前置设计的剧集会单独报错。
|
||||
先补齐导演设计,再生成表情、姿态和环境等画面状态。
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@@ -506,14 +546,12 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-4 text-[11px] leading-6 text-muted">
|
||||
修改或覆盖前面的设计后,已有状态和视频提示词不会自动更新;请按顺序重新生成后续内容。自动修复次数仅用于
|
||||
画面即时状态。
|
||||
设计更新后,请依次更新画面状态和视频提示词。自动修复次数只用于画面状态。
|
||||
</p>
|
||||
<section>
|
||||
<h3 class="text-sm font-semibold">视频提示词批量操作</h3>
|
||||
<p class="my-3 text-xs leading-6 text-muted">
|
||||
生成前会检查镜头设计和主体参考图是否齐全。这里只生成提示词;首帧、视频任务、状态检查与失败重试已整理到
|
||||
镜头生产。
|
||||
生成提示词前请补齐镜头设计和参考图。
|
||||
</p>
|
||||
<ConfirmAction
|
||||
:loading="
|
||||
@@ -556,10 +594,11 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
></template>
|
||||
<NScrollbar
|
||||
v-if="
|
||||
query.error.value ||
|
||||
!prerequisites.directionEpisode ||
|
||||
!prerequisites.visualEpisode ||
|
||||
(data && !directionComplete && data.directions.shotCount)
|
||||
(data || !query.loading.value) &&
|
||||
(query.error.value ||
|
||||
!prerequisites.directionEpisode ||
|
||||
!prerequisites.visualEpisode ||
|
||||
episodeDesignGap)
|
||||
"
|
||||
class="workspace-feedback"
|
||||
>
|
||||
@@ -572,19 +611,13 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
>
|
||||
重试查询
|
||||
</NButton></ContextNotice
|
||||
><ContextNotice
|
||||
v-if="data && data.directions.shotCount && !productionReady"
|
||||
type="warning"
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>
|
||||
<strong>镜头生产前置设计尚未补齐或更新。</strong>
|
||||
当前导演设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},即时视觉状态
|
||||
><ContextNotice v-if="data && episodeDesignGap" type="info" :show-icon="false" class="mt-4">
|
||||
本集待补齐:镜头设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},画面状态
|
||||
{{ data.visualStates.visualStateCount }}/{{ data.visualStates.shotCount }}。<span
|
||||
v-if="data.directions.staleCount || data.visualStates.staleCount"
|
||||
>其中过期镜头设计 {{ data.directions.staleCount }} 条、画面状态
|
||||
{{ data.visualStates.staleCount }} 条。</span
|
||||
>请先补齐或更新后再进入镜头生产。 </ContextNotice
|
||||
>需更新:镜头设计 {{ data.directions.staleCount }} 个、画面状态
|
||||
{{ data.visualStates.staleCount }} 个。</span
|
||||
> </ContextNotice
|
||||
><ContextNotice
|
||||
v-if="!prerequisites.directionEpisode || !prerequisites.visualEpisode"
|
||||
type="info"
|
||||
@@ -592,19 +625,14 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
class="mt-4"
|
||||
>
|
||||
最新剧本拆解
|
||||
缺少本集生成所需的镜头、主体或形态数据。已保存设计仍可查看;请先在拆解页完成或恢复相应阶段。 </ContextNotice
|
||||
><ContextNotice
|
||||
v-else-if="data && !directionComplete && data.directions.shotCount"
|
||||
type="info"
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>
|
||||
本集导演设计尚未补齐或版本已变化,请先完成第 01 步,再生成本集即时状态。
|
||||
缺少本集生成所需的镜头、主体或形态数据。已保存设计仍可查看;请先在拆解页完成或恢复相应阶段。
|
||||
</ContextNotice>
|
||||
</NScrollbar>
|
||||
<div v-if="!data && query.loading.value" class="panel p-8 text-sm text-muted" role="status">
|
||||
正在读取正式分镜数据……
|
||||
</div>
|
||||
<!-- 以下是分镜目录与镜头详情的加载骨架 -->
|
||||
<ProjectWorkspaceSkeleton
|
||||
v-if="(!data && query.loading.value) || (!breakdownRecords.data.value && breakdownRecords.loading.value)"
|
||||
variant="storyboard"
|
||||
body-only />
|
||||
<div v-else-if="shots.length" class="panel storyboard-workspace workspace-surface">
|
||||
<nav class="shot-list directory-panel" aria-label="本集镜头">
|
||||
<div class="directory-heading">
|
||||
@@ -673,16 +701,21 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
/>
|
||||
</div>
|
||||
<!-- 以下是正式摄影、即时状态与待审草案入口 -->
|
||||
<div v-if="detailTab === 'design'" class="space-y-5 pt-6">
|
||||
<ShotDerivedReview
|
||||
:key="shot.shotId"
|
||||
:project-id="id"
|
||||
:episode-no="episodeNo"
|
||||
:shot="shot"
|
||||
:shots="shots"
|
||||
:disabled="blocked"
|
||||
@changed="query.refresh"
|
||||
/>
|
||||
<div
|
||||
v-if="detailTab === 'design'"
|
||||
class="workspace-section-stack workspace-section-stack-spacious pt-6"
|
||||
>
|
||||
<div class="flex flex-wrap items-center">
|
||||
<ShotDerivedReview
|
||||
:key="shot.shotId"
|
||||
:project-id="id"
|
||||
:episode-no="episodeNo"
|
||||
:shot="shot"
|
||||
:shots="shots"
|
||||
:disabled="blocked"
|
||||
@changed="query.refresh"
|
||||
/>
|
||||
</div>
|
||||
<ShotDesign :shot="shot" />
|
||||
</div>
|
||||
<!-- 以下是独立于项目批量制作门禁的单镜头首帧 -->
|
||||
@@ -730,11 +763,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
<EmptyState
|
||||
v-else-if="data"
|
||||
title="本集还没有正式分镜"
|
||||
description="先完成剧本拆解,再回来完善镜头设计和画面状态。"
|
||||
></EmptyState
|
||||
<EmptyState v-else-if="data" title="本集还没有正式分镜" description="请先完成剧本拆解。"></EmptyState
|
||||
></WorkspacePage>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ function exportReceipt() {
|
||||
<NButton @click="exportReceipt" text size="small"><Download :size="13" />导出诊断</NButton>
|
||||
</div>
|
||||
<ContextNotice v-if="failed" role="alert" type="error" :show-icon="false" class="mt-3">
|
||||
本次存在失败、校验未通过或未保存项。关闭“批量覆盖已有结果”后再补齐,可跳过已完整保存项。
|
||||
本次有未完成项。关闭覆盖模式后可只补缺项。
|
||||
</ContextNotice>
|
||||
<template v-if="receipt.kind === 'shots'">
|
||||
<p class="my-4 text-xs text-muted">
|
||||
@@ -46,7 +46,7 @@ function exportReceipt() {
|
||||
:show-icon="false"
|
||||
class="mt-3"
|
||||
>
|
||||
本集新镜头已保存。该集下游结果已随旧镜头清除,请依次重新生成导演设计、即时状态、首帧、提示词和视频。
|
||||
新镜头已保存。旧设计、首帧、提示词和视频已清除,请依次重新生成。
|
||||
</ContextNotice>
|
||||
<ul v-else class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="(issue, index) in receipt.result.storyboardShotValidation.issues" :key="index">
|
||||
@@ -106,10 +106,8 @@ function exportReceipt() {
|
||||
>:{{ userFacingText(item.error) }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 text-xs text-muted">
|
||||
批量处理完成后,可选择镜头查看完整画面描述;已有描述会直接使用,无需重新生成。
|
||||
</p>
|
||||
<p class="mt-3 text-xs text-muted">选中镜头即可查看已有画面描述。</p>
|
||||
</template>
|
||||
<p class="mt-4 text-[11px] text-muted">回执仅保留在当前浏览器会话中。数据库结果是覆盖率和镜头详情的依据。</p>
|
||||
<p class="mt-4 text-[11px] text-muted">回执仅保留在当前会话。</p>
|
||||
</section>
|
||||
</template>
|
||||
@@ -85,7 +85,7 @@ const savedWarnings = computed(() =>
|
||||
</div>
|
||||
<template v-if="query.data.value && !query.error.value">
|
||||
<p v-if="!query.data.value.motionPlanAvailable" class="mt-4 text-xs text-muted">
|
||||
尚无已保存动作计划,生成视频提示词后可在此查看。
|
||||
生成视频提示词后可查看动作计划。
|
||||
</p>
|
||||
<ol v-else class="motion-beats mt-4">
|
||||
<li v-for="(beat, index) in query.data.value.beats" :key="index" class="motion-beat">
|
||||
|
||||
@@ -114,7 +114,7 @@ function updateRefs(index: number, value: string) {
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
title="人工动作修订"
|
||||
description="免费预检查并保存后,确认模型费用、执行起点视觉校验,再激活修订。"
|
||||
description="免费检查并保存,再付费检查起始画面。通过后可启用修订。"
|
||||
wide
|
||||
>
|
||||
<div class="motion-revision-layout">
|
||||
@@ -307,9 +307,7 @@ function updateRefs(index: number, value: string) {
|
||||
<!-- 以下是收费视觉校验与激活模块,费用说明和操作成组排列 -->
|
||||
<section class="workspace-panel motion-revision-section" aria-label="动作起点视觉校验">
|
||||
<h3>起点视觉校验</h3>
|
||||
<p class="motion-revision-description">
|
||||
起点视觉校验会调用服务端已配置的视觉模型并消耗额度。仅校验所选已保存修订与当前主首帧,不生成图片或视频。
|
||||
</p>
|
||||
<p class="motion-revision-description">检查修订与当前主首帧是否一致,会消耗模型额度。</p>
|
||||
<NCheckbox v-model:checked="acknowledged" :disabled="blocked || !saved"
|
||||
>我已确认本次起点视觉校验的模型费用和修订范围。</NCheckbox
|
||||
>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NSelect, NTag } from 'naive-ui'
|
||||
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
|
||||
import { AppDrawer, WorkspaceSectionHeading } from '../../../components/ui'
|
||||
import { useActionMessage } from '../../../components/ui/useActionMessage'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
@@ -509,28 +510,26 @@ async function adopt() {
|
||||
title="摄影草案与审核"
|
||||
:description="`第 ${episodeNo} 集 · 镜头 ${shot.beatNo}.${shot.shotNo} · ${shot.title}`"
|
||||
>
|
||||
<div class="space-y-6">
|
||||
<div class="workspace-section-stack workspace-section-stack-spacious">
|
||||
<!-- 以下是当前分镜来源、质量诊断与人工确认状态 -->
|
||||
<section v-if="preflight.data.value" class="space-y-2 text-sm">
|
||||
<WorkspaceSectionHeading title="正式分镜审核" />
|
||||
<p>
|
||||
{{ preflight.data.value.current.valid ? '当前版本已审核' : '当前版本尚未审核或已过期' }} ·
|
||||
{{ preflight.data.value.current.valid ? '已审核' : '待审核' }} ·
|
||||
{{ preflight.data.value.quality.coverage.episodeCount }} 集 ·
|
||||
{{ preflight.data.value.quality.coverage.shotCount }} 镜 ·
|
||||
{{ preflight.data.value.quality.preflightEligible ? '质量预检符合要求' : '质量预检有待处理项' }}
|
||||
</p>
|
||||
<p v-if="!preflight.data.value.current.valid" class="text-muted">
|
||||
请在制作准备中核对并人工确认正式分镜,之后可采用选中的摄影草案。
|
||||
{{ preflight.data.value.quality.preflightEligible ? '检查通过' : '有待处理项' }}
|
||||
</p>
|
||||
<p v-if="!preflight.data.value.current.valid" class="text-muted">请先在制作准备中审核分镜。</p>
|
||||
<NCollapse>
|
||||
<NCollapseItem name="audit" title="查看当前版本与质量诊断">
|
||||
<NCollapseItem name="audit" title="审核详情">
|
||||
<p class="wrap-anywhere text-xs">
|
||||
分镜版本:{{ preflight.data.value.current.evidence.shotFingerprint }}
|
||||
</p>
|
||||
<ul v-if="issues.length" class="mt-2 space-y-1 text-xs">
|
||||
<li v-for="issue in issues" :key="issue">{{ userFacingText(issue) }}</li>
|
||||
</ul>
|
||||
<p v-else class="mt-2 text-xs text-muted">当前预检未列出具体问题。</p>
|
||||
<p v-else class="mt-2 text-xs text-muted">暂无待处理项。</p>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</section>
|
||||
@@ -543,7 +542,7 @@ async function adopt() {
|
||||
<p v-if="savedDraft.loading.value" role="status" class="text-muted">正在读取草案…</p>
|
||||
<template v-if="savedDraft.data.value">
|
||||
<p>
|
||||
{{ savedDraft.data.value.status === 'stale' ? '草案来源已变化' : '有已保存的待审草案' }} · 第
|
||||
{{ savedDraft.data.value.status === 'stale' ? '草案来源已变化' : '待审核' }} · 第
|
||||
{{ savedDraft.data.value.revision }} 版 · {{ formatDate(savedDraft.data.value.updatedAt) }}
|
||||
</p>
|
||||
<p v-if="savedDraft.data.value.status === 'stale'" class="text-muted">
|
||||
@@ -558,26 +557,26 @@ async function adopt() {
|
||||
>查看已保存草案</NButton
|
||||
>
|
||||
<NButton v-else size="small" :disabled="saving || savingDraft" @click="editCurrentDraft">{{
|
||||
formal ? '基于当前来源重新编辑' : '导入已复核草案'
|
||||
formal ? '重新编辑' : '导入已复核草案'
|
||||
}}</NButton>
|
||||
<NButton size="small" @click="copySavedDraft">复制原稿</NButton>
|
||||
</div>
|
||||
<NCollapse v-if="useSaved">
|
||||
<NCollapseItem name="saved-draft" title="查看保存的摄影、状态与原参数">
|
||||
<NCollapseItem name="saved-draft" title="查看草案">
|
||||
<p>构图:{{ savedDraft.data.value.draft.direction.composition }}</p>
|
||||
<p>摄影机位置:{{ savedDraft.data.value.draft.direction.cameraPosition }}</p>
|
||||
<pre class="mt-2 whitespace-pre-wrap wrap-anywhere text-xs">{{ savedDraftText }}</pre>
|
||||
<pre
|
||||
v-if="savedDraft.data.value.providerInput"
|
||||
class="mt-2 whitespace-pre-wrap wrap-anywhere text-xs"
|
||||
>{{ JSON.stringify(savedDraft.data.value.providerInput, null, 2) }}</pre>
|
||||
<RawDataDetails
|
||||
title="高级详情"
|
||||
:value="{
|
||||
草案: savedDraft.data.value.draft,
|
||||
模型参数: savedDraft.data.value.providerInput
|
||||
}"
|
||||
/>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</template>
|
||||
<p v-else-if="!savedDraft.loading.value && !savedDraft.error.value" class="text-muted">
|
||||
此镜头还没有已保存的待审草案。
|
||||
</p>
|
||||
<p v-if="draftConflict" class="text-muted">当前输入已保留。请重新读取保存记录,核对后再保存。</p>
|
||||
<p v-else-if="!savedDraft.loading.value && !savedDraft.error.value" class="text-muted">暂无草案。</p>
|
||||
<p v-if="draftConflict" class="text-muted">输入已保留。请读取最新草案后再保存。</p>
|
||||
<NButton
|
||||
v-if="draftConflict || savedDraft.error.value"
|
||||
size="small"
|
||||
@@ -589,10 +588,7 @@ async function adopt() {
|
||||
|
||||
<!-- 以下是受控摄影修订与场景沿用 -->
|
||||
<section v-if="formal && !useSaved" class="space-y-3 text-sm">
|
||||
<WorkspaceSectionHeading
|
||||
title="待审修改"
|
||||
description="可单独修订构图与机位,或填写所选场景的空缺即时状态。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="待审修改" />
|
||||
<p v-if="formalQuery.loading.value" role="status" class="text-muted">正在读取正式摄影来源…</p>
|
||||
<NButton v-else-if="formalQuery.error.value" @click="formalQuery.refresh">重新读取正式来源</NButton>
|
||||
<template v-else-if="formalQuery.data.value">
|
||||
@@ -623,7 +619,7 @@ async function adopt() {
|
||||
<p v-if="continuity?.previousClosingState">
|
||||
前镜已确认尾态:{{ continuity.previousClosingState.text }}
|
||||
</p>
|
||||
<p v-if="!scenes.length" class="text-muted">没有可沿用的同形态场景状态。已有状态不会被覆盖。</p>
|
||||
<p v-if="!scenes.length" class="text-muted">暂无可沿用的场景状态。</p>
|
||||
<NSelect
|
||||
v-else
|
||||
v-model:value="selectedScene"
|
||||
@@ -645,16 +641,13 @@ async function adopt() {
|
||||
<dt>当前即时状态</dt>
|
||||
<dd>{{ scene.currentStartState || '尚未填写' }}</dd>
|
||||
<dt>待确认差异</dt>
|
||||
<dd>仅将前镜已记录的即时状态填入当前场景。请确认它适用于本镜开场。</dd>
|
||||
<dd>请确认前一镜的状态适用于本镜开场。</dd>
|
||||
</dl>
|
||||
</template>
|
||||
</template>
|
||||
</section>
|
||||
<section v-else-if="!useSaved" class="space-y-3">
|
||||
<WorkspaceSectionHeading
|
||||
title="导入待审摄影草案"
|
||||
description="粘贴为当前分镜版本准备的草案,再免费核对实际输入。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="导入待审摄影草案" />
|
||||
<NInput
|
||||
v-model:value="imported"
|
||||
type="textarea"
|
||||
@@ -699,10 +692,7 @@ async function adopt() {
|
||||
|
||||
<!-- 以下是已冻结的草案、场景几何依据及实际模型输入 -->
|
||||
<section v-if="reviewed && previewDisplay" class="space-y-4 text-sm">
|
||||
<WorkspaceSectionHeading
|
||||
title="待人工采用的预览"
|
||||
description="草案不能用于正式生成。采用后请重新预览正式首帧。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="草案预览" description="采用后可预览正式首帧。" />
|
||||
<NTag size="small" :bordered="false">{{
|
||||
reviewed.preview.productionGate.ready ? '项目制作已就绪' : '项目制作未就绪'
|
||||
}}</NTag>
|
||||
@@ -732,7 +722,7 @@ async function adopt() {
|
||||
</dd>
|
||||
</dl>
|
||||
<NCollapse>
|
||||
<NCollapseItem name="visual" title="查看即时状态与场景几何依据">
|
||||
<NCollapseItem name="visual" title="场景与角色状态">
|
||||
<p v-if="reviewed.selection.draft.visualState.continuityNote" class="mb-2">
|
||||
{{ reviewed.selection.draft.visualState.continuityNote }}
|
||||
</p>
|
||||
@@ -757,18 +747,13 @@ async function adopt() {
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="reviewed.preview.sceneSources.length" class="mt-3 space-y-1 text-xs text-muted">
|
||||
<li
|
||||
v-for="source in reviewed.preview.sceneSources"
|
||||
:key="source.subjectRef + source.imageId"
|
||||
class="wrap-anywhere"
|
||||
>
|
||||
{{ source.subjectRef }} · 已确认几何版本 {{ source.spatialLayoutVersion }}
|
||||
</li>
|
||||
</ul>
|
||||
<RawDataDetails
|
||||
v-if="reviewed.preview.sceneSources.length"
|
||||
title="场景参考详情"
|
||||
:value="reviewed.preview.sceneSources"
|
||||
/>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
<p class="wrap-anywhere text-xs text-muted">草案指纹:{{ reviewed.preview.draftFingerprint }}</p>
|
||||
<KeyframePreviewChecks :preview="reviewed.preview" />
|
||||
<ImageGenerationPreview
|
||||
:preview="previewDisplay"
|
||||
|
||||
@@ -135,10 +135,7 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
<div class="workspace-section-stack workspace-section-stack-spacious">
|
||||
<section>
|
||||
<!-- 以下是统一的参考图模块标题、说明与刷新操作模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="主体参考图"
|
||||
description="自动读取镜头当前绑定形态的主参考图,不生成新图。切换镜头会同步刷新,参考图缺失会影响后续生成。"
|
||||
>
|
||||
<WorkspaceSectionHeading title="主体参考图" description="查看当前镜头的主参考图。缺图时请先补齐。">
|
||||
<template #actions>
|
||||
<WorkspaceRefreshButton
|
||||
label="刷新参考图"
|
||||
@@ -182,16 +179,13 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
当前镜头还没有可用参考图。
|
||||
</p>
|
||||
<p v-if="references.missing.length" class="mt-3 text-xs text-muted">
|
||||
请在形态图库补齐图片或设置主图,再刷新本镜头参考图。
|
||||
请到形态图片补图或设置主图,再刷新。
|
||||
</p>
|
||||
</template>
|
||||
</section>
|
||||
<section>
|
||||
<!-- 以下是统一的生成规格模块标题与读取操作模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="镜头生成方案"
|
||||
description="汇总角色特征、形态、镜头设计和画面状态,整理成生成方案。请先补齐本镜头的设计和画面状态;这一步不生成图片或视频。"
|
||||
>
|
||||
<WorkspaceSectionHeading title="镜头生成方案" description="先补齐镜头设计和画面状态,再查看生成方案。">
|
||||
<template #actions>
|
||||
<NButton
|
||||
:disabled="locked || busy.spec || !shot.direction || !shot.visualState"
|
||||
@@ -215,7 +209,7 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
<!-- 以下是统一的视频提示词模块标题与说明模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="视频提示词"
|
||||
description="已有的视频描述可以直接使用;缺少时会根据镜头生成方案和参考图调用模型整理。生成图片和视频请前往“镜头生产”。"
|
||||
description="已有描述可直接使用。缺少时可付费生成,图片和视频在镜头生产页制作。"
|
||||
/>
|
||||
<div class="mt-4 flex flex-wrap items-center gap-4">
|
||||
<ConfirmAction
|
||||
|
||||
@@ -183,10 +183,7 @@ async function inspectGaze() {
|
||||
<template>
|
||||
<section class="spatial-bindings-panel" aria-label="人工确认视线目标">
|
||||
<!-- 以下是统一的视线模块标题、说明与刷新操作模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="视线目标"
|
||||
description="明确“朝向目标方向”或“注视具体目标”,保存后重新核对相关提示词和首帧。"
|
||||
>
|
||||
<WorkspaceSectionHeading title="视线目标" description="选定朝向或注视目标后,请复查提示词和首帧。">
|
||||
<template #actions>
|
||||
<WorkspaceRefreshButton
|
||||
label="刷新绑定"
|
||||
@@ -283,9 +280,7 @@ async function inspectGaze() {
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<p v-if="query.data.value && !draft.length" class="mt-4 text-xs text-muted">
|
||||
尚未手工确认目标;当前仍使用已保存设计推导的约束。
|
||||
</p>
|
||||
<p v-if="query.data.value && !draft.length" class="mt-4 text-xs text-muted">当前沿用镜头设计中的目标。</p>
|
||||
<div class="mt-4 flex flex-wrap items-center gap-3">
|
||||
<NButton :disabled="disabled || !subjects.length || !!query.error.value" @click="add">添加目标</NButton>
|
||||
<NPopconfirm
|
||||
|
||||
@@ -34,7 +34,7 @@ const result = computed(() => query.data.value)
|
||||
<ReadonlyInspection
|
||||
v-model:open="open"
|
||||
title="主体引用覆盖检查"
|
||||
description="检查分镜文本与主体绑定是否一致,只读取数据,不自动生成或修改分镜。"
|
||||
description="核对分镜是否漏选或错选主体。"
|
||||
:loading="query.loading.value"
|
||||
:error="query.error.value"
|
||||
@refresh="query.refresh"
|
||||
|
||||
@@ -163,8 +163,12 @@ export function mergeDesignedShots(
|
||||
return [...rows.values()].toSorted((a, b) => a.beatNo - b.beatNo || a.shotNo - b.shotNo)
|
||||
}
|
||||
|
||||
/** 摄影枚举翻译;新枚举保留原值,避免静默丢失字段。 */
|
||||
/** 摄影选项展示中文,镜头描述等自由文本保持原样。
|
||||
* @param value 摄影选项或镜头描述
|
||||
* @param field 所属摄影字段
|
||||
* @returns 对应展示文字 */
|
||||
export function directionLabel(value: string, field?: string): string {
|
||||
if (field === 'composition' || field === 'cameraPosition' || field === 'visualIntent') return value
|
||||
if (value === 'wide') return field === 'lensIntent' ? '广角' : '远景'
|
||||
const labels: Record<string, string> = {
|
||||
'extreme-wide': '大远景',
|
||||
@@ -195,7 +199,7 @@ export function directionLabel(value: string, field?: string): string {
|
||||
moderate: '中等景深',
|
||||
shallow: '浅景深'
|
||||
}
|
||||
return labels[value] ?? value
|
||||
return labels[value] ?? '待确认'
|
||||
}
|
||||
|
||||
/** 保留已有导出路径;图库与分镜共用同一套图片地址校验。 */
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useProjectContext } from '../projects/context'
|
||||
import { formalBreakdownSnapshot } from '../workflows/selectors'
|
||||
import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { preparationApi } from '../storyboard-preparation/api'
|
||||
import { currentStoryboardApproval } from '../storyboard-preparation/model'
|
||||
import { currentStoryboardApproval, storyboardDesignGap } from '../storyboard-preparation/model'
|
||||
import { storyboardApi } from './api'
|
||||
import {
|
||||
currentEpisodeSource,
|
||||
@@ -23,6 +23,8 @@ export type StoryboardCommand = 'shots-current' | 'direction-all' | 'visual-all'
|
||||
/** 分镜查询、依赖判断与操作入口;不修改后端 graph。 */
|
||||
export function useStoryboard() {
|
||||
const context = useProjectContext()
|
||||
/** 正式镜头与候选来源仍由完整拆解记录判断。 */
|
||||
const breakdownRecords = context.useWorkflowCheckpoints('breakdown')
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const id = computed(() => context.project.value?.id ?? '')
|
||||
/** 两个镜头工作区共用地址选择,刷新恢复同一正式镜头。 */
|
||||
@@ -34,7 +36,7 @@ export function useStoryboard() {
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const force = ref(false)
|
||||
/** 正式镜头查询只补充正式快照正文,不混入最新候选。 */
|
||||
const snapshot = computed(() => formalBreakdownSnapshot(context.checkpoints.value))
|
||||
const snapshot = computed(() => formalBreakdownSnapshot(breakdownRecords.data.value ?? []))
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const sourceEpisodes = computed(
|
||||
() => snapshot.value?.storyboardEpisodeShots ?? snapshot.value?.breakdownResult?.storyboardEpisodeShots ?? []
|
||||
@@ -86,9 +88,28 @@ export function useStoryboard() {
|
||||
() =>
|
||||
!approval.loading.value && !approval.error.value && currentStoryboardApproval(approval.data.value, id.value)
|
||||
)
|
||||
/** 仅在分镜页且项目设计尚未就绪时读取全项目覆盖,不为每次切换剧集重复查询。 */
|
||||
const designProject = computed(() =>
|
||||
approved.value && context.stageReadiness.value?.storyboard.ready === false ? id.value : ''
|
||||
)
|
||||
/** 全项目有效设计数量与制作前检查使用同一接口。 */
|
||||
const designEntry = useQuery(designProject, (projectId, signal) =>
|
||||
projectId ? preparationApi.entry(projectId, signal) : Promise.resolve(null)
|
||||
)
|
||||
/** 项目状态刷新后重新核对覆盖,包括补齐任务终态。 */
|
||||
watch(context.stageReadiness, (readiness, previous) => {
|
||||
if (designProject.value && readiness?.projectId === previous?.projectId && previous?.storyboard.ready === false)
|
||||
void designEntry.refresh()
|
||||
})
|
||||
/** 只展示当前查询确认的覆盖问题,失败时保留分集查询的反馈。 */
|
||||
const projectDesignGap = computed(() =>
|
||||
designProject.value && !designEntry.loading.value && !designEntry.error.value
|
||||
? storyboardDesignGap(designEntry.data.value)
|
||||
: null
|
||||
)
|
||||
/** 正式修订或审核后随项目数据刷新核对凭据,避免沿用旧权限。 */
|
||||
watch(context.checkpoints, () => {
|
||||
if (approval.data.value || approval.error.value) void approval.refresh()
|
||||
watch(breakdownRecords.data, (records, previous) => {
|
||||
if (records && previous && (approval.data.value || approval.error.value)) void approval.refresh()
|
||||
})
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const session = computed(() => getStoryboardSession(id.value))
|
||||
@@ -111,7 +132,7 @@ export function useStoryboard() {
|
||||
selectedShot.value ? shots.value.find(item => item.shotId === selectedShot.value) : shots.value[0]
|
||||
)
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const prerequisites = computed(() => storyboardPrerequisites(context.checkpoints.value, episodeNo.value))
|
||||
const prerequisites = computed(() => storyboardPrerequisites(breakdownRecords.data.value ?? [], episodeNo.value))
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const operation = computed(() => getOperation(id.value))
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
@@ -123,6 +144,10 @@ export function useStoryboard() {
|
||||
() =>
|
||||
operation.value.pending ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
breakdownRecords.loading.value ||
|
||||
!!breakdownRecords.error.value ||
|
||||
breakdownRecords.data.value === null ||
|
||||
!!query.error.value ||
|
||||
!data.value ||
|
||||
context.project.value?.status !== 'completed' ||
|
||||
@@ -185,7 +210,7 @@ export function useStoryboard() {
|
||||
for (const [index, entry] of executions.entries()) {
|
||||
watch(
|
||||
() => entry.observer.query.data.value,
|
||||
record => {
|
||||
(record, previous) => {
|
||||
if (!record || record.projectId !== id.value || !['completed', 'failed'].includes(record.status)) return
|
||||
const target = getStoryboardSession(record.projectId)
|
||||
if (index === 0 && record.metadata?.action !== 'regenerate-storyboard-episode') return
|
||||
@@ -217,7 +242,14 @@ export function useStoryboard() {
|
||||
target.receipt = { kind: 'batch', title: entry.title, result }
|
||||
}
|
||||
}
|
||||
void Promise.all([query.refresh(), context.refresh(), context.refreshStageReadiness()])
|
||||
if (!previous) return
|
||||
void Promise.all([
|
||||
query.refresh(),
|
||||
index === 0
|
||||
? context.refreshWorkflow('breakdown', record.projectId, record.id + ':' + record.status)
|
||||
: context.refreshWorkflow(null, record.projectId, record.id + ':' + record.status),
|
||||
context.refreshStageReadiness()
|
||||
])
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -238,7 +270,7 @@ export function useStoryboard() {
|
||||
prompts: '项目视频提示词'
|
||||
}
|
||||
target.receipt = null
|
||||
await runOperation(projectId, `生成${titles[command]}`, async () => {
|
||||
const submitted = await runOperation(projectId, `生成${titles[command]}`, async () => {
|
||||
if (command === 'direction-all' || command === 'visual-all') {
|
||||
const latest = await preparationApi.approval(projectId)
|
||||
if (
|
||||
@@ -250,7 +282,15 @@ export function useStoryboard() {
|
||||
}
|
||||
if (command === 'shots-current') {
|
||||
const started = await storyboardApi.regenerateEpisodeShots(projectId, targetEpisode)
|
||||
await executions[0]!.observer.track(started.executionId, projectId)
|
||||
const observer = executions[0]!.observer
|
||||
await observer.track(started.executionId, projectId)
|
||||
const record = observer.query.data.value
|
||||
const terminal = record?.id === started.executionId && ['completed', 'failed'].includes(record.status)
|
||||
await context.refreshWorkflow(
|
||||
'breakdown',
|
||||
projectId,
|
||||
terminal ? record.id + ':' + record.status : undefined
|
||||
)
|
||||
} else if (command === 'direction-all') {
|
||||
const started = await storyboardApi.generateDirections(projectId, batch)
|
||||
await executions[1]!.observer.track(started.executionId, projectId)
|
||||
@@ -266,7 +306,12 @@ export function useStoryboard() {
|
||||
await executions[3]!.observer.track(started.executionId, projectId)
|
||||
}
|
||||
})
|
||||
await Promise.all([query.refresh(), context.refreshStageReadiness()])
|
||||
if (id.value !== projectId) return
|
||||
await Promise.all([
|
||||
query.refresh(),
|
||||
context.refreshStageReadiness(),
|
||||
submitted && command !== 'shots-current' ? context.summaryQuery.refresh() : Promise.resolve()
|
||||
])
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -282,6 +327,7 @@ export function useStoryboard() {
|
||||
source,
|
||||
episodeSourceUnavailable,
|
||||
prerequisites,
|
||||
breakdownRecords,
|
||||
projectAssetsReady,
|
||||
session,
|
||||
operation,
|
||||
@@ -295,6 +341,7 @@ export function useStoryboard() {
|
||||
directionComplete,
|
||||
approval,
|
||||
approved,
|
||||
projectDesignGap,
|
||||
visualStateComplete,
|
||||
hasCurrentEpisodeShots,
|
||||
executions,
|
||||
|
||||
@@ -463,7 +463,7 @@ const nextAction = computed<{ action: IdentityFlowAction; title: string; descrip
|
||||
action: 'forms',
|
||||
title: '主体身份已完成',
|
||||
description: subjectImagesAccess.value.enabled
|
||||
? '可以继续生成此主体的形态图片。'
|
||||
? '可生成形态图片。'
|
||||
: `${subjectImagesAccess.value.reason},完成项目准备后可进入形态图片。`,
|
||||
label: '查看形态图片'
|
||||
}
|
||||
@@ -521,10 +521,10 @@ function runNextAction() {
|
||||
<div class="workspace-overview-panel">
|
||||
<div class="overview-content workspace-section-stack dialog-flat-stack">
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
先保存人物、场景或道具的固定特征,再生成参考图。确认并锁定的标准参考图称为“身份母版”,后续制作会以它保持外观一致。
|
||||
保存固定特征后生成参考图。锁定母版可保持外观一致。
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="styleQuery.data.value && !hasStyle" type="info" :show-icon="false">
|
||||
请先在“视觉风格”页面保存项目风格,再生成身份描述或参考图。</ContextNotice
|
||||
请先保存视觉风格。</ContextNotice
|
||||
>
|
||||
<!-- 以下是人物选角进度、批量参数与角色详情入口模块 -->
|
||||
<section v-if="casting" class="workspace-panel" aria-label="角色选角流程">
|
||||
@@ -534,8 +534,7 @@ function runNextAction() {
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold">角色选角</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
补齐身份描述 → 生成候选图 →
|
||||
进入角色详情确认选角。候选图根据当前描述独立生成,不参考旧母版;确认后才设为母版并锁定身份。
|
||||
补齐身份描述,生成新候选,再到角色详情确认并锁定母版。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -610,7 +609,7 @@ function runNextAction() {
|
||||
!casting.total
|
||||
"
|
||||
acknowledgement
|
||||
description="处理本项目的人物身份描述与提示词,不生成图片,也不受每批图片数量上限限制。已锁定角色会跳过;勾选重新生成后会覆盖未锁定角色的已有描述,但不会更新已有图片。可能产生 AI 生成费用。"
|
||||
description="仅生成身份描述和提示词,可能收费。已锁定角色跳过;重新生成会覆盖未锁定角色的文字,保留图片。"
|
||||
@confirm="generateProject(true)"
|
||||
/>
|
||||
<ConfirmAction
|
||||
@@ -632,11 +631,10 @@ function runNextAction() {
|
||||
</div>
|
||||
</AppForm>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
同时处理数量适用于所有批量生成;每批图片数量上限仅限制角色候选图、场景和道具母版的处理数量。重新生成选项仅影响身份描述,不影响图片。
|
||||
图片上限只限制生图。重新生成选项只覆盖身份文字。
|
||||
</p>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
未注明人物背景时,AI
|
||||
遵循剧本与角色特征;未明确人物背景时保持地域与族裔中性。点击下方角色可关闭此界面并查看详情,不会确认或更改选角。
|
||||
按剧本选角,未明确的背景保持中性。点击角色可查看详情。
|
||||
</p>
|
||||
<div class="casting-list" role="group" aria-label="角色选角进度">
|
||||
<NButton
|
||||
@@ -662,7 +660,7 @@ function runNextAction() {
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold">场景与道具母版</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
为已有身份描述、尚未锁定或缺少有效母版的场景和道具生成参考图。通过质量校验后,自动设为母版并锁定;未通过的需继续处理。
|
||||
为已填写描述且需要母版的场景和道具生成参考图。通过后自动设为母版并锁定。
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
@@ -707,7 +705,7 @@ function runNextAction() {
|
||||
><NCollapseItem name="details"
|
||||
><template #header>高级:按类型批量生成身份描述</template>
|
||||
<p class="mt-3 text-xs leading-6 text-muted">
|
||||
按所选类型处理身份描述与提示词,不生成图片。沿用上方的同时处理数量和重新生成选项,已锁定身份会跳过,不受每批图片数量上限限制。
|
||||
按所选类型生成身份文字,跳过已锁定主体。
|
||||
</p>
|
||||
<NSelect
|
||||
v-model:value="identityBatchModule"
|
||||
@@ -773,16 +771,14 @@ function runNextAction() {
|
||||
:show-icon="false"
|
||||
class="mt-3"
|
||||
>
|
||||
部分生成未完成,已成功的结果会保留。请查看下方原因后再重试。
|
||||
部分未完成。成功结果已保留,请核对原因后重试。
|
||||
</ContextNotice>
|
||||
<ul class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="failure in session.receipt.result.failures" :key="failure.subjectId">
|
||||
{{ failure.subjectRef }}:{{ userFacingText(failure.error) }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 text-[11px] text-muted">
|
||||
回执仅保留于当前浏览器会话;最终状态以刷新后的正式记录为准。
|
||||
</p>
|
||||
<p class="mt-3 text-[11px] text-muted">刷新可查看最新状态。</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -940,12 +936,14 @@ function runNextAction() {
|
||||
请先保存身份修改,再使用 AI 或生成图片。
|
||||
</p>
|
||||
<!-- 以下是未生图主体的原文事实修订入口 -->
|
||||
<NButton
|
||||
class="mt-4 workspace-action-button"
|
||||
:disabled="detailBlocked || dirty"
|
||||
@click="revisionOpen = true"
|
||||
>核对与修订视觉事实</NButton
|
||||
>
|
||||
<div class="identity-revision-actions">
|
||||
<NButton
|
||||
class="workspace-action-button"
|
||||
:disabled="detailBlocked || dirty"
|
||||
@click="revisionOpen = true"
|
||||
>核对与修订视觉事实</NButton
|
||||
>
|
||||
</div>
|
||||
<VisualFactRevisionDrawer
|
||||
v-if="revisionOpen"
|
||||
:key="subject.id"
|
||||
@@ -973,7 +971,7 @@ function runNextAction() {
|
||||
:loading="isOperationRunning(operation, 'AI 生成主体身份')"
|
||||
v-if="identity?.description?.trim() || identity?.generationPrompt?.trim()"
|
||||
label="AI 生成主体身份"
|
||||
description="AI 将重新生成当前主体的身份描述和核心提示词,并覆盖已保存的文本;已有图片不会自动更新。"
|
||||
description="重新生成会覆盖此主体的身份文字,已有图片保留。"
|
||||
:disabled="!canGenerateText"
|
||||
primary
|
||||
@confirm="generate"
|
||||
@@ -1038,7 +1036,7 @@ function runNextAction() {
|
||||
>
|
||||
</div>
|
||||
<p v-if="!subject.forms.length" class="text-xs text-muted">
|
||||
这个角色还没有正式形态,可以先完善角色特征并选择外观。
|
||||
暂无形态,可先完善角色特征和外观。
|
||||
</p>
|
||||
<RouterLink
|
||||
v-if="subjectImagesAccess.enabled"
|
||||
@@ -1058,7 +1056,7 @@ function runNextAction() {
|
||||
<EmptyState
|
||||
v-else-if="catalog.data.value"
|
||||
title="还没有可展示的正式主体"
|
||||
description="先完成剧本拆解与主体形态持久化,再来管理稳定身份。" />
|
||||
description="请先完成剧本拆解并保存主体形态。" />
|
||||
<StableAnchorQualityDialog
|
||||
v-if="
|
||||
subject &&
|
||||
@@ -1100,9 +1098,7 @@ function runNextAction() {
|
||||
<!-- 以下是点击生图时才展示的模型配置引导,关闭后交给唯一项目配置抽屉 -->
|
||||
<AppDialog v-model:open="modelPromptOpen" title="需要配置生成模型" status="warning" @closed="finishModelPrompt">
|
||||
<!-- 以下是独立于标题的配置引导正文,沿用公共弹窗内容与底栏间距 -->
|
||||
<p class="text-sm leading-7 text-muted">
|
||||
请在右上角“项目配置”中选择图片与视频模型。配置保存后,请重新点击需要的生成操作;本次尚未生成,也未产生费用。
|
||||
</p>
|
||||
<p class="text-sm leading-7 text-muted">请在项目配置中选择模型,再发起生成。本次未扣费。</p>
|
||||
<template #footer>
|
||||
<NButton @click="modelPromptOpen = false">取消</NButton>
|
||||
<NButton type="primary" :disabled="!openProjectSettings" @click="requestProjectConfig"
|
||||
@@ -1178,10 +1174,15 @@ function runNextAction() {
|
||||
border-top: 1px solid var(--app-border);
|
||||
}
|
||||
.identity-next-action p {
|
||||
@apply mt-1 text-xs text-muted;
|
||||
@apply text-xs text-muted;
|
||||
}
|
||||
.identity-next-action > div {
|
||||
@apply min-w-0;
|
||||
@apply grid min-w-0 gap-1.5;
|
||||
}
|
||||
.identity-revision-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-block: var(--app-content-gap);
|
||||
}
|
||||
.identity-next-action > .n-button {
|
||||
@apply shrink-0;
|
||||
|
||||
@@ -104,8 +104,7 @@ const formModel = computed(() => ({ prompt: prompt.value }))
|
||||
@submit="submit"
|
||||
>
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
AI
|
||||
会根据角色身份、项目视觉风格和选角要求生成一张新的候选图,不会复用当前身份母版。生成后请在图库审核候选,通过后再确认选角并锁定身份。
|
||||
按当前设定独立生成一张候选图。审核后再确认选角并锁定母版。
|
||||
</ContextNotice>
|
||||
<NFormItem
|
||||
class="block"
|
||||
@@ -122,9 +121,7 @@ const formModel = computed(() => ({ prompt: prompt.value }))
|
||||
:autosize="{ minRows: 3, maxRows: 12 }"
|
||||
></NInput>
|
||||
</NFormItem>
|
||||
<p v-if="prompt.trim()" class="text-xs text-danger">
|
||||
填写自定义描述后,会替换自动整理的描述;请写清角色特征、基础服装和参考图要求。
|
||||
</p>
|
||||
<p v-if="prompt.trim()" class="text-xs text-danger">自定义描述会覆盖默认值,请写明特征、服装和参考要求。</p>
|
||||
<GenerationModelControls
|
||||
type="image"
|
||||
:catalog="catalog"
|
||||
|
||||
@@ -251,7 +251,7 @@ function regenerate() {
|
||||
<ConfirmAction
|
||||
:key="image.id"
|
||||
label="校验此身份图片"
|
||||
description="将核对当前候选,可能调用视觉模型并产生费用。审核后仍需人工确认母版。"
|
||||
description="检查当前候选,可能收费。母版需人工确认。"
|
||||
:disabled="disabled || !!pendingOperation || image.viewType !== 'primary'"
|
||||
:loading="validateLoading"
|
||||
acknowledgement
|
||||
|
||||
@@ -152,8 +152,7 @@ const rules = {
|
||||
@submit="submit"
|
||||
>
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
调用
|
||||
图片模型,每次新增一张图片,可能产生费用。新图片只作为候选保留,质量审核通过并由你确认后,才能成为身份母版。
|
||||
每次生成一张候选图,可能收费。审核通过后需手动设为母版。
|
||||
</ContextNotice>
|
||||
<!-- 以下是多视角与已有身份图选择模块,单一选项不显示选择器 -->
|
||||
<NFormItem
|
||||
@@ -177,10 +176,7 @@ const rules = {
|
||||
:label-props="{ for: 'identity-reference' }"
|
||||
>
|
||||
<template #label>
|
||||
<FieldLabel
|
||||
label="身份锚定来源"
|
||||
description="只能选择这个主体已生成完成的图片。图片链接需要仍可访问,预览能显示不代表链接一直有效。"
|
||||
/>
|
||||
<FieldLabel label="身份锚定来源" description="仅可选该主体已生成且可访问的图片。" />
|
||||
</template>
|
||||
<NSelect
|
||||
id="identity-reference"
|
||||
@@ -212,9 +208,7 @@ const rules = {
|
||||
:autosize="{ minRows: 3, maxRows: 12 }"
|
||||
></NInput>
|
||||
</NFormItem>
|
||||
<p v-if="prompt.trim()" class="text-xs text-danger">
|
||||
填写自定义描述后,会替换自动整理的完整描述;请写清角色特征和视角要求。
|
||||
</p>
|
||||
<p v-if="prompt.trim()" class="text-xs text-danger">自定义描述会覆盖默认值,请写明角色特征和视角。</p>
|
||||
<GenerationModelControls
|
||||
type="image"
|
||||
:catalog="compatibleCatalog"
|
||||
|
||||
@@ -210,7 +210,7 @@ async function save() {
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
:title="`修订视觉事实 · ${subjectName}`"
|
||||
description="依据原文纠正当前主体和全部形态。保存后需要重新准备受影响的身份和画面描述。"
|
||||
description="按原文修订主体和形态。保存后请更新受影响的身份和画面描述。"
|
||||
:busy="saving"
|
||||
>
|
||||
<!-- 以下是当前可修订性和版本冲突反馈 -->
|
||||
@@ -222,7 +222,7 @@ async function save() {
|
||||
}}</ContextNotice>
|
||||
<p v-else-if="query.loading.value" class="text-sm text-muted">正在读取事实与原文…</p>
|
||||
<p v-else-if="query.data.value && !query.data.value.preview.canRevise" class="text-sm text-muted">
|
||||
此主体当前无法修订。请检查是否已有身份或形态图片、身份已锁定,或项目还有任务进行中。
|
||||
暂不能修订,请核对已有图片、锁定状态和进行中的任务。
|
||||
</p>
|
||||
<template v-else-if="query.data.value">
|
||||
<!-- 以下是主体与全部正式形态的事实编辑 -->
|
||||
@@ -270,10 +270,7 @@ async function save() {
|
||||
|
||||
<!-- 以下是可追溯的原文、修订原因和人工确认 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="原文证据"
|
||||
description="从原始主题或正式剧本中引用能直接支持本次修订的原句。"
|
||||
/>
|
||||
<WorkspaceSectionHeading title="原文证据" description="引用能支持修订的原句。" />
|
||||
<NSelect
|
||||
v-model:value="sourceId"
|
||||
:options="sources"
|
||||
|
||||
@@ -30,6 +30,7 @@ import { downloadText } from '../../lib/format'
|
||||
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
||||
import { useSubjectImages } from './useSubjectImages'
|
||||
import { hasRunningImages, primaryImage, isIdentityAnchorReuse } from './model'
|
||||
import ProjectWorkspaceSkeleton from '../projects/components/ProjectWorkspaceSkeleton.vue'
|
||||
import type { SubjectFormAsset } from './types'
|
||||
import GenerateImageDialog from './components/GenerateImageDialog.vue'
|
||||
import ImagePreparationDrawer from './components/ImagePreparationDrawer.vue'
|
||||
@@ -76,13 +77,6 @@ const linkedReferences = computed(() => referenceTargets(impact.references.data.
|
||||
const sourceMissing = computed(
|
||||
() => sourceShotId.value && !sourceShot.value && !impact.query.loading.value && !impact.query.error.value
|
||||
)
|
||||
const sourceCurrent = computed(
|
||||
() =>
|
||||
sourceShot.value &&
|
||||
!sourceShot.value.primaryKeyframeStale &&
|
||||
!impact.query.loading.value &&
|
||||
!impact.query.error.value
|
||||
)
|
||||
const targetUnlinked = computed(
|
||||
() =>
|
||||
targetForm.value &&
|
||||
@@ -94,8 +88,7 @@ const showImpactDetails = computed(
|
||||
() =>
|
||||
sourceShotId.value &&
|
||||
(sourceMissing.value ||
|
||||
sourceCurrent.value ||
|
||||
sourceShot.value?.inconsistent ||
|
||||
impact.query.error.value ||
|
||||
targetUnlinked.value ||
|
||||
linkedReferences.value.length ||
|
||||
impact.references.loading.value ||
|
||||
@@ -109,14 +102,6 @@ const sourceLocation = computed(() =>
|
||||
}
|
||||
: null
|
||||
)
|
||||
const impactOptions = computed(() => {
|
||||
const items = [...impact.stale.value]
|
||||
if (sourceShot.value && !items.some(item => item.shotId === sourceShot.value?.shotId)) items.push(sourceShot.value)
|
||||
return items.map(item => ({
|
||||
value: item.shotId,
|
||||
label: `第 ${item.episodeNo} 集 · 剧情段落 ${item.beatNo} / 镜头 ${item.shotNo}${item.inconsistent ? ' · 状态待核对' : item.primaryKeyframeStale ? ' · 首帧过期' : ' · 当前镜头'}`
|
||||
}))
|
||||
})
|
||||
const toolsOpen = ref(false)
|
||||
/** 免费检查图片阶段规格和母版依赖。 */
|
||||
const preparationOpen = ref(false)
|
||||
@@ -234,6 +219,18 @@ const promptId = ref('')
|
||||
const promptForm = computed(() => forms.value.find(form => form.id === promptId.value) ?? null)
|
||||
const generateForm = computed(() => forms.value.find(form => form.id === generateId.value) ?? null)
|
||||
const galleryForm = computed(() => forms.value.find(form => form.id === galleryId.value) ?? null)
|
||||
|
||||
/**
|
||||
* 用已记录的图片尺寸预留瀑布流卡片高度,缺少尺寸时保持方形。
|
||||
* @param form 当前形态
|
||||
* @returns 图片容器宽高比
|
||||
*/
|
||||
function formCoverRatio(form: SubjectFormAsset) {
|
||||
const image = primaryImage(form.images)
|
||||
const width = image?.width
|
||||
const height = image?.height
|
||||
return width && height && width > 0 && height > 0 ? `${width} / ${height}` : '1 / 1'
|
||||
}
|
||||
const completeCount = computed(() => forms.value.filter(form => primaryImage(form.images)).length)
|
||||
const filtered = computed(() =>
|
||||
forms.value.filter(
|
||||
@@ -289,13 +286,6 @@ function resetFilters() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 切换受影响镜头时清空之前的素材过滤,避免相关素材被旧筛选隐藏。 */
|
||||
function selectImpactShot(shotId: string | null) {
|
||||
void router.replace({
|
||||
query: { ...route.query, sourceShotId: shotId || undefined, subjectFormId: undefined, subjectRef: undefined }
|
||||
})
|
||||
}
|
||||
|
||||
/** 同时刷新素材和镜头影响状态,查询仍不启动生成。 */
|
||||
async function refreshAssets() {
|
||||
await Promise.all([refreshProject(), query.refresh(), impact.query.refresh(), impact.references.refresh()])
|
||||
@@ -305,11 +295,14 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage compact mobile-scroll class="gallery-workspace-page">
|
||||
<!-- 以下是图库首次加载的完整工作区骨架 -->
|
||||
<ProjectWorkspaceSkeleton v-if="!query.data.value && query.loading.value" variant="subject-images" />
|
||||
<WorkspacePage v-else compact mobile-scroll class="gallery-workspace-page">
|
||||
<template #default>
|
||||
<!-- 批量设置使用弹窗,入口跟随图库筛选区。 -->
|
||||
<!-- 以下是全屏形态生图配置与回执,入口跟随图库筛选区。 -->
|
||||
<WorkspaceTools
|
||||
triggerless
|
||||
fullscreen
|
||||
:pending="operation.pending"
|
||||
:pending-label="operation.label"
|
||||
v-model:open="toolsOpen"
|
||||
@@ -319,13 +312,11 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
><div class="flex flex-wrap items-end justify-between gap-4">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold">形态图片</h2>
|
||||
<p class="mt-2 text-sm text-muted">
|
||||
为人物、场景和道具准备造型参考图。已有图片直接从数据库读取。
|
||||
</p>
|
||||
<p class="mt-2 text-sm text-muted">准备人物、场景和道具参考图。</p>
|
||||
</div>
|
||||
</div>
|
||||
<DetailDisclosure title="母版继承与过期处理" class="mt-4">
|
||||
基础形态可复用已确认并锁定的身份母版,其他形态仍需单独生成。浏览图库不会补建或切换主图;母版变化后,已有图片保留并需重新核对来源与质量。
|
||||
基础形态可复用已锁定母版。母版变化后,请复核已有图片。
|
||||
</DetailDisclosure>
|
||||
<FormPromptBatch
|
||||
:generating="isOperationRunning(operation, '批量生成形态正式提示词')"
|
||||
@@ -359,9 +350,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
<span class="ml-3 text-xs text-muted">使用项目图片模型</span>
|
||||
</p>
|
||||
</div>
|
||||
<p class="mt-2 text-[11px] leading-6 text-muted">
|
||||
图库仅查看已保存的图片。已有主图仍须通过当前来源和质量检查,才能用于后续分镜;独立候选与历史失败记录均保留。
|
||||
</p>
|
||||
<p class="mt-2 text-[11px] leading-6 text-muted">主图通过来源和质量检查后可用于分镜。</p>
|
||||
<section class="mt-4 pt-4">
|
||||
<h3 class="text-sm font-semibold">项目批量生图</h3>
|
||||
<AppForm :model="formModel" :rules="rules" :disabled="operation.pending" validate-on-change>
|
||||
@@ -412,7 +401,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
</div>
|
||||
</AppForm>
|
||||
<p class="mt-3 text-xs leading-6 text-muted">
|
||||
作用于整个项目,不受下方筛选影响。上限只限制本次真正生图数量,其余显示为“待后续处理”,不计入跳过。默认使用项目尺寸与正式提示词,不会启动视频生成。
|
||||
批量生图覆盖全项目,使用项目尺寸和已保存的提示词。超过上限的形态留待下次处理。
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
@@ -437,7 +426,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
:show-icon="false"
|
||||
class="mt-3"
|
||||
>
|
||||
部分形态生图失败。已生成的图片保留;先查看失败原因,再按形态重新生图。
|
||||
部分形态生图失败。成功图片已保留,请核对原因后重试。
|
||||
</ContextNotice>
|
||||
<ul class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="failure in session.receipt.result.failures" :key="failure.subjectFormId">
|
||||
@@ -445,96 +434,14 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
>:{{ userFacingText(failure.error) }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 text-[11px] text-muted">
|
||||
回执仅保留于当前浏览器会话;图片以刷新后的数据库记录为准。
|
||||
</p>
|
||||
<p class="mt-3 text-[11px] text-muted">刷新可查看最新图片。</p>
|
||||
</section>
|
||||
</WorkspaceTools>
|
||||
<!-- 关联说明、筛选和图片共用正文滚动区,避免镜头切换时两块滚动区域高度不同步。 -->
|
||||
<ContextNotice
|
||||
v-if="impact.stale.value.length"
|
||||
type="warning"
|
||||
:show-icon="false"
|
||||
class="mt-3"
|
||||
title="下游主首帧需要处理"
|
||||
data-keyframe-impact
|
||||
>
|
||||
<div class="flex flex-wrap items-start justify-between gap-2">
|
||||
<p>
|
||||
{{ impact.stale.value.length }}
|
||||
个镜头的首帧需要核对。此警告不表示形态图片本身失效;请先查看对应镜头与关联素材,确认原因后再处理。
|
||||
</p>
|
||||
<NButton
|
||||
text
|
||||
size="small"
|
||||
:loading="impact.query.loading.value"
|
||||
data-refresh-keyframe-impact
|
||||
@click="impact.query.refresh"
|
||||
>重新检查</NButton
|
||||
>
|
||||
</div>
|
||||
<p v-if="impact.stale.value.some(item => item.inconsistent)" class="mt-2">
|
||||
其中 {{ impact.stale.value.filter(item => item.inconsistent).length }}
|
||||
个镜头的首帧与视频检查结果不一致,请先核对状态。
|
||||
</p>
|
||||
<!-- 以下是待处理镜头明细模块,直接展示编号并提供精确定位入口 -->
|
||||
<NScrollbar class="mt-3 max-h-36" aria-label="待核对镜头列表">
|
||||
<ul class="space-y-2">
|
||||
<li
|
||||
v-for="shot in impact.stale.value"
|
||||
:key="shot.shotId"
|
||||
class="flex flex-wrap items-center gap-x-4 gap-y-2"
|
||||
>
|
||||
<span class="font-medium"
|
||||
>第 {{ shot.episodeNo }} 集 · 剧情段落 {{ shot.beatNo }} / 镜头 {{ shot.shotNo }}</span
|
||||
>
|
||||
<NTag size="small" :bordered="false" type="warning">{{
|
||||
shot.inconsistent ? '状态待核对' : '首帧过期'
|
||||
}}</NTag>
|
||||
<NButton text size="small" data-impact-materials @click="selectImpactShot(shot.shotId)"
|
||||
>查看关联素材</NButton
|
||||
>
|
||||
<RouterLink
|
||||
:to="{
|
||||
path: `/projects/${encodeURIComponent(id)}/production`,
|
||||
query: { episodeNo: String(shot.episodeNo), shotId: shot.shotId }
|
||||
}"
|
||||
class="text-button"
|
||||
data-impact-shot-link
|
||||
>查看镜头 →</RouterLink
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</NScrollbar>
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="impact.query.error.value" type="warning" :show-icon="false" class="mt-3"
|
||||
>镜头影响检查失败,暂时无法确认有无过期首帧:{{ impact.query.error.value }}
|
||||
<NButton text size="small" @click="impact.query.refresh">重试检查</NButton></ContextNotice
|
||||
>
|
||||
<!-- 以下是图库筛选与来自镜头的定位操作 -->
|
||||
<div class="gallery-sticky-controls">
|
||||
<div class="form-image-filter-region">
|
||||
<div
|
||||
class="form-image-toolbar"
|
||||
:class="{
|
||||
'has-impact-picker': impactOptions.length || sourceShotId,
|
||||
'has-impact-actions': sourceShotId || targetFormId
|
||||
}"
|
||||
>
|
||||
<div
|
||||
v-if="impactOptions.length || sourceShotId"
|
||||
class="asset-impact-picker"
|
||||
role="group"
|
||||
aria-label="镜头定位与导航"
|
||||
>
|
||||
<NSelect
|
||||
:value="sourceShot?.shotId ?? null"
|
||||
:options="impactOptions"
|
||||
placeholder="选择待核对镜头,查看关联素材"
|
||||
clearable
|
||||
aria-label="选择关联镜头"
|
||||
class="asset-impact-select"
|
||||
@update:value="selectImpactShot"
|
||||
/>
|
||||
<div class="form-image-toolbar" :class="{ 'has-impact-picker': sourceShotId }">
|
||||
<div v-if="sourceShotId" class="asset-impact-picker" role="group" aria-label="镜头定位与导航">
|
||||
<RouterLink v-if="sourceLocation" :to="sourceLocation" custom v-slot="{ href, navigate }">
|
||||
<NButton
|
||||
tag="a"
|
||||
@@ -554,7 +461,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
v-if="sourceShotId || targetFormId"
|
||||
class="icon-button"
|
||||
aria-label="查看全部素材"
|
||||
title="查看全部素材(清除定位与筛选)"
|
||||
title="查看全部素材"
|
||||
@click="resetFilters"
|
||||
>
|
||||
<template #icon><LayoutGrid :size="16" /></template>
|
||||
@@ -665,17 +572,11 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
</div>
|
||||
<div v-if="showImpactDetails" class="asset-impact-context" aria-label="镜头与素材定位">
|
||||
<p v-if="sourceMissing" class="text-danger">来源镜头不存在或不属于当前项目,未读取其素材。</p>
|
||||
<p v-if="sourceCurrent" class="text-xs">
|
||||
当前检查:{{
|
||||
sourceShot?.primaryKeyframeId ? '该镜头主首帧未被标记为过期' : '该镜头暂无主首帧'
|
||||
}}。请以最新制作状态为准。
|
||||
</p>
|
||||
<p v-if="sourceShot?.inconsistent" class="text-xs text-danger">
|
||||
当前镜头的首帧与视频状态不一致。请先核对身份母版和当前素材,暂不建议重复生图。
|
||||
</p>
|
||||
<p v-if="targetUnlinked" class="text-xs text-danger">
|
||||
指定形态不在该镜头当前的有效引用列表中,关联可能已调整或主图缺失,请从下方关联素材重新核对。
|
||||
<p v-if="impact.query.error.value" class="text-xs text-danger">
|
||||
无法读取镜头。
|
||||
<NButton text size="small" @click="impact.query.refresh">重试</NButton>
|
||||
</p>
|
||||
<p v-if="targetUnlinked" class="text-xs text-danger">此形态已不在镜头的关联素材中。</p>
|
||||
<NScrollbar
|
||||
v-if="linkedReferences.length && !impact.references.error.value"
|
||||
:key="sourceShotId"
|
||||
@@ -723,16 +624,9 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||||
>{{ query.error.value }}<span v-if="forms.length"> 当前展示上次读取的数据。</span></ContextNotice
|
||||
><ContextNotice v-if="running" role="status" type="info" :show-icon="false" class="mt-4">
|
||||
数据库中有形态图片正在后台生成。对应形态会暂停重复提交,其它形态仍可继续生成;项目批量生图需等待当前任务完成。
|
||||
部分形态正在生成。任务完成后可再次批量生图。
|
||||
</ContextNotice>
|
||||
<p v-if="!query.data.value && query.loading.value" class="py-10 text-sm text-muted" role="status">
|
||||
正在读取形态和已有图片…
|
||||
</p>
|
||||
<div
|
||||
v-else-if="filtered.length"
|
||||
class="form-image-grid"
|
||||
:class="{ 'form-image-masonry': layout === 'masonry' }"
|
||||
>
|
||||
<div v-if="filtered.length" class="form-image-grid" :class="{ 'form-image-masonry': layout === 'masonry' }">
|
||||
<article
|
||||
v-for="form in filtered"
|
||||
v-masonry-card="layout === 'masonry'"
|
||||
@@ -746,7 +640,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
<AssetImage
|
||||
:src="primaryImage(form.images)?.imageUrl"
|
||||
:alt="`${form.subject.name} · ${form.name}`"
|
||||
:class="{ 'form-image-has-source': Boolean(primaryImage(form.images)?.imageUrl) }"
|
||||
:style="{ '--form-cover-ratio': formCoverRatio(form) }"
|
||||
:object-fit="layout === 'masonry' ? 'contain' : 'cover'"
|
||||
preview
|
||||
:empty-text="
|
||||
@@ -787,27 +681,6 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
>
|
||||
<span class="text-[10px] text-muted">{{ form.images.length }} 条记录</span>
|
||||
</div>
|
||||
<ContextNotice
|
||||
v-if="
|
||||
sourceShot?.primaryKeyframeStale &&
|
||||
impact.relatedForms.value.has(form.id) &&
|
||||
!impact.references.error.value
|
||||
"
|
||||
type="warning"
|
||||
:show-icon="false"
|
||||
class="mt-3 text-xs leading-6"
|
||||
>
|
||||
第 {{ sourceShot.episodeNo }} 集 · 剧情段落 {{ sourceShot.beatNo }} / 镜头
|
||||
{{ sourceShot.shotNo }} 的待处理首帧关联此素材。
|
||||
{{
|
||||
sourceShot.inconsistent
|
||||
? '首帧与视频检查结果不一致,请先核对,不要据此重复生图。'
|
||||
: '关联不等于本素材失效;核对形态主图与身份母版,确认无误后只需重建首帧。'
|
||||
}}
|
||||
<RouterLink v-if="sourceLocation" :to="sourceLocation" class="text-button mt-2"
|
||||
>返回该镜头处理 →</RouterLink
|
||||
>
|
||||
</ContextNotice>
|
||||
<p v-if="form.images[0]?.status === 'failed'" class="mt-2 line-clamp-2 text-xs text-danger">
|
||||
{{ userFacingText(form.images[0].error) }}
|
||||
</p>
|
||||
@@ -846,9 +719,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
v-else-if="query.data.value"
|
||||
:title="forms.length ? '没有匹配的形态' : '还没有正式形态'"
|
||||
:description="
|
||||
forms.length
|
||||
? '调整筛选条件后再查看。批量生图不受筛选影响。'
|
||||
: '先完成剧本拆解和主体形态持久化,再来生成参考图。'
|
||||
forms.length ? '调整筛选条件后再查看。批量生图不受筛选影响。' : '请先拆解剧本并保存主体形态。'
|
||||
"
|
||||
>
|
||||
<NButton v-if="forms.length" @click="resetFilters">清除筛选</NButton> </EmptyState
|
||||
@@ -877,14 +748,6 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
<style>
|
||||
/* 本组件专属布局与 Naive 内部结构覆盖。 */
|
||||
@reference "../../styles/styles.css";
|
||||
.form-image-grid {
|
||||
@apply grid;
|
||||
/* 排版和列数计算共用卡片最小宽度,手机缩窄后不保留桌面隐式列。 */
|
||||
--gallery-card-min-width: 260px;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(var(--gallery-card-min-width), 100%), 1fr));
|
||||
--gallery-gap: 12px;
|
||||
gap: var(--gallery-gap);
|
||||
}
|
||||
.form-image-card {
|
||||
@apply overflow-hidden;
|
||||
}
|
||||
@@ -916,111 +779,11 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
grid-row-end: span var(--form-image-row-span, 1);
|
||||
}
|
||||
.form-image-masonry .asset-image {
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
.form-image-masonry .asset-image.form-image-has-source {
|
||||
@apply aspect-auto;
|
||||
}
|
||||
.form-image-masonry .asset-image.form-image-has-source .n-image,
|
||||
.form-image-masonry .asset-image.form-image-has-source .n-image img {
|
||||
@apply h-auto;
|
||||
}
|
||||
.gallery-sticky-controls > .form-image-filter-region {
|
||||
@apply my-0;
|
||||
aspect-ratio: var(--form-cover-ratio, 1 / 1);
|
||||
}
|
||||
.gallery-workspace-page .workspace-scroll > .n-scrollbar-container {
|
||||
@apply [overflow-anchor:none];
|
||||
}
|
||||
.form-image-filter-region {
|
||||
@apply my-3 p-3;
|
||||
/* 外层使用浅灰分组,输入与下拉恢复为表面色,避免同色后失去控件边界。 */
|
||||
--app-field: var(--app-surface);
|
||||
--app-field-hover: var(--app-surface);
|
||||
background: var(--app-subtle);
|
||||
container-type: inline-size;
|
||||
}
|
||||
.form-image-toolbar {
|
||||
@apply grid grid-cols-[minmax(0,_1fr)] items-center gap-y-3 gap-x-4;
|
||||
}
|
||||
.form-image-toolbar.has-impact-picker {
|
||||
@apply grid-cols-[minmax(220px,_340px)_minmax(0,_1fr)];
|
||||
}
|
||||
.form-image-toolbar.has-impact-picker.has-impact-actions {
|
||||
@apply grid-cols-[minmax(260px,_420px)_minmax(0,_1fr)];
|
||||
}
|
||||
.asset-impact-picker {
|
||||
@apply flex items-center gap-2 min-w-0;
|
||||
}
|
||||
.asset-impact-picker .asset-impact-select {
|
||||
@apply flex-1;
|
||||
}
|
||||
.form-image-toolbar > * {
|
||||
@apply min-w-0;
|
||||
}
|
||||
.form-image-filters {
|
||||
@apply grid grid-cols-[minmax(200px,_360px)_152px_160px_auto] items-center gap-y-3 gap-x-4;
|
||||
}
|
||||
.form-image-filters > * {
|
||||
@apply min-w-0;
|
||||
}
|
||||
.filter-result-count {
|
||||
@apply justify-self-end text-muted text-xs whitespace-nowrap;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
@apply flex items-center justify-self-end gap-4;
|
||||
}
|
||||
.gallery-layout-switch {
|
||||
@apply flex items-center gap-2;
|
||||
}
|
||||
/* 未选中的排版按钮与图库操作按钮共用浅灰底,同时不覆盖选中布局的绿色状态。 */
|
||||
.gallery-layout-switch .layout-option-button:not(.layout-option-active),
|
||||
.gallery-layout-switch .gallery-action-button {
|
||||
background: var(--app-control-hover);
|
||||
}
|
||||
@container (max-width: 1200px) {
|
||||
.form-image-toolbar.has-impact-picker,
|
||||
.form-image-toolbar.has-impact-picker.has-impact-actions {
|
||||
@apply grid-cols-[minmax(0,_1fr)];
|
||||
}
|
||||
}
|
||||
@container (max-width: 900px) {
|
||||
.form-image-filters {
|
||||
@apply grid-cols-[minmax(0,_1fr)_152px];
|
||||
}
|
||||
.status-filter {
|
||||
@apply col-start-1 row-start-2;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
@apply col-start-2 row-start-2;
|
||||
}
|
||||
}
|
||||
@container (max-width: 460px) {
|
||||
.form-image-filters {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
/* 移动端固定为两行:搜索给类型选择让位,状态可收缩以优先保留四个完整操作按钮。 */
|
||||
.search-filter {
|
||||
flex: 1 1 calc(100% - 130px);
|
||||
min-width: 0;
|
||||
}
|
||||
.module-filter {
|
||||
flex: 0 0 120px;
|
||||
}
|
||||
.status-filter {
|
||||
flex: 0 1 110px;
|
||||
min-width: 90px;
|
||||
}
|
||||
.form-image-display-controls {
|
||||
flex: 1 0 152px;
|
||||
width: auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.filter-result-count {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
.asset-impact-context {
|
||||
@apply flex flex-col gap-2.5 py-[5px] px-4 bg-(--app-subtle) m-0 min-w-0;
|
||||
}
|
||||
@@ -1033,9 +796,6 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
|
||||
.asset-impact-links > * {
|
||||
@apply shrink-0;
|
||||
}
|
||||
.asset-impact-select {
|
||||
@apply min-w-0 w-full;
|
||||
}
|
||||
.form-image-card-focused {
|
||||
@apply shadow-[inset_3px_0_0_var(--app-accent-text)];
|
||||
}
|
||||
|
||||
@@ -34,7 +34,8 @@ const formModel = computed(() => ({ concurrency: concurrency.value }))
|
||||
const rules = { concurrency: integerRule('提示词并发') }
|
||||
</script>
|
||||
<template>
|
||||
<section class="panel mt-5 p-5" aria-label="形态提示词批量管理">
|
||||
<!-- 以下是与相邻设置对齐、用中性背景区分的提示词批处理模块。 -->
|
||||
<section class="workspace-panel" aria-label="形态提示词批量管理">
|
||||
<h3 class="font-semibold">形态生图提示词</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
正式提示词 {{ complete }} /
|
||||
|
||||
@@ -205,7 +205,7 @@ function episodeLabel(id: string) {
|
||||
</div>
|
||||
<p v-if="!query.data.value.layouts.length" class="text-muted">尚无共享空间布局记录。</p>
|
||||
<p v-else-if="query.data.value.layouts.length > 1" class="text-muted">
|
||||
此场景关联多个布局,请在生成前核对唯一适用的空间范围。
|
||||
此场景有多个布局,请先选定适用范围。
|
||||
</p>
|
||||
<section v-for="layout in query.data.value.layouts" :key="layout.id" class="space-y-3">
|
||||
<h3 class="font-medium">{{ layout.name }}</h3>
|
||||
|
||||
@@ -288,7 +288,7 @@ async function confirmAction() {
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
:title="`${form?.subject.name || ''} · ${form?.name || '形态图片'}`"
|
||||
description="主参考图会供后续分镜使用。切换主图不会重新生成已有视频提示词。"
|
||||
description="切换主图后,请复核已有视频提示词。"
|
||||
:busy="!!pending"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
@@ -456,13 +456,13 @@ async function confirmAction() {
|
||||
actionError
|
||||
}}</ContextNotice>
|
||||
<ContextNotice v-if="selected.qualityPassed === false" type="error" :show-icon="false" class="mt-4">
|
||||
<p>这张图片未通过最近一次质量审核,候选已保留。可明确重新审核或选择其它候选,原主图不会被替换。</p>
|
||||
<p>此图未通过审核,原主图已保留。可复审或选择其他候选。</p>
|
||||
<p v-for="(issue, index) in selected.qualityIssues" :key="index" class="mt-2">
|
||||
{{ userFacingText(issue.description) }}
|
||||
</p>
|
||||
</ContextNotice>
|
||||
<p v-else-if="selected.status === 'completed'" class="mt-3 text-xs leading-6 text-muted">
|
||||
复用母版与单独审核形态是不同记录。最近审核记录不保证当前来源仍有效;来源或母版变化后需明确重新审核,切换主图时会再次检查。
|
||||
来源或母版变化后,请重新审核再切换主图。
|
||||
</p>
|
||||
<ImageValidationPanel
|
||||
v-if="validation?.imageId === selected.id"
|
||||
@@ -513,9 +513,7 @@ async function confirmAction() {
|
||||
>
|
||||
</ContextNotice>
|
||||
<!-- 以下是失效复用历史的说明模块 -->
|
||||
<p v-if="reusedImageUnavailable" class="mt-3 text-xs text-muted">
|
||||
此图片复用的身份母版已变更,或当前形态不再满足复用条件,仅保留作历史查看。
|
||||
</p>
|
||||
<p v-if="reusedImageUnavailable" class="mt-3 text-xs text-muted">此图已无法继续复用,仅供历史查看。</p>
|
||||
<ContextNotice v-if="confirming" type="info" :show-icon="false" class="mt-4">
|
||||
{{
|
||||
confirming === 'quality'
|
||||
|
||||
@@ -95,11 +95,7 @@ const omitted = computed(
|
||||
<template>
|
||||
<!-- 以下是免费实际输入预览模块,参数调整后必须重新读取 -->
|
||||
<section class="min-w-0 space-y-4" aria-label="本次生成预览">
|
||||
<WorkspaceSectionHeading
|
||||
v-if="!displayOnly"
|
||||
title="本次生成预览"
|
||||
description="只检查已有描述、规格和参考图,不生成图片,也不自动补齐资料。"
|
||||
/>
|
||||
<WorkspaceSectionHeading v-if="!displayOnly" title="本次生成预览" description="免费查看提示词和参考图。" />
|
||||
<NButton
|
||||
v-if="!displayOnly"
|
||||
class="workspace-action-button"
|
||||
@@ -132,18 +128,15 @@ const omitted = computed(
|
||||
/>
|
||||
<span v-else class="p-3 text-muted">{{
|
||||
item.evidence?.availability === 'changed'
|
||||
? '原件字节已变化'
|
||||
? '原图已变化'
|
||||
: item.evidence
|
||||
? '原件不可用,可刷新详情'
|
||||
? '原图不可用'
|
||||
: '图片无法预览'
|
||||
}}</span>
|
||||
</div>
|
||||
<p class="mt-1 font-medium">图 {{ item.order }}</p>
|
||||
<p v-if="item.evidence" class="wrap-anywhere text-muted">
|
||||
{{ item.evidence.width }} × {{ item.evidence.height }} · {{ item.evidence.mimeType }} ·
|
||||
{{ item.evidence.byteLength }} 字节 <br />文件指纹:{{ item.evidence.sha256 }}<br />像素指纹:{{
|
||||
item.evidence.pixelFingerprint
|
||||
}}
|
||||
<p v-if="item.evidence" class="text-muted">
|
||||
{{ item.evidence.width }} × {{ item.evidence.height }}
|
||||
</p>
|
||||
<p v-for="(binding, index) in item.bindings" :key="index" class="wrap-anywhere text-muted">
|
||||
{{ roles[binding.role] ?? '图片参考'
|
||||
@@ -151,9 +144,6 @@ const omitted = computed(
|
||||
<template v-if="'viewDescription' in binding && binding.viewDescription">
|
||||
· {{ binding.viewDescription }}</template
|
||||
>
|
||||
<template v-if="'spatialLayoutVersion' in binding && binding.spatialLayoutVersion">
|
||||
· 几何版本 {{ binding.spatialLayoutVersion.slice(0, 12) }}</template
|
||||
>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -86,7 +86,7 @@ async function prepare() {
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="图片准备检查"
|
||||
description="检查免费。需要补充资料时,可逐项确认文字模型费用后准备,不会自动生图。"
|
||||
description="检查免费。补充文字需逐项确认费用。"
|
||||
:busy="pending"
|
||||
>
|
||||
<div class="space-y-6">
|
||||
@@ -110,7 +110,7 @@ async function prepare() {
|
||||
/>
|
||||
</div>
|
||||
<p v-if="!plan.propStructureSpecs && !plan.stableIdentityAnchors" class="text-sm text-muted">
|
||||
当前服务尚未提供规格与母版依赖明细,请核对服务版本后刷新。
|
||||
暂无法查看规格与母版明细。
|
||||
</p>
|
||||
</template>
|
||||
<ContextNotice v-else-if="query.data.value" type="warning" :show-icon="false">{{
|
||||
|
||||
@@ -36,9 +36,7 @@ const checkLabels = { passed: '通过', failed: '未通过', needs_review: '待
|
||||
<p class="font-medium">{{ passed ? '本次质量审核通过' : '本次质量审核未通过或仍待复核' }}</p>
|
||||
<p class="mt-1 whitespace-pre-wrap wrap-anywhere">{{ userFacingText(result.summary) }}</p>
|
||||
</ContextNotice>
|
||||
<p class="text-xs leading-6 text-muted">
|
||||
审核只保存质量证据,不会自动采纳图片。资料或图片变化后需重新核对;最终可用性以当前制作准备检查为准。
|
||||
</p>
|
||||
<p class="text-xs leading-6 text-muted">审核后需手动选图。资料或图片变化后请重新检查。</p>
|
||||
<ul v-if="result.issues.length" class="space-y-2 text-xs leading-6">
|
||||
<li v-for="(issue, index) in result.issues" :key="index" class="whitespace-pre-wrap wrap-anywhere">
|
||||
<NTag
|
||||
|
||||
@@ -3,32 +3,22 @@ import { useQuery } from '../../composables/useQuery'
|
||||
import { productionApi } from '../production/api'
|
||||
import { useShotReferences } from '../production/useShotReferences'
|
||||
|
||||
/** 镜头影响检查与素材查询独立;检查失败不把素材误判为正常或阻断独立的素材操作。 */
|
||||
/**
|
||||
* 只在从镜头进入图库时核对所属项目,再读取关联素材。
|
||||
* @param projectId 当前项目编号
|
||||
* @param sourceShotId 路由中的来源镜头
|
||||
* @returns 关联镜头、素材与查询状态
|
||||
*/
|
||||
export function useKeyframeImpact(projectId: Ref<string>, sourceShotId: Ref<string>) {
|
||||
const query = useQuery(projectId, async (id, signal) => {
|
||||
/** 普通浏览图库无需检查全项目的镜头。 */
|
||||
const projectForLookup = computed(() => (sourceShotId.value ? projectId.value : ''))
|
||||
/** 只读取可定位镜头的就绪列表。 */
|
||||
const query = useQuery(projectForLookup, async (id, signal) => {
|
||||
if (!id) return null
|
||||
const [keyframes, videos] = await Promise.all([
|
||||
productionApi.keyframeReadiness(id, false, signal),
|
||||
productionApi.videoReadiness(id, false, signal)
|
||||
])
|
||||
if (!keyframes || !Array.isArray(keyframes.items) || !videos || !Array.isArray(videos.items))
|
||||
throw new Error('主首帧影响检查未返回镜头列表。')
|
||||
const byShot = new Map(videos.items.map(item => [item.shotId, item]))
|
||||
if (byShot.size !== keyframes.items.length || keyframes.items.some(item => !byShot.has(item.shotId)))
|
||||
throw new Error('首帧与视频检查的镜头列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
return {
|
||||
...keyframes,
|
||||
items: keyframes.items.map(item => {
|
||||
const issues = byShot.get(item.shotId)?.issues.filter(issue => issue.code === 'stale_keyframe') ?? []
|
||||
return {
|
||||
...item,
|
||||
primaryKeyframeStale: !!item.primaryKeyframeStale || issues.length > 0,
|
||||
inconsistent: item.primaryKeyframeStale === false && issues.length > 0
|
||||
}
|
||||
})
|
||||
}
|
||||
const result = await productionApi.keyframeReadiness(id, false, signal)
|
||||
if (!Array.isArray(result?.items)) throw new Error('无法读取项目镜头列表。')
|
||||
return result
|
||||
})
|
||||
const stale = computed(() => query.data.value?.items.filter(item => item.primaryKeyframeStale) ?? [])
|
||||
// 不根据 URL 中的任意镜头 ID 发请求,必须属于当前项目的就绪列表。
|
||||
const source = computed(() => query.data.value?.items.find(item => item.shotId === sourceShotId.value))
|
||||
const references = useShotReferences(
|
||||
@@ -38,5 +28,5 @@ export function useKeyframeImpact(projectId: Ref<string>, sourceShotId: Ref<stri
|
||||
const relatedForms = computed(
|
||||
() => new Set(references.data.value?.references.map(item => item.subjectFormId) ?? [])
|
||||
)
|
||||
return { query, stale, source, references, relatedForms }
|
||||
return { query, source, references, relatedForms }
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { usePolling } from '../../composables/usePolling'
|
||||
import { ApiError } from '../../lib/http'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { batchResultNotice, getOperation, runOperation } from '../workflows/operations'
|
||||
import { workflowCheckpoints } from '../workflows/selectors'
|
||||
import { hasRunningWorkflow } from '../workflows/selectors'
|
||||
import { useProjectGenerationRevision } from '../generation-config/context'
|
||||
import { generationConfigApi } from '../generation-config/api'
|
||||
import { subjectImagesApi } from './api'
|
||||
@@ -74,15 +74,13 @@ export function useSubjectImages() {
|
||||
const operation = computed(() => getOperation(id.value))
|
||||
const session = computed(() => getImageSession(id.value))
|
||||
const running = computed(() => forms.value.some(form => hasRunningImages(form.images)))
|
||||
const breakdownRunning = computed(
|
||||
() =>
|
||||
workflowCheckpoints(context.checkpoints.value, 'breakdown').at(-1)?.state.workflowExecution?.status ===
|
||||
'running'
|
||||
)
|
||||
/** 摘要只用于检查拆解是否仍在运行。 */
|
||||
const breakdownRunning = computed(() => hasRunningWorkflow(context.summaryQuery.data.value ?? [], 'breakdown'))
|
||||
const blocked = computed(
|
||||
() =>
|
||||
operation.value.pending ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
!!query.error.value ||
|
||||
query.data.value === null ||
|
||||
!!generationModelsQuery.error.value ||
|
||||
|
||||
@@ -145,7 +145,7 @@ function removeImage(image: VisualStyleImage) {
|
||||
:label="style ? 'AI 重新生成风格' : 'AI 生成风格'"
|
||||
:disabled="disabled || !!style?.isLocked || dirty"
|
||||
acknowledgement
|
||||
description="调用文本模型生成整体及分类风格。重新生成会覆盖已保存的文本与硬约束;旧身份、旧图片和已有提示词不会自动更新。"
|
||||
description="重新生成会覆盖风格和限制,保留已有图片、身份和提示词。"
|
||||
@confirm="generate"
|
||||
/>
|
||||
</div>
|
||||
@@ -156,15 +156,12 @@ function removeImage(image: VisualStyleImage) {
|
||||
>{{ query.error.value }} 当前内容读取失败;已有内容不会被覆盖。
|
||||
<NButton text class="ml-3" :loading="query.loading.value" @click="query.refresh">重试读取</NButton>
|
||||
</ContextNotice>
|
||||
<p v-if="dirty" class="mb-4 text-xs text-muted">
|
||||
有未保存修改,AI 重生成暂不可用。刷新不会覆盖编辑内容;离开页面不会自动保存。
|
||||
</p>
|
||||
<p v-if="dirty" class="mb-4 text-xs text-muted">请先保存修改,再用 AI 重生成。</p>
|
||||
<!-- 以下是始终显示的风格生成规则模块 -->
|
||||
<section v-if="query.data.value" class="panel workspace-panel visual-style-rules">
|
||||
<h3 class="font-medium">风格生成规则</h3>
|
||||
<p class="mt-3 text-xs leading-6 text-muted">
|
||||
AI
|
||||
生成时遵循剧本与角色已明确的外观和人物背景;未明确时保持地域与族裔中性,不从姓名或视觉媒介推断。修改风格只影响之后的生成,旧资产不会自动更新。
|
||||
AI 按剧本设定生成,未明确时保持地域与族裔中性。新风格仅用于之后的生成。
|
||||
</p>
|
||||
</section>
|
||||
<!-- 以下是风格编辑与始终展开的分类补充模块 -->
|
||||
|
||||
@@ -168,9 +168,7 @@ function save() {
|
||||
class="flex items-start gap-2 text-sm"
|
||||
>确认并锁定风格,阻止后续 AI 自动覆盖</NCheckbox
|
||||
>
|
||||
<p class="text-xs leading-6 text-muted">
|
||||
锁定后仍可人工编辑并保存。取消勾选并保存后,才能再次使用 AI 重生成。
|
||||
</p>
|
||||
<p class="text-xs leading-6 text-muted">锁定后可手动编辑,解锁并保存后可用 AI 重生成。</p>
|
||||
<div class="page-form-actions">
|
||||
<NButton :disabled="disabled" type="primary" attr-type="submit" :loading="saving">
|
||||
保存视觉风格
|
||||
|
||||
@@ -155,9 +155,7 @@ onBeforeUnmount(() => assetController?.abort())
|
||||
<h3 class="font-medium">
|
||||
风格参考图 <span class="ml-2 text-xs text-muted">{{ images.length }} 张</span>
|
||||
</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
添加已有图片作为风格参考。参与生成的参考图用于后续主体身份与形态生图,已有图片不会自动更新。
|
||||
</p>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">启用的参考图用于后续身份和形态生图。</p>
|
||||
<div class="mt-4 flex flex-wrap items-center gap-3">
|
||||
<NButton :disabled="disabled || !hasStyle" @click="openAdd('asset')">从资产库添加</NButton>
|
||||
<NButton :disabled="disabled || !hasStyle" @click="openAdd('link')">通过链接添加</NButton>
|
||||
@@ -289,9 +287,7 @@ onBeforeUnmount(() => assetController?.abort())
|
||||
<!-- 以下是参与生成开关与关联说明模块 -->
|
||||
<div>
|
||||
<NCheckbox v-model:checked="form.enabled">参与后续生成</NCheckbox>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
关闭后仍会保存参考图,后续生成不会使用它;已有图片不会自动更新。
|
||||
</p>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">关闭后保留参考图,生成时跳过。</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</AppForm>
|
||||
|
||||
@@ -49,9 +49,7 @@ const history = computed(() => workflowCheckpoints(props.checkpoints, props.work
|
||||
>
|
||||
</NTimelineItem>
|
||||
</NTimeline>
|
||||
<p class="mt-5 pt-4 text-[11px] leading-5 text-muted">
|
||||
记录在节点或批次结束后更新,长时间无新记录不一定意味着任务失败。
|
||||
</p>
|
||||
<p class="mt-5 pt-4 text-[11px] leading-5 text-muted">每一步或每批完成后更新记录。</p>
|
||||
</NScrollbar>
|
||||
<WorkflowDiagnosticsDialog
|
||||
v-if="projectId"
|
||||
|
||||
@@ -69,14 +69,9 @@ function exportReport() {
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
title="制作任务记录"
|
||||
description="查看这个项目的任务记录、耗时和处理顺序,不会启动或恢复任务。"
|
||||
wide
|
||||
>
|
||||
<AppDialog v-model:open="open" title="制作任务记录" description="查看任务记录和耗时。" wide>
|
||||
<ContextNotice type="info" :show-icon="false" class="mt-4 text-xs"
|
||||
>这里统计的是已保存的处理记录,累计耗时可能与实际等待时间不同。步骤结束也不代表图片或视频已生成,请以素材页的实际结果为准。</ContextNotice
|
||||
>累计耗时按保存记录统计,成果请到素材页查看。</ContextNotice
|
||||
>
|
||||
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
|
||||
>{{ query.error.value }},当前保留上次数据。</ContextNotice
|
||||
@@ -159,7 +154,7 @@ function exportReport() {
|
||||
<EmptyState
|
||||
v-if="!query.loading.value && !nodes.length"
|
||||
title="暂无匹配的运行记录"
|
||||
description="可清空筛选后重试;尚未保存进度的任务不会出现在时间线中。"
|
||||
description="可清空筛选。仅显示已保存的记录。"
|
||||
/>
|
||||
</AppDialog>
|
||||
</template>
|
||||
|
||||
@@ -484,8 +484,9 @@ function isInputMode(value: unknown, inputMode: string): boolean {
|
||||
<ContextNotice
|
||||
v-else-if="execution.status === 'failed' && showStatusHint && !historical"
|
||||
type="error"
|
||||
:show-icon="embedded"
|
||||
:emphasized="embedded"
|
||||
:show-icon="embedded || diagnosisRecovery || keyframeRecovery"
|
||||
:emphasized="embedded || diagnosisRecovery || keyframeRecovery"
|
||||
:critical="diagnosisRecovery || keyframeRecovery"
|
||||
:title="embedded ? '任务未完成' : undefined"
|
||||
class="mt-3"
|
||||
>
|
||||
@@ -506,9 +507,7 @@ function isInputMode(value: unknown, inputMode: string): boolean {
|
||||
共 {{ result.episodeCount ?? '待确认' }} 集 · 已保存 {{ result.completedEpisodes ?? '待确认' }} 集 ·
|
||||
跳过 {{ result.skippedEpisodes ?? '待确认' }} 集 · 失败 {{ result.failedEpisodes ?? '待确认' }} 集
|
||||
</p>
|
||||
<p v-if="derivedNeedsReview" class="text-danger">
|
||||
已成功结果会保留;请先核对失败剧集和仍过期的设计,不会自动重新提交生成。
|
||||
</p>
|
||||
<p v-if="derivedNeedsReview" class="text-danger">成功结果已保留,请核对失败剧集和过期设计。</p>
|
||||
<ul v-if="derivedEpisodes.length" class="space-y-2">
|
||||
<li v-for="item in derivedEpisodes" :key="item.episodeNo" class="wrap-anywhere">
|
||||
第 {{ item.episodeNo }} 集 ·
|
||||
@@ -544,9 +543,7 @@ function isInputMode(value: unknown, inputMode: string): boolean {
|
||||
</p>
|
||||
</div>
|
||||
<!-- 以下是首帧工作流中断后的人工核查说明 -->
|
||||
<p v-if="keyframeRecovery" class="mt-3 text-xs leading-6">
|
||||
首帧任务中断,费用与结果待核对。请先查看已保存候选并核对原请求,再决定后续操作。
|
||||
</p>
|
||||
<p v-if="keyframeRecovery" class="mt-3 text-xs leading-6">首帧任务已中断,请先核对候选和费用。</p>
|
||||
<!-- 以下是非拆解任务的 Naive 详情折叠模块 -->
|
||||
<NCollapse v-if="!breakdownTask && !embedded" class="mt-3 text-xs text-muted">
|
||||
<NCollapseItem name="task-details" title="任务详情">
|
||||
@@ -595,7 +592,4 @@ function isInputMode(value: unknown, inputMode: string): boolean {
|
||||
.breakdown-execution-card[data-task-state='success'] {
|
||||
background: var(--app-success-soft);
|
||||
}
|
||||
.breakdown-execution-card[data-task-state='error'] {
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { BreakdownState } from '../breakdown/types'
|
||||
import type { Checkpoint } from './types'
|
||||
import type { Checkpoint, CheckpointSummary } from './types'
|
||||
import { normalizeBreakdownState, selectBreakdownSource } from '../breakdown/quality'
|
||||
|
||||
/** 按工作流隔离并排序,后端数组顺序变化不会影响恢复判断。 */
|
||||
@@ -55,9 +55,15 @@ export function recoveryOptions(checkpoints: Checkpoint[]) {
|
||||
return { retry, shots, storyboard }
|
||||
}
|
||||
|
||||
/** 项目公开详情不含内部任务;按每条工作流的最新 checkpoint 检查活动执行。 */
|
||||
export function hasRunningWorkflow(checkpoints: Checkpoint[]): boolean {
|
||||
return [...new Set(checkpoints.map(item => item.workflowName))].some(
|
||||
name => workflowCheckpoints(checkpoints, name).at(-1)?.state.workflowExecution?.status === 'running'
|
||||
/**
|
||||
* 摘要已由服务端按工作流选取最新记录,沿用原先只判定 running 的互斥规则。
|
||||
* @param summaries 项目最新的工作流摘要
|
||||
* @param workflowName 可选的工作流范围
|
||||
* @returns 当前范围内是否有运行中的工作流
|
||||
*/
|
||||
export function hasRunningWorkflow(summaries: CheckpointSummary[], workflowName?: string): boolean {
|
||||
return summaries.some(
|
||||
item =>
|
||||
(!workflowName || item.workflowName === workflowName) && item.state.workflowExecution?.status === 'running'
|
||||
)
|
||||
}
|
||||
@@ -11,3 +11,16 @@ export interface Checkpoint {
|
||||
metadata?: { nodeName?: string; nodeDurationMs?: number; [key: string]: unknown } | null
|
||||
state: DramaState & BreakdownState
|
||||
}
|
||||
|
||||
/** 导航和操作门禁使用的最新状态,不包含工作流正文。 */
|
||||
export interface CheckpointSummary {
|
||||
/** 保存记录编号。 */ checkpointId: string
|
||||
/** 所属工作流。 */ workflowName: string
|
||||
/** 创建时间。 */ createdAt: string
|
||||
/** 服务端最近更新时间。 */ updatedAt: string
|
||||
/** 摘要只提供可选的执行状态。 */
|
||||
state: {
|
||||
/** 未关联执行时不返回该字段。 */
|
||||
workflowExecution?: { /** 保存时的执行状态。 */ status: string }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { computed } from 'vue'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { getOperation } from './operations'
|
||||
import { workflowCheckpoints } from './selectors'
|
||||
import { hasRunningWorkflow } from './selectors'
|
||||
|
||||
/** 资产编辑要求剧本正式完成,并沿用项目级互斥,拆解运行期间不修改其下游资产。 */
|
||||
export function useProjectMutationGuard() {
|
||||
@@ -12,10 +12,10 @@ export function useProjectMutationGuard() {
|
||||
() =>
|
||||
!projectId.value ||
|
||||
!!context.error.value ||
|
||||
context.summaryBlocked.value ||
|
||||
operation.value.pending ||
|
||||
context.project.value?.status !== 'completed' ||
|
||||
workflowCheckpoints(context.checkpoints.value, 'breakdown').at(-1)?.state.workflowExecution?.status ===
|
||||
'running'
|
||||
hasRunningWorkflow(context.summaryQuery.data.value ?? [], 'breakdown')
|
||||
)
|
||||
return { projectId, operation, blocked }
|
||||
}
|
||||
@@ -72,6 +72,10 @@ body {
|
||||
}
|
||||
/* 外壳固定品牌与底部设置;只有菜单自身使用 NScrollbar 滚动。 */
|
||||
/* Naive 菜单背景默认左右内缩 8px;只铺满导航行,不改图标与文字缩进。 */
|
||||
/* 所有工作区和弹层的加载骨架统一静态显示。 */
|
||||
.n-skeleton {
|
||||
animation: none !important;
|
||||
}
|
||||
/* 按钮保持直角,单图标按钮以 Naive 当前尺寸为边长,加载时也不改变宽度。 */
|
||||
.n-button {
|
||||
border-radius: 0;
|
||||
@@ -220,9 +224,10 @@ body {
|
||||
.workspace-panel + .workspace-panel {
|
||||
margin-top: 20px;
|
||||
}
|
||||
/* 错误详情、问题摘要和定位目标共用相同的问题底色。 */
|
||||
/* 常规问题使用中性底色,以细线区分问题区域。 */
|
||||
.problem-surface {
|
||||
background: var(--app-danger-soft);
|
||||
background: var(--app-subtle);
|
||||
box-shadow: inset 2px 0 color-mix(in srgb, var(--app-danger) 45%, transparent);
|
||||
}
|
||||
/* 弹窗主流程优先平铺并与标题共用水平基线;仅靠垂直间距区分区块。 */
|
||||
.dialog-flat-stack > .workspace-panel,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref, type Ref } from 'vue'
|
||||
import { vi } from 'vitest'
|
||||
import type { ProjectDetail, ProjectStageReadiness } from '../features/projects/types'
|
||||
import type { Checkpoint } from '../features/workflows/types'
|
||||
import type { useProjectData } from '../features/projects/context'
|
||||
import type { Checkpoint, CheckpointSummary } from '../features/workflows/types'
|
||||
import type { CheckpointWorkflow, useProjectData } from '../features/projects/context'
|
||||
|
||||
/** 模拟正式项目上下文,测试不连接真实模型或数据库。 */
|
||||
export function testProjectContext(id = 'capability-test'): ReturnType<typeof useProjectData> {
|
||||
export function testProjectContext(id = 'capability-test') {
|
||||
const project: ProjectDetail = {
|
||||
id,
|
||||
title: '测试剧本',
|
||||
@@ -33,16 +33,68 @@ export function testProjectContext(id = 'capability-test'): ReturnType<typeof us
|
||||
subjectAssets: { ready: true, reason: null },
|
||||
storyboard: { ready: true, reason: null }
|
||||
}
|
||||
const data = ref({ project, checkpoints: [] as Checkpoint[], stageReadiness })
|
||||
return {
|
||||
data,
|
||||
project: computed(() => data.value.project),
|
||||
checkpoints: computed(() => data.value.checkpoints),
|
||||
stageReadiness: computed(() => data.value.stageReadiness),
|
||||
loading: ref(false),
|
||||
error: ref(''),
|
||||
updatedAt: ref(''),
|
||||
refresh: vi.fn<() => Promise<void>>().mockResolvedValue(),
|
||||
refreshStageReadiness: vi.fn<() => Promise<void>>().mockResolvedValue()
|
||||
}
|
||||
return testProjectContextFrom(ref({ project, checkpoints: [] as Checkpoint[], stageReadiness }))
|
||||
}
|
||||
|
||||
/**
|
||||
* 按正式契约从历史生成每个工作流的最新摘要。
|
||||
* @param records 测试历史记录
|
||||
* @returns 不含正文的工作流摘要
|
||||
*/
|
||||
export function testCheckpointSummaries(records: Checkpoint[]): CheckpointSummary[] {
|
||||
const latest = new Map<string, Checkpoint>()
|
||||
for (const record of records.toSorted((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt)))
|
||||
latest.set(record.workflowName, record)
|
||||
return Array.from(latest.values(), record => ({
|
||||
checkpointId: record.checkpointId,
|
||||
workflowName: record.workflowName,
|
||||
createdAt: record.createdAt,
|
||||
updatedAt: record.updatedAt ?? record.createdAt,
|
||||
state: record.state.workflowExecution
|
||||
? { workflowExecution: { status: record.state.workflowExecution.status } }
|
||||
: {}
|
||||
}))
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用已加载的测试项目构造布局上下文。
|
||||
* @param data 测试中可修改的正式项目和保存记录
|
||||
* @returns 带查询状态的页面上下文
|
||||
*/
|
||||
export function testProjectContextFrom(
|
||||
data: Ref<{
|
||||
project: ProjectDetail
|
||||
checkpoints: Checkpoint[]
|
||||
stageReadiness: ProjectStageReadiness
|
||||
}>
|
||||
) {
|
||||
const refresh = vi.fn<() => Promise<void>>().mockResolvedValue()
|
||||
const refreshProject = vi.fn<() => Promise<void>>().mockResolvedValue()
|
||||
const refreshStageReadiness = vi.fn<() => Promise<void>>().mockResolvedValue()
|
||||
const project = computed(() => data.value.project)
|
||||
const stageReadiness = computed(() => data.value.stageReadiness)
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const queryState = { loading, error, updatedAt: ref(''), refresh }
|
||||
const checkpoints = computed(() => data.value.checkpoints)
|
||||
const summaryQuery = { ...queryState, data: computed(() => testCheckpointSummaries(checkpoints.value)) }
|
||||
const context = {
|
||||
project,
|
||||
projectQuery: { ...queryState, data: project },
|
||||
stageReadiness,
|
||||
readinessQuery: { ...queryState, data: stageReadiness },
|
||||
summaryQuery,
|
||||
summaryBlocked: computed(() => loading.value || !!error.value),
|
||||
loading: computed(() => loading.value),
|
||||
error: computed(() => error.value),
|
||||
refresh,
|
||||
refreshProject,
|
||||
refreshStageReadiness,
|
||||
useWorkflowCheckpoints: (workflow: CheckpointWorkflow) => ({
|
||||
...queryState,
|
||||
data: computed(() => checkpoints.value.filter(item => item.workflowName === workflow))
|
||||
}),
|
||||
refreshWorkflow: vi.fn<() => Promise<void>>(() => refresh())
|
||||
} satisfies ReturnType<typeof useProjectData>
|
||||
return { ...context, data, checkpoints, loading, error }
|
||||
}
|
||||
@@ -199,10 +199,8 @@ describe('全站平面主题', () => {
|
||||
expect(css).toMatch(
|
||||
/\.form-image-masonry > \.form-image-card\s*\{[^}]*grid-column-start:\s*var\(--form-image-column,\s*auto\);[^}]*grid-row-start:\s*var\(--form-image-row-start,\s*auto\);[^}]*grid-row-end:\s*span var\(--form-image-row-span,\s*1\);/
|
||||
)
|
||||
expect(css).toMatch(/\.form-image-masonry \.asset-image\s*\{[^}]*aspect-ratio:\s*1 \/ 1;/)
|
||||
expect(css).toMatch(/\.form-image-masonry \.asset-image\.form-image-has-source\s*\{[^}]*aspect-ratio:\s*auto;/)
|
||||
expect(css).toMatch(
|
||||
/\.form-image-masonry \.asset-image\.form-image-has-source \.n-image,\s*\.form-image-masonry \.asset-image\.form-image-has-source \.n-image img\s*\{[^}]*height:\s*auto;/
|
||||
/\.form-image-masonry \.asset-image\s*\{[^}]*aspect-ratio:\s*var\(--form-cover-ratio, 1 \/ 1\);/
|
||||
)
|
||||
})
|
||||
|
||||
@@ -222,10 +220,10 @@ describe('全站平面主题', () => {
|
||||
)
|
||||
expect(css).toMatch(/\.form-image-toolbar\s*\{[^}]*align-items:\s*center;[^}]*gap:\s*12px 16px;/)
|
||||
expect(css).toMatch(
|
||||
/\.form-image-toolbar\.has-impact-picker\s*\{[^}]*grid-template-columns:\s*minmax\(220px, 340px\) minmax\(0, 1fr\);/
|
||||
/\.form-image-toolbar\.has-impact-picker\s*\{[^}]*grid-template-columns:\s*auto minmax\(0, 1fr\);/
|
||||
)
|
||||
expect(css).toMatch(
|
||||
/@container \(max-width: 1200px\)\s*\{\s*\.form-image-toolbar\.has-impact-picker,\s*\.form-image-toolbar\.has-impact-picker\.has-impact-actions\s*\{[^}]*grid-template-columns:\s*minmax\(0, 1fr\);/
|
||||
/@container \(max-width: 1200px\)\s*\{\s*\.form-image-toolbar\.has-impact-picker\s*\{[^}]*grid-template-columns:\s*minmax\(0, 1fr\);/
|
||||
)
|
||||
expect(css).toMatch(/\.asset-impact-picker\s*\{[^}]*align-items:\s*center;[^}]*gap:\s*8px;/)
|
||||
expect(css).toMatch(/\.asset-impact-context\s*\{[^}]*gap:\s*10px/)
|
||||
|
||||
@@ -459,7 +459,7 @@ describe('管理后台组件边界', () => {
|
||||
characters: [],
|
||||
world: null
|
||||
})
|
||||
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([])
|
||||
vi.spyOn(projectsApi, 'checkpointSummaries').mockResolvedValue([])
|
||||
vi.spyOn(projectsApi, 'stageReadiness').mockResolvedValue({
|
||||
projectId: 'navigation-test',
|
||||
script: { ready: true, reason: null },
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { testProjectContextFrom } from '@/testing/project-context'
|
||||
import { policyReceipt } from '../../fixtures/quality-policy'
|
||||
import { computed, ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { DOMWrapper, flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { NButton, NSelect, NSpin } from 'naive-ui'
|
||||
import { NButton, NSelect, NSpin, type MessageApi } from 'naive-ui'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import BreakdownPage from '@/features/breakdown/BreakdownPage.vue'
|
||||
import { projectContextKey, type useProjectData } from '@/features/projects/context'
|
||||
import { actionMessageKey } from '@/components/ui/useActionMessage'
|
||||
import { projectContextKey } from '@/features/projects/context'
|
||||
import type { ProjectDetail } from '@/features/projects/types'
|
||||
import type { Checkpoint } from '@/features/workflows/types'
|
||||
import type { BreakdownModule, EpisodePlan } from '@/features/breakdown/types'
|
||||
@@ -446,7 +448,9 @@ it('原位采用的正式分镜显示完整统计,先前失败仅进入历史
|
||||
...candidateCheckpoint(state),
|
||||
updatedAt: '2026-10-17T10:05:00Z'
|
||||
}
|
||||
mountPage([current], 4)
|
||||
const warning = vi.fn<MessageApi['warning']>()
|
||||
const context = mountPage([], 4, warning)
|
||||
context.loading.value = true
|
||||
const record = {
|
||||
id: 'failed-before-in-place-adoption',
|
||||
projectId: 'breakdown-scroll-test',
|
||||
@@ -470,6 +474,11 @@ it('原位采用的正式分镜显示完整统计,先前失败仅进入历史
|
||||
const tracker = taskScope.run(() => useWorkflowExecution(ref(record.projectId), 'breakdown'))!
|
||||
await tracker.track(record.id)
|
||||
await flushPromises()
|
||||
expect(warning).not.toHaveBeenCalled()
|
||||
context.data.value.checkpoints = [current]
|
||||
context.loading.value = false
|
||||
await flushPromises()
|
||||
expect(warning).not.toHaveBeenCalled()
|
||||
expect(wrapper!.text()).toMatch(/正式拆解结果\s*·\s*4 集\s*·\s*60 镜\s*·\s*247 条绑定/)
|
||||
expect(wrapper!.text()).toContain('已提交正式结果')
|
||||
expect(wrapper!.text()).not.toContain('工作流失败')
|
||||
@@ -489,7 +498,9 @@ it('历史修复元数据不能掩盖之后新任务的真实失败', async () =
|
||||
const current = candidateCheckpoint(
|
||||
candidateState({ projectId: 'breakdown-scroll-test', storyboardPersisted: true, candidateCommitted: true })
|
||||
)
|
||||
mountPage([current])
|
||||
const warning = vi.fn<MessageApi['warning']>()
|
||||
const context = mountPage([current], 1, warning)
|
||||
context.loading.value = true
|
||||
const record = {
|
||||
id: 'new-failed-breakdown',
|
||||
projectId: 'breakdown-scroll-test',
|
||||
@@ -512,6 +523,10 @@ it('历史修复元数据不能掩盖之后新任务的真实失败', async () =
|
||||
const tracker = taskScope.run(() => useWorkflowExecution(ref(record.projectId), 'breakdown'))!
|
||||
await tracker.track(record.id)
|
||||
await flushPromises()
|
||||
expect(warning).not.toHaveBeenCalled()
|
||||
context.loading.value = false
|
||||
await flushPromises()
|
||||
expect(warning).toHaveBeenCalledOnce()
|
||||
expect(wrapper!.text()).toContain('工作流失败')
|
||||
expect(wrapper!.find('button.breakdown-desktop-issues').exists()).toBe(true)
|
||||
tracker.dismiss()
|
||||
@@ -597,8 +612,18 @@ function checkpoint(): Checkpoint {
|
||||
}
|
||||
}
|
||||
|
||||
/** 提供响应式 checkpoint,模拟轮询更新但不连接后端或启动模型任务。 */
|
||||
function mountPage(records = [checkpoint()], episodes = 1): ReturnType<typeof useProjectData> {
|
||||
/**
|
||||
* 提供响应式保存记录,模拟更新但不连接后端或启动模型任务。
|
||||
* @param records 已读取的拆解记录
|
||||
* @param episodes 项目集数
|
||||
* @param warning 可选的提示观察函数
|
||||
* @returns 可更新的测试项目上下文
|
||||
*/
|
||||
function mountPage(
|
||||
records = [checkpoint()],
|
||||
episodes = 1,
|
||||
warning?: MessageApi['warning']
|
||||
): ReturnType<typeof testProjectContextFrom> {
|
||||
const project: ProjectDetail = {
|
||||
id: 'breakdown-scroll-test',
|
||||
title: '滚动回归',
|
||||
@@ -636,20 +661,13 @@ function mountPage(records = [checkpoint()], episodes = 1): ReturnType<typeof us
|
||||
storyboard: { ready: true, reason: null }
|
||||
}
|
||||
})
|
||||
const provided: ReturnType<typeof useProjectData> = {
|
||||
data,
|
||||
project: computed(() => data.value.project),
|
||||
checkpoints: computed(() => data.value.checkpoints),
|
||||
stageReadiness: computed(() => data.value.stageReadiness),
|
||||
loading: ref(false),
|
||||
error: ref(''),
|
||||
updatedAt: ref(''),
|
||||
refresh: vi.fn<() => Promise<void>>().mockResolvedValue(),
|
||||
refreshStageReadiness: vi.fn<() => Promise<void>>().mockResolvedValue()
|
||||
}
|
||||
const provided = testProjectContextFrom(data)
|
||||
wrapper = mount(BreakdownPage, {
|
||||
attachTo: document.body,
|
||||
global: { provide: { [projectContextKey as symbol]: provided }, stubs: { RouterLink: true } }
|
||||
global: {
|
||||
provide: { [projectContextKey as symbol]: provided, ...(warning && { [actionMessageKey]: { warning } }) },
|
||||
stubs: { RouterLink: true }
|
||||
}
|
||||
})
|
||||
return provided
|
||||
}
|
||||
@@ -1094,7 +1112,7 @@ describe('拆解页内容滚动', () => {
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(panel.text()).not.toContain('手部记录覆盖')
|
||||
expect(panel.text()).toContain('未填写记录不代表镜头有误')
|
||||
expect(panel.text()).toContain('缺少记录不代表镜头有误')
|
||||
expect(panel.get('.n-collapse-item__header-extra button').text()).toBe('刷新校验')
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
@@ -169,7 +169,7 @@ describe('故事规划创作进度与恢复', () => {
|
||||
expect(page.find('[aria-label="剧本创作任务"]').exists()).toBe(false)
|
||||
const dialog = await openTask(page)
|
||||
expect(dialog.text()).toContain('验收任务中断')
|
||||
expect(dialog.text()).toContain('缺少已保存的故事规划')
|
||||
expect(dialog.text()).toContain('暂无故事规划')
|
||||
expect(dialog.find('button[aria-label="隐藏制作任务记录"]').exists()).toBe(false)
|
||||
const footer = dialog.get('.dialog-footer')
|
||||
expect(footer.find('button[aria-label="恢复生成"]').exists()).toBe(true)
|
||||
@@ -352,7 +352,7 @@ describe('故事规划创作进度与恢复', () => {
|
||||
const page = await open(execution(context.project.value!.id, { status: 'failed', stage: 'failed' }))
|
||||
const dialog = await openTask(page)
|
||||
expect(dialog.get('button[aria-label="恢复生成"]').attributes('disabled')).toBeDefined()
|
||||
expect(dialog.text()).toContain('缺少已保存的故事规划')
|
||||
expect(dialog.text()).toContain('暂无故事规划')
|
||||
})
|
||||
|
||||
it('节点切换重读项目与保存记录,不需要等到整个任务结束', async () => {
|
||||
|
||||
@@ -147,7 +147,7 @@ function server() {
|
||||
createdAt: '2026-10-08T00:00:00Z',
|
||||
updatedAt: '2026-10-08T00:00:01Z'
|
||||
}
|
||||
else if (path.endsWith('/checkpoints')) data = context.checkpoints.value
|
||||
else if (path.endsWith('/checkpoints?view=summary')) data = context.summaryQuery.data.value
|
||||
else if (path.endsWith('/subject-forms')) data = [form]
|
||||
else if (path.endsWith('/production/entry-readiness')) data = { ready: true, derivedAssets: { shotCount: 1 } }
|
||||
else if (path.includes('/storyboard-visual-states'))
|
||||
@@ -464,7 +464,7 @@ describe('高级串联生产的安全边界', () => {
|
||||
button('确认启动串联生产').click()
|
||||
await flushPromises()
|
||||
expect(posts()).toHaveLength(1)
|
||||
expect(document.body.textContent).toContain('流程返回不等于成片完成')
|
||||
expect(document.body.textContent).toContain('成片进度请到素材页查看')
|
||||
expect(document.body.textContent).toContain(receipt.errors[0])
|
||||
expect(document.body.textContent).toContain('已提交 1')
|
||||
expect(document.body.textContent).toContain('任务已分发,等待视频完成')
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('历史首帧输入', () => {
|
||||
await wrapper.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('当次描述 one')
|
||||
expect(wrapper.text()).toContain('原件字节已变化')
|
||||
expect(wrapper.text()).toContain('原图已变化')
|
||||
expect(wrapper.text()).toContain('@CH01')
|
||||
expect(wrapper.text()).toContain('@CH02')
|
||||
expect(wrapper.find('img').exists()).toBe(false)
|
||||
@@ -75,7 +75,7 @@ describe('历史首帧输入', () => {
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('当次描述 two')
|
||||
expect(wrapper.text()).not.toContain('当次描述 one')
|
||||
expect(wrapper.text()).toContain('原件不可用')
|
||||
expect(wrapper.text()).toContain('原图不可用')
|
||||
expect(fetcher.mock.calls.map(([url]) => url)).toEqual([
|
||||
'/api/storyboard-shots/shot/keyframes/one/generation-input?projectId=project',
|
||||
'/api/storyboard-shots/shot/keyframes/two/generation-input?projectId=project'
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('镜头生产数据契约', () => {
|
||||
expect(issueLabel('missing_identity_anchor')).toBe('缺少演员母版')
|
||||
expect(issueLabel('identity_unlocked')).toBe('演员身份未锁定')
|
||||
expect(productionStatusLabel('in_progress')).toBe('任务进行中')
|
||||
expect(productionStatusLabel('unknown')).toBe('unknown')
|
||||
expect(productionStatusLabel('unknown')).toBe('待确认')
|
||||
})
|
||||
|
||||
it('视频地址与图片使用相同的安全协议限制', () => {
|
||||
|
||||
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user