feat(short-drama-agent-front): 优化分镜界面并新增弹窗手势

This commit is contained in:
GJ committed 2026-11-18 18:50:15 +08:00
1 parent b15a6011ce
commit d68f03471c
59 files changed
+2694 -857

No files matched your search

+35 -1
View File
@@ -43,14 +43,22 @@
- 导航只显示名称。禁用原因放到可通过悬停和键盘聚焦查看的提示里,菜单行高保持一致。
- 问题提示放在能直接处理它的页面。素材图库不常驻展示下游镜头的生产警告和列表;从镜头主动定位素材时,只保留定位所需的信息与返回入口。普通浏览不发仅供该定位使用的全项目检查请求。
- 费用、覆盖、删除、适用范围与待审核限制必须保留并说清楚,不能为了简化文字改变功能含义。无法确认的能力不要用容易误解的描述代替。
- 必要的原始技术数据放在默认收起的“高级详情”或导出结果中,日常操作先展示中文摘要。同一弹窗的操作统一放入公共 `footer`,避免正文操作与默认关闭按钮重复。
- 日常操作先展示中文业务摘要;排查用的原始技术数据保留在数据层、专用排查入口或显式导出中,不能仅以“高级详情”为名把整段接口响应搬进普通弹窗。同一弹窗的操作统一放入公共 `footer`,避免正文操作与默认关闭按钮重复。
- 所有页面、弹窗和抽屉首屏优先显示当前结果、待处理事项、主要输入和操作;流程解释与历史长说明放到 info、二级详情或默认收起的区域。普通详情也只展示明确需要的中文业务字段,不展示无助于决策的接口对象、整段 JSON、内部字段、任务编号或指纹;不能因为接口返回某个字段就把它加入界面。费用、来源冲突、覆盖和正式采用限制仍须在操作处清楚显示。
- 重要内容较多时复用主题中的中性背景分组,区分当前事实、规划和操作风险;背景不能暗示尚未取得的审核通过。
### 全屏抽屉与关闭入口
- 新建剧本、项目全局配置、拆解设置、拆解问题等已确认使用全屏的界面统一复用 `AppDrawer`。后续同类复杂表单、设置和问题处理界面默认沿用全屏抽屉;简短确认或轻量提示仍可使用 `AppDialog`。
- 全屏必须同时覆盖容器与正文:内容使用可用的完整宽度,不能只把外壳放大而保留原弹窗的固定宽度或居中最大宽度。
- 标题区和底部操作区固定,只有正文独立滚动。长内容不能把关闭或提交按钮挤出视口,也不能产生页面与抽屉重复滚动。
- PC和移动端弹窗、抽屉的头部与底部均不使用border分隔正文;footer不使用box-shadow,header默认也不显示阴影,仅当正文向下滚动、顶部有内容被遮挡时显示更淡的主题阴影,回到顶部即隐藏。监听实际正文滚动容器,重新打开时清除旧状态;保持固定区域的背景和堆叠顺序,阴影不能遮挡正文或交互入口。
- 手机端公共弹窗与全屏抽屉统一复用底部浮动面板,顶部横条支持按住向下拖动关闭,仅手柄区域接收关闭手势,正文正常滚动。轻触、短拖及取消手势保持展开;保留关闭按钮和键盘入口,提交期间包括拖动在内的关闭方式均须锁定,切换布局或重新打开时清除旧手势状态。
- 底部浮动面板沿用项目直角样式,顶部不增加border-radius;只有正文滚动后的header使用淡阴影,footer保持无阴影、无分隔边框。
- 移动端弹窗和抽屉的footer按钮需占满内容宽度:单个按钮铺满整行,多个按钮等宽分配并铺满每一行,中间仅保留统一的小间隙;长标签宽度不足时允许按钮换行。复用公共底栏样式,保留按钮文字及提交锁;PC端保持原底栏布局。
- PC和移动端公共弹层footer按钮高度统一为组件原始 `--n-height` 的1.2倍,字号保持原样;复用公共CSS,不在业务页面再次叠加放大。
- 抽屉标题、说明、正文和底栏左右边界统一。复用公共抽屉的桌面、移动端内边距;正文 `padding-top` 保持为 `0`,不要额外叠加顶部空白。
- PC和移动端弹窗、抽屉的header标题最多显示一行,超出可用宽度以省略号显示;复用 `app-panel-title`,完整标题保留在原文、可访问名称及title提示中。标题可收缩,状态图标、说明入口和关闭按钮保持可见;副标题与正文继续按各自规则展示。
- 所有弹窗和抽屉底部至少保留一个可见的“关闭”或“取消”按钮,不能只有右上角叉号。底部操作使用公共组件的 `footer` 插槽,避免正文末尾再放一套底栏或重复关闭按钮。
- 关闭、取消统一为灰色底面和中性文字的普通按钮,不使用绿色主按钮;右上角关闭图标的尺寸、底色与交互反馈也统一复用公共样式。
- 提交期间按真实业务状态防止重复操作及意外关闭;普通只读加载不能无故阻止用户关闭。关闭、切换或定位后,不回填已失效的异步结果。
@@ -58,6 +66,8 @@
### 布局、说明与间距
- 页面外边距、模块间距优先复用 `--app-content-padding`、`--app-content-gap`;表单与抽屉内部复用对应公共组件的间距,不在各页面随意添加不同数值。
- 区分功能组间距与组内间距:未使用交替底面的独立功能组可复用 `workspace-section-stack-spacious`(两倍模块间距),组内复用普通模块间距;字段之间使用 `workspace-form-stack` 的16px,标签到控件为8px。同类区域只能使用同一套间距,不叠加默认 margin、padding 和 gap,也不把每个按钮都当成独立大分区。
- 同级折叠列表复用 `workspace-collapse`,收起时统一44px行高;首项、后续项及相邻折叠组不能因组件默认样式出现忽大忽小的空白。展开正文统一内边距,仍保留完整内容和输入状态。
- **表单字段间距为强制要求**:页面、弹窗、抽屉中的标签不能紧贴输入框、下拉框或选择组;自定义字段默认使用 `--app-field-label-gap`(8px),相邻字段默认使用 `--app-field-gap`(16px)。紧凑布局和移动端也不得取消这些必要间距,除非用户明确要求调整。
- 自定义的“标签 + 控件”优先复用 `src/styles/admin.css` 中的 `workspace-form-field`,使用真实的纵向 Flex/Grid `gap`;成熟表单继续复用 `AppForm` / `NFormItem` 的公共排版。禁止仅给行内 `span` 套 `space-y-*` 或垂直 margin 后,就认定标签间距已经生效。
- 修改表单布局时必须核对同模块的全部同类字段,保证同排标签、控件分别对齐;图片与表单并排时,图片标题和字段标签必须复用同一纵向间距值,图片与首排控件的上沿必须对齐;在本地 Chrome 检查桌面、窄屏及必要的加载/校验状态,确认实际留白生效后才算完成。
@@ -68,6 +78,28 @@
- 行内按钮按输入控件本身的基线对齐,不能按包含标签的整块区域垂直居中。动态例外行中的移除按钮与输入框底部对齐,使用 `Trash2` 等现有图标,不再显示“移除”文字,并提供可访问名称。
- 项目生成配置等普通表单分区不铺大块背景色,使用标题、说明和统一间距组织;常规错误沿用中性底色,只有明确的严重错误或通过检查的成功状态才使用对应状态底色。
### 长文本与多功能块布局(默认模板)
- **适用范围**:后续新增或优化页面、弹窗、抽屉时,遇到多段长文本与状态、历史、编辑、预览或确认操作混排,默认沿用当前摄影草案审核的布局;适用于全项目同类界面,不限于分镜或摄影功能。简单提示、短表单及单一剧本正文继续使用适合其内容的简洁布局。
- **先按功能分组**:将概况、正式内容与历史、编辑、差异、预览和确认等实际存在的功能分别组织成块。首屏突出主要信息与操作,历史和次要说明按需展开;相关按钮、状态和说明归入对应功能块。
- **统一序标标题**:独立功能块使用“罗马数字 I、II、III… + 标题”,复用 `WorkspaceSectionHeading` 的 `marker`。按可见块依次编号,条件区域隐藏时不跳号;字段、普通说明及嵌套详情不重复编号。序标仅表示阅读顺序,执行进度、质量与费用状态仍分别表达。
- **统一交替底色**:外层复用 `workspace-section-stack workspace-numbered-sections`,每块复用 `workspace-numbered-section`。两种中性底色均须与页面或弹窗背景区分,同时保持输入控件清晰可辨。功能块连续排列,块间不留额外 gap、margin 或装饰线,以底色表达边界。
- **同级严格对齐**:所有功能块使用相同内边距,序标、标题和同类正文各自共用左边线。标题与正文放在同一个功能块内,不因某块另套卡片而单独缩进。桌面块内边距20px,手机复用 `--app-content-padding`;正文避免再嵌套一层同色背景和重复内边距。
- **块内保持阅读间距**:去掉的是功能块之间的额外空白。组内说明与操作沿用公共模块间距;字段复用 `workspace-form-stack` 的16px,标签到控件保留8px。折叠列表复用 `workspace-collapse`,统一44px收起行高及展开正文间距。普通辅助按钮保持就地宽度,避免拉伸为整条灰色区域。
- **控制长文行宽与高度**:关联的长文编辑字段可在宽屏分栏、窄屏单列,标签和控件上沿对齐;列内字段间距不受另一列内容高度影响。复用 `workspace-prose-input` 的字号和行距、有界自动高度及必要的内部滚动,完整原文保持可查看、可编辑,不裁剪或改写创作内容。
- **复用与验收**:优先参考 `ShotDerivedReview.vue`、`JointDraftReviewPanel.vue` 及公共样式增量实现。保留原有历史、来源、费用和确认条件;在本地 Chrome 核对桌面、手机、长内容、折叠展开、序号变化、标题对齐、交替底色、内容滚动和固定底栏后交付。
### 图片列表与详情浮层
- 图片列表使用可用内容宽度,复用公共网格;不能因固定最大宽度在大屏右侧留下整片可利用的空白。图片以紧凑缩略图展示,少量图片不无限拉伸成巨图;窄屏按可用宽度调整列数。
- 同一图片列表的卡片高度一致,操作区对齐。长名称、模型名、历史错误和说明不能撑高某一项;完整信息仍可通过详情查看,不能为了等高截掉必要内容。
- 图片卡片的信息顺序统一为“图片 → 状态标签 → 图片名称 → 日期时间 → 操作”。名称必须可识别,不能只显示日期;无独立名称时可使用镜头名称和稳定展示序号,不覆盖用户名称或写回资产。
- 标签放在名称上方,标签、名称和操作之间保持紧凑且一致的间距;不要为未出现的第二行标签预留空白。卡片等高依靠网格与操作区对齐,不依靠给短内容增加大块空白。
- 列表先展示主要状态与名称;尺寸、型号、完整历史、可修复错误和技术说明放在 info 或二级详情。影响当前执行的费用风险、来源冲突和采用限制仍在对应操作处显示,不能全部藏进图标。
- 弹窗、抽屉和滚动区域中的提示及详情浮层必须避开容器裁切:优先复用公共组件,Naive UI `NPopover` 明确使用 `:to="true"` 挂到页面浮层,并启用边缘自动翻转;不能只提高 `z-index` 掩盖父容器的 `overflow` 问题。
- 浮层宽度不得超出当前视口,计入内边距并保留屏幕边距。长模型名、连续字符和长说明必须换行;长详情限制高度并允许内部滚动,不能横向裁切正文或遮住必要操作。
- 同一按钮的详情打开后,停用重复的悬浮操作说明,避免提示覆盖详情标题或正文;保留按钮的可访问名称与键盘操作。信息浮层不能触发生成、保存、审核或采用。
### 按钮、图标与状态颜色
- 绿色背景、白色文字用于保存、提交、开始生成等主要执行操作;关闭、取消和普通辅助操作使用中性样式。
@@ -86,6 +118,7 @@
### 设置、问题处理与任务进度
- 拆解设置与问题处理分开:设置界面负责模块选择、分组预览、启动拆解、候选确认与提交;问题界面负责错误查看、分镜定位、人工修订、读取修复清单及阶段恢复。
- 普通目录浏览不增加无必要的勾选框;多选只在用户主动进入的批量操作中提供。进入页面或刷新时不自动弹出生成配置,不自动提交生成;配置由明确的操作入口打开。
- 质量规则确认以服务端 revision、fingerprint、confirmed 和独立 confirm 接口为准,不能用 LocalStorage 或格式版本 policy.version 代替。规则保存携带 expectedRevision,拆解启动携带本次已确认修订;候选提交预检查必须包含 qualityPolicyMatches。
- 首次拆解前只确认表现方式、动作许可和自定义规则,不显示精确动作例外的空白编辑行。已有例外可只读核对,隐藏输入不能清空已有规则或在保存时覆盖后来新增的例外。
- 新增精确动作例外统一放在拆解后的问题修订中,从当前版本的真实冲突证据自动带入角色、部位或物品及动作,用户填写允许原因。证据缺失时不能猜测或用其他镜头代替;按后端实际范围说明影响,保存例外不能直接标记质量通过。
@@ -112,6 +145,7 @@
- 页面模块之间复用公共间距;按钮、标题和辅助说明须有清晰留白。已有相邻页面使用骨架屏时,同类入口也应在项目加载和正文加载阶段预留相同结构。
- 骨架与图片占位默认静态显示,避免闪动。图库按真实卡片结构分别预留图片、文字和操作位置。
- 图片卡片在请求图片前就预留画面区域,优先用已有宽高,缺少宽高时使用稳定比例。检查慢速、加载失败和无图时卡片都不会塌陷。
- 图片列表及浮层验收需覆盖最左、最右和底部卡片、少量与多行图片、长名称和模型名、长错误、桌面与手机窄屏;确认详情不会被弹窗或滚动容器裁切,边缘避让、换行、滚动和提示互斥实际生效。
- 界面验收不得为了制造状态而触发真实付费生成、覆盖正式结果或提交用户数据;使用现有状态、只读操作和合适的自动化测试验证。
- 测试与检查按改动范围执行;纯文档变更无需启动页面或重复完整构建。报告时区分自动化检查与真实浏览器验证,并明确未完成项,不把尝试操作当作验收通过。
@@ -0,0 +1,116 @@
# 分镜页面信息层级优化交接
## 范围与边界
- 在前端根目录 `dev` 完成,起点为 `b15a6011ce28dd58156ac3c5c06e84c8796fe39c`。保留同轮此前未提交的图片卡片改动。
- 本次只调整展示与按需展开,不修改后端、接口字段、收费参数、质量结论、来源校验及正式采用条件。
- 普通用户首屏先看到当前结果、主要输入和操作。流程介绍放信息图标,完整创作正文和业务历史按需展开。
- 普通详情不再直接输出整段响应、任务编号、SHA 或指纹。需要核对的历史改为明确的中文字段。原始对象仍用于请求、来源和并发保护;已有显式导出保留。
- 费用、未知请求、来源变化、覆盖、保存与正式采用的区别仍在操作处展示。信息背景只用于分组,不暗示质量通过。
- 未执行真实图片、文本、Vision 或视频模型,未向正式项目保存草案、采用、批准或核清费用。本轮完整改动已获用户明确提交及推送授权,交付目标为 `origin/dev`。
## 已有问题与本次结果
1. 图片列表原有最大宽度导致大屏右侧空白,长错误和模型名令卡片高度不齐。现在网格使用可用全宽,按缩略图列宽自动排布、统一等高;少量图片保留列位,不无限放大。手机单列。
2. 卡片依次显示图片、标签、图片名称、日期、操作。标签最小高度从 44px 收紧到单行 22px;名称前不再预留未使用的第二行。模型、尺寸、画幅问题、失败原因与来源说明放 info 浮层。
3. 没有独立名称的历史图片,使用镜头名及按创建时间生成的展示编号;不写回资产,不因主图切换而重编号。
4. 分镜摄影规划与开拍事实使用两块中性主题底面。构图机位、天气环境、主体和连续依据按需展开,完整原文保持可查看。
5. 摄影、联合草案、动作修订、首帧、质量和连续性相关弹窗收起流程介绍及高级参数;保存、预检和采用仍是独立操作。
6. 原来整段输出的摄影历史、动作版本、人工来源观察、布局约束、生成方案和许可记录改为中文业务记录。历史摄影保留修改前后构图、机位、审核人和时间;联合模式也可查看。
7. 普通有效图片授权不再误显示“原请求和费用仍未知”。只有实际阻断、可选许可、已选许可或读取问题时才显示有限许可区域;实际费用阻断保持可见。
8. 原候选校验、Workflow、来源复核去掉内部请求与执行编号、原始 JSON;执行状态、业务问题、独立质量结论、恢复与历史入口保留。
9. 布局完整约束改为要求、来源、画面要求、构图要求和验收依据;不再展示版本哈希。保存仍原样发送正式确认参数及期望版本。
## 文件职责
新增:
- `src/components/ui/RecordDetails.vue`:只接收显式选择的中文业务字段,不序列化接口对象;支持已在折叠区中的直接显示。
- `tests/components/ui/progressive-info.test.ts`:公共标题说明、动态费用状态、创作原文和长提示词按需展开。
- `tests/features/production/keyframe-dialog-density.test.ts`:普通有效授权与真实阻断分别显示,不自动生成。
修改:
- `AGENTS.md`:补充本次用户确认的信息层级与普通用户详情规范。
- `AppDialog.vue`、`AppDrawer.vue`、`WorkspaceSectionHeading.vue`、`FieldLabel.vue`:复用说明入口;动态说明插槽直接显示,创作内容可原样展示。
- `admin.css`:全宽等高候选网格、参考缩略图网格、开拍事实主题背景。
- `production/model.ts`、`KeyframeCard.vue`、`ShotProductionAssets.vue`:稳定图片展示名、紧凑标签、info 详情、对齐操作和候选/记录标题。
- `StoryboardPage.vue`、`ShotDesign.vue`、`ShotTools.vue`:分镜标题说明、摄影/状态分组和可读生成内容。
- `ShotDerivedReview.vue`、`JointDraftReviewPanel.vue`、`JointDraftFields.vue`、`DirectionStageReview.vue`、`derived-review.ts`:摄影审核、联合表单、完整差异和可读历史;原模式、保存、预览、采用保留。
- `MotionRevisionEditor.vue`:版本和失败候选摘要、历史按需展开,指定历史任务编号收起;保存、Vision、采用仍分别控制。
- `ImageGenerationPreview.vue`、`KeyframeDialog.vue`、`QualityDialog.vue`、`ValidationPreviewPanel.vue`:预览层级、长提示词、按需许可、费用背景和中文参考职责。
- `ContinuityReviewDrawer.vue`、`ContinuityJointReview.vue`、`ContinuityStateEditor.vue`、`SceneTransitionEvidence.vue`:连续性业务摘要、有限高度图片、中文正式依据、规划与视频末态区别。
- `SourceReviewDrawer.vue`、`LayoutSupplementPanel.vue`:原图来源记录、逐项人工观察、布局完整约束与来源影响,去除普通响应对象展示。
- `KeyframeValidationHistory.vue`、`KeyframeValidationSteps.vue`、`KeyframeExecutionStatus.vue`、`QualityResult.vue`、`WorkflowExecutionPanel.vue`:历史质量、执行与费用保持分离,去掉普通诊断数据 dump。
- `src/testing/naive.ts` 和相关 UI 测试:通过用户主动展开读取详情;按中文业务结果验证,不依赖内部编号显示。
- `tests/browser/v02-continuity.ts`:隔离页额外允许已拦截的免费布局输入预览,批准、签收、保存、执行和恢复仍返回拒绝;没有真实请求回退。
无删除文件,无依赖变更。
## 自动化验证
- 全量 Vitest:124 套、949 项通过。
- 之后补充中文来源/布局记录及历史保留检查,按受影响范围复验:摄影联合与动作修订 4 套 24 项通过;来源、连续性和质量等 6 套 90 项通过;新增展示断言所在 2 套 19 项通过。以上计数有重叠,不累加为全量数。
- 最后源码的 TypeScript 与 Vite build 通过。变量重命名消除作用域遮蔽警告后复验相关 Lint。
- 修改范围 Oxfmt、Oxlint、Vue ESLint 通过;`git diff --check` 通过。
## 本地 Chrome 验收
使用已有 localhost Chrome 标签页及原生辅助功能/截图/键鼠,没有使用 Playwright。
- 正式分镜只读:摄影与开拍状态背景分组、视觉重点 info、构图/主体/连续依据折叠;刷新没有自动打开生成配置。
- 图片卡片此前已验证桌面多列、移动单列、紧凑标签与名称、info 长内容和等高;本次保留这些布局及原质量/主图门禁。
- `v8-10.html` 隔离页:首帧流程说明进入 info、真实费用阻断仍显示;免费预览后长提示词默认收起且可展开;未点击生成。
- 同一隔离页:动作失败候选只读加载,指定历史任务收起;保存/采用/Vision 未触发。390×844 验证正文滚动、固定底栏和表单边界。
- `review-billing.html`:联合模式初始草案、全部差异、主体与衔接折叠、说明浮层;390×844 无横向溢出,固定保存/采用底栏可见。
- `b04-review.html`:来源复核免费预检,中文正式动作、原图记录、逐图未知观察;桌面和390×844均可浏览,底栏固定。隔离页拒绝全部写请求。
- `v02-continuity.html`:免费布局输入预览,展开中文完整约束,保存影响和独立确认仍清楚;未确认正式布局。
- 最后关闭设备模拟与开发工具,恢复正式分镜只读页面。
## 仍保留的专用能力
本次没有全局删除原始数据组件。独立账单审计里的原件与签署材料、显式导出、以及高级人工物理交互编辑仍按原契约保留;这些不作为普通分镜首屏的默认内容。后续新增界面继续遵守当前 AGENTS 的信息层级规范。
## 图片详情浮层裁切补充
- 本地 Chrome 复现:候选管理最右列的详情挂在弹窗内部,超过弹窗正文边界的文字被裁掉。
- `KeyframeCard.vue` 的详情、主图切换确认,以及公共 `WorkspaceActionTooltip.vue` 明确挂载至页面浮层,启用边缘自动翻转;长说明限制宽度并换行。
- 详情打开时停用同一按钮的悬浮说明,避免“查看首帧详情”提示叠在正文上。
- Chrome 只读验证桌面最右列详情完整显示;390×844 下摄影抽屉内同类详情保持在屏幕范围内,模型长名完整可读。恢复桌面并关闭开发工具。
- 相关 Vitest 3 套29项、TypeScript、两文件 Oxlint/ESLint/格式检查通过,未触发生成、审核或采用。
## 摄影编辑间距与长文阅读补充
- 原不一致来自独立折叠组的模块 gap 与 Naive UI 后续项默认 margin、header padding 叠加。新增公共 `workspace-collapse` 统一44px折叠行、首项与后续项留白、展开正文间距;已用于摄影审核、联合草案与设计状态的同类区域。
- 独立功能组使用现有两倍模块间距,来源读取与保存状态归为一组;完整草案单独用中性主题底面组织。表单字段统一16px,标签到控件仍为8px。
- 共用 `DirectionCameraFields` 增量支持摄影意图插槽,宽屏构图在左,机位与意图在右;列内保持固定字段间距,窄屏恢复单列。长文输入统一字号、行距和有界自动高度,未修改原文或提交结构。
- 已同步写入 AGENTS,后续同类界面按公共样式复用。
- 相关 Vitest 4套33项、TypeScript、修改组件 Oxlint/ESLint、格式及差异检查通过。Chrome 使用正式项目只读核对桌面分栏、等距折叠、390×844单列、长文内部滚动、正文滚动与固定底栏;未保存、预检采用或执行收费操作。
## 功能块罗马序标补充
- 公共 `WorkspaceSectionHeading` 增加可选 `marker`,默认不改变已有标题;以中性底面的罗马序标加强功能区边界。
- 联合修订面板按可见功能块依次编号:来源与草案状态、正式内容与历史、完整草案、字段差异、可选原文依据、画面与相邻镜头预览、审核与采用,以及可选采用后预览。条件区域隐藏时无跳号,嵌套字段和说明不重复编号。
- 只调整阅读分组,不改变保存、预检、采用、来源保护及任何收费动作。规则已补入 AGENTS。
- 根据后续反馈,编号功能块改用交替中性底面并去掉块间额外间距。每个同级功能区使用相同内边距,序标、标题保持一条左边线;草案及差异不再嵌套额外卡片缩进。块内表单仍保留必要间距。
- 最终相关 Vitest 4套34项、TypeScript、Oxlint/ESLint和差异检查通过。Chrome 桌面与390×844已确认序标及同级标题对齐、交替底面连续展示、正文和固定底栏正常;只读验收,未生成或保存正式结果。
## 原摄影修订模式同步
- `ShotDerivedReview.vue` 原模式也使用公共编号与斑马纹布局:正式分镜审核、正式摄影/图片/历史、可选差异及采用结果、已保存草案、可选视线范围和编辑、预览确认。按实际可见块连续编号,标题统一左对齐,块间无额外空白。
- 将来源刷新、历史与原图片归为一个功能区;保留原摄影修订、主体视线、前镜场景沿用、导入、草案保存、免费预览和正式采用全部入口。预览按钮改为就地宽度,避免被拉伸成整条灰色区域。
- Mock 摄影修订测试补充可见块连续编号与差异出现后的编号核对,原保存/采用/冲突保护继续通过。相关4套78项、TypeScript、Oxlint/ESLint、格式及差异检查通过。
- 本地 Chrome 桌面及390×844只读验证正式历史与过期草案、预览禁用、内容滚动和固定底栏;未点击保存、生成、审核或采用。
## 手机底部面板与弹窗头尾
- `AppDialog.vue` 和 `AppDrawer.vue` 在639px及以下统一使用直角底部面板。普通弹窗按内容自然高度,长表单及原全屏抽屉保留独立正文滚动和固定底栏。桌面继续使用原居中/全屏布局;没有新增Vant依赖或重复业务页面。
- 新增 `MobilePanelHandle.vue`:仅顶部44px手柄区域捕获指针,支持跟随下拉、短拖回位、距离/速度关闭、上拉阻尼、系统取消和多触点保护。提交锁在拖动中或离场过程中生效时均取消关闭;关闭、重新打开和切换桌面布局清理旧手势。保留关闭按钮、键盘和读屏入口,尊重减少动效偏好。
- 新增 `useMobileViewport.ts` 同步公共手机断点;新增 `usePanelScrollState.ts` 监听实际正文滚动。header默认无阴影,正文离开顶部后显示更淡的主题阴影,回顶和重新打开时清除;footer始终无阴影。PC和移动端头尾均不增加border,面板顶部不增加圆角。
- `admin.css` 统一手机底栏:单按钮整行铺满,多个按钮等宽填满可用行宽,只保留统一间隙;长标签按实际内容换行。PC底栏排版保留。
- 新增 `tests/components/ui/mobile-panel.test.ts`,覆盖轻触/短拖、明确下拉/甩动、兼容click误关闭防护、取消/丢失捕获、多触点、提交中和离场中加锁、公共组件键盘关闭、切回桌面、正文阴影和重新打开状态。
- 新增 `tests/browser/mobile-panels.html`、`mobile-panels.ts`,仅内存模拟,所有fetch均拒绝。Chrome原生操作已验证440×956手机模拟视口中的两类面板、横条关闭与回位、提交锁、长正文滚动、单/多按钮底栏、直角及淡header阴影;同时核对PC原布局与无分隔线。没有使用Playwright或执行任何真实业务请求。
- 前一次全量959项检查只有新增圆角违反既有扁平主题约束,已将面板及横条改为直角;相关主题、公共布局和手势回归56项通过。未放宽原主题检查规则。
- 最终全量Vitest:125套961项通过;TypeScript、Vite build、修改范围Oxlint/ESLint、格式及差异检查通过。
- 最新移动交互、头尾阴影和底栏要求已写入AGENTS。代码在前端根目录dev交付,实际提交号及远端状态以Git记录为准。
- 公共header标题在PC及手机端统一单行省略,完整名称保留在原文、可访问名称和title提示中,关闭与说明入口保持可见;公共footer按钮高度按原组件尺寸统一增加20%。Chrome已核对两类弹层和两种视口,相关检查通过。
+89 -7
View File
@@ -2,6 +2,10 @@
import { NButton, NModal, NScrollbar, useThemeVars } from 'naive-ui'
import { CircleAlert, CircleCheck, CircleX } from '@lucide/vue'
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
import FieldLabel from './FieldLabel.vue'
import MobilePanelHandle from './MobilePanelHandle.vue'
import { useMobileViewport } from '../../composables/useMobileViewport'
import { usePanelScrollState } from '../../composables/usePanelScrollState'
/** 公共弹窗的标题、说明、操作状态和宽度。 */
withDefaults(
@@ -10,6 +14,8 @@ withDefaults(
title: string
/** 可选的简短标题补充,尽量一句话;完整说明与操作影响应放入默认正文插槽。 */
description?: string
/** 操作流程说明放入信息图标,业务状态说明插槽仍直接显示。 */
descriptionAsInfo?: boolean
/** 展示语义状态;默认保持中性,警告、成功和错误仅在标题旁显示对应图标。 */
status?: 'default' | 'warning' | 'success' | 'error'
/** 提交期间锁定关闭操作。 */
@@ -27,6 +33,10 @@ const themeVars = useThemeVars()
const emit = defineEmits<{ closed: [] }>()
/** 弹窗显隐状态,关闭行为由 Naive 管理。 */
const open = defineModel<boolean>('open', { default: false })
/** 手机端使用底部面板,桌面继续采用原居中弹窗。 */
const mobile = useMobileViewport()
/** 正文离开顶部时才显示标题区阴影,底栏始终保持平面。 */
const { bodyScrolled, onBodyScroll } = usePanelScrollState(open)
/** 正文容器隔离子元素外边距,保留完整的自然内容高度。 */
const bodyContent = ref<HTMLElement | null>(null)
/** 正文最大可用高度;未挂载时不限制自然高度。 */
@@ -46,7 +56,7 @@ function updateBodyHeight() {
maxBodyHeight.value = Math.max(
0,
(window.visualViewport?.height ?? window.innerHeight) -
32 -
(mobile.value ? 12 : 32) -
(header?.offsetHeight ?? 0) -
(footer?.offsetHeight ?? 0) -
(contentStyle ? parseFloat(contentStyle.paddingTop) + parseFloat(contentStyle.paddingBottom) : 0) -
@@ -95,17 +105,22 @@ onBeforeUnmount(() => {
:closable="!busy"
:mask-closable="!busy"
:close-on-esc="!busy"
:style="{ width: `${width ?? (wide ? 1040 : 600)}px` }"
:style="{ width: mobile ? '100vw' : `${width ?? (wide ? 1040 : 600)}px` }"
class="app-dialog"
:class="{ 'app-dialog-title-only': !description && !$slots.description }"
:class="{
'app-dialog-title-only': !description && !$slots.description,
'app-mobile-panel': mobile,
'has-body-scroll': bodyScrolled
}"
role="dialog"
:aria-label="title"
@after-leave="emit('closed')"
>
<!-- 以下是固定标题与说明模块,无说明时标题与关闭按钮垂直居中对齐 -->
<template #header>
<div class="min-w-0">
<div class="flex items-center gap-2 text-lg font-semibold">
<div class="min-w-0 w-full">
<MobilePanelHandle v-if="mobile" :active="open" :disabled="busy" @dismiss="open = false" />
<div class="flex min-w-0 items-center gap-2 text-lg font-semibold">
<!-- 以下是可被读屏识别的状态提示,颜色之外保留不同图形 -->
<CircleAlert
v-if="status === 'warning'"
@@ -131,9 +146,20 @@ onBeforeUnmount(() => {
aria-label="错误"
:style="{ color: themeVars.errorColor }"
/>
<span class="min-w-0 wrap-anywhere">{{ title }}</span>
<span class="app-panel-title" :title="title">{{ title }}</span>
<FieldLabel
class="shrink-0"
v-if="descriptionAsInfo && description && !$slots.description"
label="操作"
:description="description"
icon-only
icon="info"
/>
</div>
<div v-if="description || $slots.description" class="mt-[2px] text-sm leading-6 font-normal text-muted">
<div
v-if="$slots.description || (description && !descriptionAsInfo)"
class="mt-[2px] text-sm leading-6 font-normal text-muted"
>
<slot name="description">{{ description }}</slot>
</div>
</div>
@@ -141,6 +167,7 @@ onBeforeUnmount(() => {
<!-- 以下是自然高度正文模块,仅超过剩余视口高度时滚动 -->
<NScrollbar
class="dialog-body-scroll"
@scroll="onBodyScroll"
:style="{ height: 'auto', maxHeight: maxBodyHeight === undefined ? undefined : maxBodyHeight + 'px' }"
>
<div ref="bodyContent" class="flow-root"><slot /></div>
@@ -168,6 +195,16 @@ onBeforeUnmount(() => {
.app-dialog .n-card-header {
@apply shrink-0 items-start;
position: relative;
z-index: 1;
border-bottom: 0;
box-shadow: none;
}
.app-dialog .n-card-header__main {
min-width: 0;
}
.app-dialog.has-body-scroll .n-card-header {
box-shadow: 0 4px 12px -8px color-mix(in srgb, var(--app-shadow) 60%, transparent);
}
/* 无描述的标题栏采用同一条中心线,标题下方保持紧凑的正文间距。 */
.app-dialog.app-dialog-title-only .n-card-header {
@@ -189,6 +226,10 @@ onBeforeUnmount(() => {
display: flex;
align-items: center;
justify-content: flex-end;
position: relative;
z-index: 1;
border-top: 0;
box-shadow: none;
}
.app-dialog .dialog-footer {
@@ -212,4 +253,45 @@ onBeforeUnmount(() => {
padding-top: var(--n-padding-left);
padding-bottom: var(--n-padding-left);
}
/* 手机居中弹窗统一贴底,短内容保持自然高度,长内容只滚动正文。 */
@media (max-width: 639px) {
.app-dialog.app-mobile-panel.n-card {
position: fixed;
inset: auto 0 0;
margin: 0;
max-width: 100vw;
max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
border-radius: 0;
}
.app-dialog.app-mobile-panel.n-card > .n-card-header {
padding: 44px 16px 16px;
}
.app-dialog.app-mobile-panel .n-card-header__close {
align-self: flex-start;
}
.app-dialog.app-mobile-panel.n-card > .n-card-content {
padding-inline: 16px;
}
.app-dialog.app-mobile-panel.n-card > .n-card__footer {
padding: 16px 16px max(16px, env(safe-area-inset-bottom));
}
.app-dialog.app-mobile-panel:is(.fade-in-scale-up-transition-enter-from, .fade-in-scale-up-transition-leave-to) {
transform: translate3d(0, 100%, 0);
opacity: 1;
}
.app-dialog.app-mobile-panel:is(
.fade-in-scale-up-transition-enter-active,
.fade-in-scale-up-transition-leave-active
) {
transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
}
@media (prefers-reduced-motion: reduce) {
.app-dialog.app-mobile-panel:is(
.fade-in-scale-up-transition-enter-active,
.fade-in-scale-up-transition-leave-active
) {
transition-duration: 0.01ms;
}
}
</style>
+49 -7
View File
@@ -1,5 +1,9 @@
<script setup lang="ts">
import { NButton, NDrawer, NDrawerContent } from 'naive-ui'
import FieldLabel from './FieldLabel.vue'
import MobilePanelHandle from './MobilePanelHandle.vue'
import { useMobileViewport } from '../../composables/useMobileViewport'
import { usePanelScrollState } from '../../composables/usePanelScrollState'
/** 全屏抽屉共用标题、说明和保存期间的关闭锁定。 */
withDefaults(
@@ -8,6 +12,8 @@ withDefaults(
title: string
/** 标题下的说明,可使用同名插槽覆盖。 */
description?: string
/** 静态操作说明按需查看,定位或动态状态说明仍默认直接显示。 */
descriptionAsInfo?: boolean
/** 提交期间禁止关闭抽屉。 */
busy?: boolean
}>(),
@@ -15,29 +21,51 @@ withDefaults(
)
/** 全屏抽屉显隐状态,由调用方保留业务草稿。 */
const open = defineModel<boolean>('open', { default: false })
/** 手机端从底部展开,同一份正文、草稿和底栏保持在原抽屉内。 */
const mobile = useMobileViewport()
/** 正文滚动才显示标题阴影,避免静态内容周围常驻分隔。 */
const { bodyScrolled, onBodyScroll } = usePanelScrollState(open)
/** 将同一滚动监听传给抽屉内部的正式Scrollbar。 */
const bodyScrollbarProps = { onScroll: onBodyScroll }
/** 关闭动画结束后通知调用方,便于交接焦点。 */
const emit = defineEmits<{ closed: [] }>()
</script>
<template>
<!-- 以下是从右侧展开、内容同步铺满视口的公共全屏抽屉模块 -->
<!-- 以下是桌面全屏抽屉与手机底部面板共用的弹层模块 -->
<NDrawer
v-model:show="open"
placement="right"
:placement="mobile ? 'bottom' : 'right'"
width="100vw"
:height="mobile ? 'calc(100dvh - max(12px, env(safe-area-inset-top)))' : undefined"
:auto-focus="false"
:mask-closable="!busy"
:close-on-esc="!busy"
class="app-drawer"
:class="{ 'app-mobile-panel': mobile, 'has-body-scroll': bodyScrolled }"
:aria-label="title"
@after-leave="emit('closed')"
>
<NDrawerContent :closable="!busy" :native-scrollbar="false">
<NDrawerContent :closable="!busy" :native-scrollbar="false" :scrollbar-props="bodyScrollbarProps">
<!-- 以下是固定标题与说明模块,与正文共用左右边界 -->
<template #header>
<div class="app-drawer-heading">
<div class="text-lg font-semibold">{{ title }}</div>
<div v-if="description || $slots.description" class="mt-2 text-sm font-normal leading-6 text-muted">
<MobilePanelHandle v-if="mobile" :active="open" :disabled="busy" @dismiss="open = false" />
<div class="flex min-w-0 items-center gap-2 text-lg font-semibold">
<span class="app-panel-title" :title="title">{{ title }}</span>
<FieldLabel
class="shrink-0"
v-if="descriptionAsInfo && description && !$slots.description"
label="操作"
:description="description"
icon-only
icon="info"
/>
</div>
<div
v-if="$slots.description || (description && !descriptionAsInfo)"
class="mt-2 text-sm font-normal leading-6 text-muted"
>
<slot name="description">{{ description }}</slot>
</div>
</div>
@@ -67,6 +95,12 @@ const emit = defineEmits<{ closed: [] }>()
.app-drawer.n-drawer .n-drawer-content .n-drawer-header {
position: relative;
padding: 24px;
z-index: 1;
border-bottom: 0;
box-shadow: none;
}
.app-drawer.n-drawer.has-body-scroll .n-drawer-content .n-drawer-header {
box-shadow: 0 4px 12px -8px color-mix(in srgb, var(--app-shadow) 60%, transparent);
}
/* 关闭入口独立定位,避免占据标题列后造成正文边界错位。 */
.app-drawer .n-drawer-header__close {
@@ -90,6 +124,10 @@ const emit = defineEmits<{ closed: [] }>()
.app-drawer.n-drawer .n-drawer-content .n-drawer-footer {
display: block;
padding: 20px 24px max(20px, env(safe-area-inset-bottom));
position: relative;
z-index: 1;
border-top: 0;
box-shadow: none;
}
.app-drawer-footer {
display: flex;
@@ -102,11 +140,15 @@ const emit = defineEmits<{ closed: [] }>()
/* 窄屏缩小外层留白,正文布局由各业务表单控制。 */
@media (max-width: 639px) {
.app-drawer.app-mobile-panel.n-drawer {
border-radius: 0;
overflow: hidden;
}
.app-drawer.n-drawer .n-drawer-content .n-drawer-header {
padding: 20px 16px;
padding: 44px 16px 16px;
}
.app-drawer .n-drawer-header__close {
top: 20px;
top: 44px;
right: 16px;
}
.app-drawer.n-drawer .n-drawer-content .n-drawer-body-content-wrapper {
+10 -4
View File
@@ -2,7 +2,7 @@
import { ref } from 'vue'
import { NPopover } from 'naive-ui'
import type { PopoverProps } from 'naive-ui'
import { CircleHelp } from '@lucide/vue'
import { CircleHelp, Info } from '@lucide/vue'
import { userFacingText } from '../../lib/user-facing-text'
/** 字段标签与按需打开的说明,适用于项目配置和各类生成表单。 */
@@ -12,6 +12,12 @@ withDefaults(
label: string
/** 原有字段说明,没有说明时不显示提示图标。 */
description?: string
/** 只展示说明图标,主标题由所在模块保留。 */
iconOnly?: boolean
/** 操作与信息说明使用info,字段帮助默认使用问号。 */
icon?: 'help' | 'info'
/** 用户创作的内容保持原样,不执行系统文案转换。 */
verbatim?: boolean
/** 提示位置可按字段单独指定,默认居中显示在图标上方。 */
placement?: PopoverProps['placement']
}>(),
@@ -24,7 +30,7 @@ const open = ref(false)
<template>
<!-- 以下是字段标签与说明提示模块 -->
<span class="inline-flex min-w-0 items-center gap-1.5">
<span>{{ userFacingText(label, label) }}</span>
<span v-if="!iconOnly">{{ verbatim ? label : userFacingText(label, label) }}</span>
<!-- 浮层挂到视口层,按字段指定位置并自动翻转,避免被弹窗滚动容器裁剪。 -->
<NPopover v-if="description" v-model:show="open" trigger="click" :placement="placement" :to="true" :flip="true">
<template #trigger>
@@ -35,11 +41,11 @@ const open = ref(false)
:aria-expanded="open"
@click.stop
>
<CircleHelp :size="14" aria-hidden="true" />
<component :is="icon === 'info' ? Info : CircleHelp" :size="14" aria-hidden="true" />
</button>
</template>
<div class="max-w-[min(360px,calc(100vw-48px))] whitespace-pre-wrap break-words text-xs leading-5">
{{ userFacingText(description) }}
{{ verbatim ? description : userFacingText(description) }}
</div>
</NPopover>
</span>
+223
View File
@@ -0,0 +1,223 @@
<script setup lang="ts">
import { onBeforeUnmount, watch } from 'vue'
/** 手机面板仅通过顶部手柄拖动,正文不接收拖动关闭事件。 */
const props = defineProps<{
/** 弹层是否仍打开,外部关闭时取消旧手势。 */ active: boolean
/** 提交期间禁用关闭,拖动中进入提交也必须撤销手势。 */ disabled?: boolean
}>()
/** 请求原弹层关闭,焦点交接及业务草稿仍由原组件管理。 */
const emit = defineEmits<{ dismiss: [] }>()
/** 当前手势捕获的唯一指针。 */
let pointer: number | null = null
/** 当前指针的捕获元素。 */
let grip: HTMLElement | null = null
/** 当前手势所属的最近弹层,嵌套时只操作本层。 */
let panel: HTMLElement | null = null
/** 手势起始横坐标。 */
let startX = 0
/** 手势起始纵坐标。 */
let startY = 0
/** 最近一段移动的起始纵坐标。 */
let recentY = 0
/** 最近一段移动的起始时刻。 */
let recentTime = 0
/** 最近一次移动时刻。 */
let lastTime = 0
/** 最近一次移动纵坐标。 */
let lastY = 0
/** 当前视觉位移,仅更新实际弹层的transform,不触发整棵正文重排。 */
let offset = 0
/** 拖动后的兼容click不能被误判为键盘关闭。 */
let lastPointerInteraction = -Infinity
/** 回位或离场动画计时,关闭和卸载时释放。 */
let timer: ReturnType<typeof setTimeout> | undefined
/** 释放当前手势的指针捕获。 */
function release() {
const id = pointer
pointer = null
if (id !== null && grip?.hasPointerCapture?.(id)) grip.releasePointerCapture(id)
grip = null
}
/** 清理动画、位移及手势,防止重新打开或切换布局后沿用旧状态。 */
function reset() {
clearTimeout(timer)
release()
panel?.classList.remove('is-panel-dragging', 'is-panel-settling')
panel?.removeAttribute('data-drag-dismissed')
panel?.style.removeProperty('transform')
panel = null
offset = 0
}
/**
* 回到展开状态或沿拖动方向离场,完成后才请求原弹层关闭。
* @param dismiss 是否达到关闭条件
*/
function settle(dismiss: boolean) {
release()
if (!panel) return
clearTimeout(timer)
const target = panel
target.classList.remove('is-panel-dragging')
target.classList.add('is-panel-settling')
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches
target.style.transform = dismiss ? 'translate3d(0, 100%, 0)' : 'translate3d(0, 0, 0)'
timer = setTimeout(
() => {
if (dismiss && props.active && !props.disabled && panel === target) {
target.setAttribute('data-drag-dismissed', '')
emit('dismiss')
} else reset()
},
reduced ? 0 : 180
)
}
/**
* 只从手柄开始拖动,忽略非主指针、额外触点及提交锁。
* @param event 手柄上的指针按下
*/
function start(event: PointerEvent) {
if (!props.active || props.disabled || pointer !== null || !event.isPrimary || event.button !== 0) return
reset()
grip = event.currentTarget as HTMLElement
panel = grip.closest<HTMLElement>('.app-mobile-panel')
if (!panel) return
pointer = event.pointerId
lastPointerInteraction = Date.now()
startX = event.clientX
startY = recentY = lastY = event.clientY
recentTime = lastTime = event.timeStamp
grip.setPointerCapture?.(pointer)
panel.classList.add('is-panel-dragging')
event.preventDefault()
}
/**
* 跟随手指,仅允许向下明显移动;上拉保留轻微阻尼。
* @param event 已捕获指针的移动
*/
function move(event: PointerEvent) {
if (event.pointerId !== pointer || !panel || props.disabled) return
if (event.timeStamp - recentTime > 100) {
recentY = lastY
recentTime = lastTime
}
lastY = event.clientY
lastTime = event.timeStamp
const distance = event.clientY - startY
offset = distance >= 0 ? distance : -Math.min(20, Math.sqrt(-distance) * 1.5)
panel.style.transform = `translate3d(0, ${offset}px, 0)`
event.preventDefault()
}
/**
* 向下拉到阈值或明确向下快速甩动后关闭,横向移动和轻触仍回位。
* @param event 指针释放
*/
function finish(event: PointerEvent) {
if (event.pointerId !== pointer || !panel) return
lastPointerInteraction = Date.now()
const distance = event.clientY - startY
const velocity = (event.clientY - recentY) / Math.max(1, event.timeStamp - recentTime)
const threshold = Math.min(140, Math.max(72, panel.getBoundingClientRect().height * 0.18))
const downward = distance > Math.abs(event.clientX - startX)
settle(!props.disabled && downward && (distance >= threshold || (distance >= 48 && velocity >= 0.65)))
}
/**
* 系统取消或丢失捕获时回位,不把未完成手势解释成关闭。
* @param event 被取消的指针
*/
function cancel(event: PointerEvent) {
if (event.pointerId === pointer) settle(false)
}
/**
* 读屏或键盘激活仍可直接关闭,普通手指轻触手柄不关闭。
* @param event 手柄激活事件
*/
function activate(event: MouseEvent) {
if (event.detail === 0 && Date.now() - lastPointerInteraction > 500 && props.active && !props.disabled)
emit('dismiss')
}
/**
* 键盘直接关闭,不受刚刚发生的指针手势影响。
* @param event 键盘激活事件
*/
function keyboardClose(event: KeyboardEvent) {
if (!event.repeat && props.active && !props.disabled) emit('dismiss')
}
watch(
() => [props.active, props.disabled],
() => {
if (props.disabled && panel) settle(false)
else if (props.active || !panel?.hasAttribute('data-drag-dismissed')) reset()
}
)
onBeforeUnmount(reset)
</script>
<template>
<!-- 以下是仅在手机端挂载的横条,44px触控区与正文滚动分开。 -->
<button
type="button"
class="mobile-panel-handle"
aria-label="向下拖动关闭弹窗"
:disabled="disabled"
@pointerdown="start"
@pointermove="move"
@pointerup="finish"
@pointercancel="cancel"
@lostpointercapture="cancel"
@click="activate"
@keydown.enter.prevent="keyboardClose"
@keydown.space.prevent="keyboardClose"
>
<span aria-hidden="true" />
</button>
</template>
<style>
.mobile-panel-handle {
position: absolute;
inset: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 44px;
padding: 0;
border: 0;
background: transparent;
color: var(--app-muted);
cursor: grab;
touch-action: none;
user-select: none;
}
.mobile-panel-handle > span {
width: 40px;
height: 4px;
border-radius: 0;
background: currentColor;
}
.mobile-panel-handle:active {
cursor: grabbing;
}
.mobile-panel-handle:focus-visible {
outline-offset: -4px;
}
.app-mobile-panel.is-panel-dragging {
transition: none !important;
}
.app-mobile-panel.is-panel-settling {
transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1) !important;
}
/* 交给原弹层完成焦点释放;已拖离视口的面板不重复播放离场动画。 */
.app-mobile-panel[data-drag-dismissed] {
transform: translate3d(0, 100%, 0) !important;
opacity: 0 !important;
transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
.app-mobile-panel.is-panel-settling {
transition-duration: 0.01ms !important;
}
}
</style>
+42
View File
@@ -0,0 +1,42 @@
<script setup lang="ts">
import { NCollapse, NCollapseItem } from 'naive-ui'
/** 详情仅展示调用方明确选择的业务字段,不序列化接口对象。 */
defineProps<{
/** 普通用户可理解的详情名称。 */ title: string
/** 外层已折叠时直接显示记录,避免重复展开。 */ inline?: boolean
/** 每条历史记录的标题与业务内容。 */ records: Array<{
/** 可选的时间、版本或记录名称。 */ title?: string
/** 中文字段,不接收原始接口对象。 */ fields: Array<{
/** 字段名称。 */ label: string
/** 仅允许可读文本或数量。 */ value?: string | number | null
}>
}>
}>()
</script>
<template>
<!-- 以下是按需查看的中文记录,没有接口字段、指纹或整段响应。 -->
<component :is="inline ? 'div' : NCollapse" v-if="records.length" class="mt-3">
<component
:is="inline ? 'div' : NCollapseItem"
:name="inline ? undefined : 'records'"
:title="inline ? undefined : title"
>
<article v-for="(record, index) in records" :key="index" class="mb-4 last:mb-0">
<h4 v-if="record.title" class="mb-2 text-sm font-medium">{{ record.title }}</h4>
<dl class="detail-grid text-xs">
<template v-for="(field, fieldIndex) in record.fields" :key="fieldIndex">
<dt>{{ field.label }}</dt>
<dd class="whitespace-pre-wrap wrap-anywhere">
{{
field.value === null || field.value === undefined || field.value === ''
? '未记录'
: field.value
}}
</dd>
</template>
</dl>
</article>
</component>
</component>
</template>
+10 -2
View File
@@ -10,6 +10,8 @@ const props = defineProps<{
placement?: PopoverProps['placement']
/** 按钮仅在手机端隐藏文字时,只在对应窄屏显示说明。 */
mobileOnly?: boolean
/** 详情已打开时停用重复提示,避免覆盖当前内容。 */
disabled?: boolean
}>()
/** 与项目工具栏隐藏文字的断点保持一致。 */
const compactMedia = props.mobileOnly ? window.matchMedia('(max-width: 639px)') : null
@@ -28,8 +30,14 @@ onScopeDispose(() => compactMedia?.removeEventListener('change', syncCompact))
<template>
<!-- 以下是图标操作的统一悬浮说明,不额外增加布局容器 -->
<NPopover trigger="hover" :placement="placement ?? 'bottom-end'" :disabled="mobileOnly && !compact">
<NPopover
trigger="hover"
:placement="placement ?? 'bottom-end'"
:disabled="disabled || (mobileOnly && !compact)"
:to="true"
:flip="true"
>
<template #trigger><slot /></template>
{{ label }}
<span class="block max-w-[min(320px,calc(100vw-48px))] whitespace-normal wrap-anywhere">{{ label }}</span>
</NPopover>
</template>
+21 -2
View File
@@ -1,12 +1,17 @@
<script setup lang="ts">
import FieldLabel from './FieldLabel.vue'
/** 工作区模块标题、说明及操作位置的统一展示参数。 */
interface Props {
/** 模块标题。 */
title: string
/** 可选功能块序标,只表达阅读顺序,不表示进度或审核结果。 */
marker?: string
/** 操作放右侧同行或说明下方左侧;默认保持已有页面布局。 */
actionsPlacement?: 'right' | 'below'
/** 模块说明,可通过 description 插槽补充状态与提示。 */
description?: string
/** 非必要说明按需查看,动态状态插槽始终保留在正文。 */
descriptionAsInfo?: boolean
}
/** 标题与说明由业务模块提供,操作通过插槽复用统一对齐方式。 */
@@ -17,13 +22,23 @@ defineProps<Props>()
<!-- 以下是统一的模块标题与可选同行操作模块 -->
<header class="workspace-section-heading">
<div class="workspace-section-heading-row">
<h3 class="text-sm font-semibold">{{ title }}</h3>
<h3 class="flex items-center gap-2 text-sm font-semibold">
<span v-if="marker" class="workspace-section-marker" aria-hidden="true">{{ marker }}</span>
{{ title
}}<FieldLabel
v-if="descriptionAsInfo && description && !$slots.description"
:label="title"
:description="description"
icon-only
icon="info"
/>
</h3>
<div v-if="$slots.actions && actionsPlacement !== 'below'" class="workspace-section-heading-actions">
<slot name="actions" />
</div>
</div>
<!-- 以下是标题下方的说明与状态模块 -->
<div v-if="description || $slots.description" class="workspace-section-description">
<div v-if="$slots.description || (description && !descriptionAsInfo)" class="workspace-section-description">
<slot name="description">{{ description }}</slot>
</div>
<!-- 以下是正文左侧的模块操作,与标题及说明共用边界 -->
@@ -38,6 +53,10 @@ defineProps<Props>()
.workspace-section-heading-row {
@apply flex min-w-0 flex-wrap items-center justify-between gap-3;
}
/* 罗马序标提供稳定的视觉锚点,使用中性主题色,不暗示步骤通过。 */
.workspace-section-marker {
@apply inline-flex h-8 min-w-8 shrink-0 items-center justify-center bg-(--app-control) px-2 text-lg font-medium leading-none text-ink;
}
.workspace-section-heading-actions {
@apply flex shrink-0 flex-wrap items-center gap-3;
}
+21
View File
@@ -0,0 +1,21 @@
import { onScopeDispose, ref } from 'vue'
/**
* 与公共弹窗的手机断点同步,旋转或调整窗口时即时更新。
* @returns 当前是否使用手机面板布局
*/
export function useMobileViewport() {
const query = window.matchMedia('(max-width: 639px)')
/** 手机布局只由当前视口决定,不写入用户偏好。 */
const mobile = ref(query.matches)
/**
* 同步视口断点。
* @param event 媒体查询变化
*/
function update(event: MediaQueryListEvent) {
mobile.value = event.matches
}
query.addEventListener('change', update)
onScopeDispose(() => query.removeEventListener('change', update))
return mobile
}
+22
View File
@@ -0,0 +1,22 @@
import { ref, watch, type Ref } from 'vue'
/**
* 公共弹层仅在正文离开顶部后提示遮挡,重新开关时清除旧状态。
* @param open 当前弹层显隐
* @returns 正文滚动状态与滚动事件入口
*/
export function usePanelScrollState(open: Readonly<Ref<boolean>>) {
/** 只表达正文顶部是否有被遮挡内容,不跟随内部输入框滚动。 */
const bodyScrolled = ref(false)
/**
* 读取真实滚动容器的位置,回到顶部即时隐藏阴影。
* @param event 公共正文滚动事件
*/
function onBodyScroll(event: Event) {
bodyScrolled.value = ((event.target as HTMLElement | null)?.scrollTop ?? 0) > 0
}
watch(open, () => {
bodyScrolled.value = false
})
return { bodyScrolled, onBodyScroll }
}
@@ -2,7 +2,6 @@
import { computed, onScopeDispose, ref, shallowRef, watch } from 'vue'
import { NButton, NCheckbox, NInput, NInputNumber } from 'naive-ui'
import { AssetImage } from '../../../components/ui'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import { useQuery } from '../../../composables/useQuery'
import { errorMessage } from '../../../lib/http'
import { useActionMessage } from '../../../components/ui/useActionMessage'
@@ -17,6 +16,15 @@ const props = defineProps<{
/** 已存人工记录。 */ review: ContinuityReview
/** 项目活动锁。 */ disabled: boolean
}>()
/**
* 使用本次审核的顺序说明图片归属,不显示内部镜头编号。
* @param shotId 原绑定镜头
* @returns 可读的审核范围位置
*/
function reviewShotLabel(shotId: string) {
const index = props.review.diagnosis.frames.findIndex(frame => frame.shotId === shotId)
return index < 0 ? '范围待核对' : `审核范围第 ${index + 1} 镜`
}
/** 把写入锁与变化交给原抽屉。 */
const emit = defineEmits<{ busy: [boolean]; changed: [] }>()
/** 当前免费计划。 */
@@ -318,11 +326,11 @@ defineExpose({ canAuthorize, canExecute, canResume, authorize, execute, resume }
{{ image.pixels.height }}
</p>
<p v-for="(binding, i) in image.bindings" :key="i">
{{ binding.shotId }} ·
{{ reviewShotLabel(binding.shotId) }} ·
{{ binding.role === 'frame' ? '镜头首帧' : '空间参考(不代表人物或道具状态)' }}
</p>
</div>
<RawDataDetails title="高级详情:最终脱敏请求、图片摘要与全部绑定" :value="plan" />
<template
v-if="plan.status === 'ready' && plan.executionAvailable && plan.capability.verified && !uncertain"
>
@@ -369,15 +377,7 @@ defineExpose({ canAuthorize, canExecute, canResume, authorize, execute, resume }
</p>
<p>{{ task.data.value.summary }}</p>
<p>人工原签收和非阻断未知保持原样,机器新观察不会自动覆盖。</p>
<RawDataDetails
title="原机器评估、解析观察与用量(独立追溯)"
:value="{
diagnosis: task.data.value.diagnosis,
machineObservation: task.data.value.machineObservation,
step: task.data.value.step,
feeScope: task.data.value.feeScope
}"
/>
<WorkflowExecutionPanel
v-if="execution.query.data.value?.id === task.data.value.executionId"
:execution="execution.query.data.value"
@@ -398,6 +398,7 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
title="跨镜连续性审核"
description="免费核对相邻两到三镜的固定结构与所选人工状态,各范围独立签收,不自动修改主首帧。"
:busy="busy"
description-as-info
>
<div class="space-y-6">
<!-- 以下是独立签收范围选择,切换后重新读取指纹 -->
@@ -412,8 +413,9 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
/>
<section class="space-y-3">
<WorkspaceSectionHeading
title="选择审核范围"
title="选择相邻的两到三镜"
description="选择同一场景形态下、同集正式顺序连续的两到三镜。"
description-as-info
/>
<NSelect
:value="selected"
@@ -479,6 +481,7 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
镜头 {{ item.spec.beatNo }}.{{ item.spec.shotNo }} · {{ item.spec.title }}
</h3>
<AssetImage
class="h-[min(32dvh,280px)] aspect-auto"
:src="item.primary?.imageUrl"
:style="{
aspectRatio:
@@ -491,7 +494,8 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
object-fit="contain"
empty-text="暂无当前主首帧"
/>
<p class="wrap-anywhere text-xs text-muted">当前主首帧:{{ item.primary?.id || '未设置' }}</p>
<p class="text-xs text-muted">{{ item.primary ? '已设置主首帧' : '尚未设置主首帧' }}</p>
<p class="text-sm">
镜头设计:{{
[
@@ -534,21 +538,6 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
)
}}
</p>
<NCollapse
v-if="
diagnosis?.frames.find(frame => frame.shotId === item.spec.shotId)?.formalSourceFingerprint
"
>
<NCollapseItem name="source" title="高级来源详情">
<pre class="whitespace-pre-wrap break-words text-xs">{{
JSON.stringify(
diagnosis.frames.find(frame => frame.shotId === item.spec.shotId),
null,
2
)
}}</pre>
</NCollapseItem>
</NCollapse>
</article>
</section>
<!-- 以下是当前布局母版、场景形态当前性及历史版本模块 -->
@@ -571,12 +560,18 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
<div v-for="layout in sceneSources.data.value.layouts" :key="layout.id" class="space-y-3">
<p class="text-sm">
{{ layout.name }} ·
<span class="wrap-anywhere text-xs text-muted">当前版本:{{ layout.version }}</span>
<span class="text-xs text-muted">已读取当前布局</span>
</p>
<p v-if="!layout.masters.length" class="text-sm text-muted">暂无适用布局母版。</p>
<div class="continuity-frame-grid">
<article v-for="master in layout.masters" :key="master.id" class="space-y-2 min-w-0">
<AssetImage :src="master.imageUrl" alt="布局母版" preview object-fit="contain" />
<AssetImage
class="h-[min(32dvh,280px)] aspect-auto"
:src="master.imageUrl"
alt="布局母版"
preview
object-fit="contain"
/>
<p class="text-sm">
{{ master.subjectFormId ? '当前场景形态机位' : '全局布局母版' }} ·
{{
@@ -595,6 +590,7 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
<WorkspaceSectionHeading
title="人工观察"
description="相对已确认布局核对观察面与地标顺序。只记录固定结构位置和完整可辨数量;开门、关门属于即时状态。无法判断时请保留未知。"
description-as-info
/>
<div class="continuity-landmarks">
<NInput
@@ -674,6 +670,7 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
<WorkspaceSectionHeading
title="读取历史审核"
description="刷新后恢复本机最近审核,也可填写已有审核编号。"
description-as-info
/>
<div class="flex items-end gap-2">
<NInput
@@ -710,13 +707,6 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
{{ userFacingText(issue.message) }}
</p></template
>
<NCollapse
><NCollapseItem name="original" title="原始诊断">
<pre class="whitespace-pre-wrap break-words text-xs">{{
JSON.stringify(reviewQuery.data.value.diagnosis, null, 2)
}}</pre>
</NCollapseItem></NCollapse
>
</article>
</section>
<!-- 以下是已存有序组的联合审核计划与单次批准 -->
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NButton, NInput, NSelect } from 'naive-ui'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { stateDimensions, type StateCheck, type StateContext } from '../continuity-state'
/** 正式有序组与操作锁。 */
const props = defineProps<{ /** 正式上下文。 */ contexts: StateContext[]; /** 操作锁。 */ disabled: boolean }>()
@@ -60,11 +60,18 @@ function boundary(check: StateCheck, value: string) {
<p class="text-muted">
逐项核对原图和正式依据。无法辨认留空;出画不等于主体消失。交接或开关变化须有前镜实际动作及后镜本主体状态支持,不能只凭勾选依据判为一致。
</p>
<RawDataDetails
<RecordDetails
v-for="(context, i) in contexts"
:key="context.shotId"
:title="`第 ${i + 1} 镜正式状态与动作`"
:value="context"
:records="[
{
fields: context.sources.map(source => ({
label: source.executable ? '本镜动作' : '正式状态依据',
value: [source.subjectRef, source.text].filter(Boolean).join(' · ')
}))
}
]"
/>
<section v-for="(check, index) in checks" :key="index" class="space-y-3 bg-(--app-subtle) p-4">
<NSelect
@@ -120,7 +127,7 @@ function boundary(check: StateCheck, value: string) {
:options="
sources(check).map(s => ({
value: s.id,
label: `${s.shotId === check.fromShotId ? '前镜' : '后镜'} · ${s.subjectRef ?? '镜头'} · ${s.field} · ${s.text}${s.executable ? '(本镜实际执行)' : ''}`
label: `${s.shotId === check.fromShotId ? '前镜' : '后镜'} · ${s.subjectRef ?? '镜头'} · ${s.text}${s.executable ? '(本镜实际执行)' : ''}`
}))
"
:disabled="disabled"
@@ -1,9 +1,8 @@
<script setup lang="ts">
import { ClipboardCheck, ScanEye, Pencil, History } from '@lucide/vue'
import { ClipboardCheck, ScanEye, Pencil, History, Info } from '@lucide/vue'
import WorkspaceActionTooltip from '../../../components/ui/WorkspaceActionTooltip.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { productionMessage } from '../production-messages'
import { useKeyframeVision } from '../keyframe-vision'
import { computed, ref, watch } from 'vue'
@@ -13,7 +12,7 @@ import {
effectiveQualityLabels,
keyframeQualitySummary
} from '../effective-keyframe-quality'
import { NButton, NTag } from 'naive-ui'
import { NButton, NTag, NPopover } from 'naive-ui'
import { AssetImage, AssetOpenLink, StatusBadge } from '../../../components/ui'
import { formatDate } from '../../../lib/format'
import { productionStatusLabel } from '../model'
@@ -21,6 +20,7 @@ import type { ShotKeyframe } from '../types'
/** 首帧卡片统一主图标识、质量结论和晋升限制。 */
const props = defineProps<{
/** 镜头名称及稳定图片序号,由完整资产列表生成,仅用于展示。 */ displayName?: string
/** 摄影审核只读嵌入,保留图片与历史入口,不开放生成/编辑/采用。 */ readonly?: boolean
item: ShotKeyframe
/** 正式项目归属,用于查询候选审核。 */
@@ -40,10 +40,13 @@ const props = defineProps<{
}>()
/** 用户显式打开来源复核,不能自动调用模型。 */
const sourceReviewOpen = ref(false)
/** 模型、错误与来源信息按需查看,切换候选即关闭旧详情。 */
const detailsOpen = ref(false)
watch(
() => JSON.stringify([props.projectId, props.shotId, props.item.id]),
() => {
sourceReviewOpen.value = false
detailsOpen.value = false
},
{ flush: 'sync' }
)
@@ -134,8 +137,8 @@ const canSelect = computed(
/>
<AssetOpenLink :src="item.status === 'completed' ? item.imageUrl : null" label="打开图片" />
</div>
<div class="p-3">
<div class="flex flex-wrap items-center gap-2">
<div class="keyframe-card-body">
<div class="keyframe-card-status">
<StatusBadge :status="item.status" :label="productionStatusLabel(item.status)" />
<NTag v-if="item.source !== 'provider_variant'" size="small" :bordered="false">
{{ item.isPrimary ? '主首帧' : '候选首帧' }}
@@ -159,136 +162,174 @@ const canSelect = computed(
</NTag>
<NTag v-if="item.source === 'provider_variant'" size="small" :bordered="false">视频参考图</NTag>
<NTag v-if="item.isPrimary && stale" size="small" type="warning" :bordered="false">已过期</NTag>
<!-- 以下是完整尺寸信息模块,数据缺失时隐藏 -->
<span v-if="item.width && item.height" class="text-[10px] text-muted"
>{{ item.width }} × {{ item.height }}</span
>
</div>
<!-- 以下是候选的来源、画幅与后台审核状态 -->
<p
v-if="effectiveStatus === 'stale' && reviewQuery.data.value && !reviewQuery.error.value"
class="mt-2 text-xs text-muted"
>
{{ keyframeQualitySummary(reviewQuery.data.value.qualityDecision, effectiveStatus) }}
</p>
<p v-if="item.provider || item.model" class="mt-2 wrap-anywhere text-xs text-muted">
{{ [item.provider, item.model].filter(Boolean).join(' / ') }}
</p>
<p
v-if="item.canvasDiagnosis && item.status === 'completed'"
class="mt-2 text-xs"
:class="wrongCanvas ? 'text-danger' : 'text-muted'"
>
{{
wrongCanvas
? `历史画幅 ${item.canvasDiagnosis.actual ?? '未知'} 与交付画幅 ${item.canvasDiagnosis.expected ?? '未知'} 不符,仅供查看。`
: item.canvasDiagnosis.status === 'matched'
? `匹配交付画幅 ${item.canvasDiagnosis.expected}`
: '画幅尚未确认'
}}
</p>
<p
v-if="vision.state.value.active || vision.state.value.unknown || vision.uncertain.value"
role="status"
class="mt-2 text-xs text-muted"
>
{{ vision.state.value.active?.executionId ? '质量审核在后台进行' : '审核结果或费用待核查' }}
</p>
<IssueHint v-if="item.error" :messages="[productionMessage(item.error)]" type="error" />
<!-- 以下是来源记录与独立的免费恢复入口 -->
<p v-if="item.inputSnapshotStatus" class="mt-2 text-xs text-muted">
{{
{ recorded: '已保存生成输入', 'not-recorded': '历史生成输入未记录', invalid: '生成输入证据已失效' }[
item.inputSnapshotStatus
]
}}
<span v-if="item.providerInputFingerprint" :title="item.providerInputFingerprint">
· {{ item.providerInputFingerprint.slice(0, 12) }}</span
<!-- 名称固定单行,完整文字可在悬停或图片详情中核对。 -->
<h4 class="keyframe-card-name" :title="displayName || `镜头 ${shotNo} · 首帧`">
{{ displayName || `镜头 ${shotNo} · 首帧` }}
</h4>
<!-- 列表保留创建时间,详细模型、错误和来源只在主动展开时显示。 -->
<p class="text-[10px] text-muted">{{ formatDate(item.createdAt) }}</p>
<div class="keyframe-card-actions">
<!-- 浮层挂到视口层,避免被候选弹窗和内容滚动边界裁切。 -->
<NPopover
v-model:show="detailsOpen"
trigger="click"
placement="bottom-start"
:show-arrow="false"
:to="true"
:flip="true"
>
</p>
<p v-if="item.recoveryRequired" class="mt-2 text-xs text-muted">
{{
productionMessage(
item.recoveryReason ||
(item.canRecoverSavedResult
? '可以恢复已生成图片的下载。'
: '原请求结果待核查,请先核对候选和模型服务记录。')
)
}}
</p>
<NButton
v-if="item.canRecoverSavedResult && !readonly"
class="mt-2"
size="small"
:disabled="blocked || recovering"
:loading="recovering"
@click="emit('recover')"
>恢复已生成图片</NButton
>
<p class="mt-2 text-[10px] text-muted">{{ formatDate(item.createdAt) }}</p>
<!-- 以下是集中排列的首帧辅助图标操作,提示与无障碍名称一致 -->
<div v-if="item.status === 'completed' && item.imageUrl" class="mt-4 flex flex-wrap items-center gap-2">
<WorkspaceActionTooltip
placement="top"
v-if="item.isPrimary && projectId && !readonly"
label="按当前来源人工复核"
<template #trigger>
<span class="inline-flex">
<WorkspaceActionTooltip placement="top" label="查看首帧详情" :disabled="detailsOpen">
<NButton square class="workspace-action-button icon-button" aria-label="查看首帧详情"
><Info :size="17"
/></NButton>
</WorkspaceActionTooltip>
</span>
</template>
<section class="keyframe-card-details" aria-label="首帧详情">
<p class="text-sm font-semibold">{{ displayName || `镜头 ${shotNo} · 首帧` }}</p>
<p v-if="item.width && item.height" class="mt-2 text-xs text-muted">
{{ item.width }} × {{ item.height }}
</p>
<!-- 以下是候选的来源、画幅与后台审核状态 -->
<p
v-if="effectiveStatus === 'stale' && reviewQuery.data.value && !reviewQuery.error.value"
class="mt-2 text-xs text-muted"
>
{{ keyframeQualitySummary(reviewQuery.data.value.qualityDecision, effectiveStatus) }}
</p>
<p v-if="item.provider || item.model" class="mt-2 wrap-anywhere text-xs text-muted">
{{ [item.provider, item.model].filter(Boolean).join(' / ') }}
</p>
<p
v-if="item.canvasDiagnosis && item.status === 'completed'"
class="mt-2 text-xs"
:class="wrongCanvas ? 'text-danger' : 'text-muted'"
>
{{
wrongCanvas
? `历史画幅 ${item.canvasDiagnosis.actual ?? '未知'} 与交付画幅 ${item.canvasDiagnosis.expected ?? '未知'} 不符,仅供查看。`
: item.canvasDiagnosis.status === 'matched'
? `匹配交付画幅 ${item.canvasDiagnosis.expected}`
: '画幅尚未确认'
}}
</p>
<p
v-if="vision.state.value.active || vision.state.value.unknown || vision.uncertain.value"
role="status"
class="mt-2 text-xs text-muted"
>
{{ vision.state.value.active?.executionId ? '质量审核在后台进行' : '审核结果或费用待核查' }}
</p>
<p v-if="item.error" class="mt-2 text-xs">{{ productionMessage(item.error) }}</p>
<!-- 以下是来源记录与独立的免费恢复入口 -->
<p v-if="item.inputSnapshotStatus" class="mt-2 text-xs text-muted">
{{
{
recorded: '已保存生成输入',
'not-recorded': '历史生成输入未记录',
invalid: '生成输入证据已失效'
}[item.inputSnapshotStatus]
}}
</p>
<p v-if="item.recoveryRequired" class="mt-2 text-xs text-muted">
{{
productionMessage(
item.recoveryReason ||
(item.canRecoverSavedResult
? '可以恢复已生成图片的下载。'
: '原请求结果待核查,请先核对候选和模型服务记录。')
)
}}
</p>
</section>
</NPopover>
<NButton
v-if="item.canRecoverSavedResult && !readonly"
size="small"
:disabled="blocked || recovering"
:loading="recovering"
@click="emit('recover')"
>恢复已生成图片</NButton
>
<NButton
square
class="workspace-action-button icon-button"
aria-label="按当前来源人工复核"
@click="sourceReviewOpen = true"
><ClipboardCheck :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip
placement="top"
v-if="!wrongCanvas && !stale && !readonly"
:label="qualityActionLabel"
>
<NButton
square
class="workspace-action-button icon-button"
:aria-label="qualityActionLabel"
@click="emit('quality')"
><ScanEye :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip
placement="top"
v-if="item.source !== 'provider_variant' && !wrongCanvas && !stale && !readonly"
label="编辑此首帧"
>
<NButton
square
class="workspace-action-button icon-button"
:disabled="blocked"
:loading="editing"
aria-label="编辑此首帧"
@click="emit('edit')"
><Pencil :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip placement="top" label="查看首帧校验历史">
<NButton
square
class="workspace-action-button icon-button"
aria-label="查看首帧校验历史"
@click="emit('history')"
><History :size="17"
/></NButton>
</WorkspaceActionTooltip>
<NButton v-if="canSelect" :disabled="blocked" text size="small" @click="emit('select')">
设为主首帧
</NButton>
<!-- 以下是集中排列的首帧辅助图标操作,提示与无障碍名称一致 -->
<template v-if="item.status === 'completed' && item.imageUrl">
<WorkspaceActionTooltip
placement="top"
v-if="item.isPrimary && projectId && !readonly"
label="按当前来源人工复核"
>
<NButton
square
class="workspace-action-button icon-button"
aria-label="按当前来源人工复核"
@click="sourceReviewOpen = true"
><ClipboardCheck :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip
placement="top"
v-if="!wrongCanvas && !stale && !readonly"
:label="qualityActionLabel"
>
<NButton
square
class="workspace-action-button icon-button"
:aria-label="qualityActionLabel"
@click="emit('quality')"
><ScanEye :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip
placement="top"
v-if="item.source !== 'provider_variant' && !wrongCanvas && !stale && !readonly"
label="编辑此首帧"
>
<NButton
square
class="workspace-action-button icon-button"
:disabled="blocked"
:loading="editing"
aria-label="编辑此首帧"
@click="emit('edit')"
><Pencil :size="17"
/></NButton>
</WorkspaceActionTooltip>
<WorkspaceActionTooltip placement="top" label="查看首帧校验历史">
<NButton
square
class="workspace-action-button icon-button"
aria-label="查看首帧校验历史"
@click="emit('history')"
><History :size="17"
/></NButton>
</WorkspaceActionTooltip>
<NPopover
v-if="canSelect"
:show="confirming && canSelect"
trigger="manual"
placement="top"
:show-arrow="false"
:to="true"
:flip="true"
@clickoutside="emit('cancel')"
>
<template #trigger>
<NButton :disabled="blocked" text size="small" @click="emit('select')">设为主首帧</NButton>
</template>
<!-- 人工采用确认独立于卡片排版,保持列表等高及原确认门禁。 -->
<ContextNotice type="info" :show-icon="false" class="keyframe-card-details text-xs">
<p>该候选已满足当前质量要求。确认让后续视频使用此首帧?</p>
<div class="mt-2 flex gap-3">
<NButton type="primary" :disabled="blocked" @click="emit('confirm')">确认切换</NButton>
<NButton text size="small" @click="emit('cancel')">取消</NButton>
</div>
</ContextNotice>
</NPopover>
</template>
</div>
<ContextNotice v-if="confirming && canSelect" type="info" :show-icon="false" class="mt-2 text-xs">
<p>该候选已满足当前质量要求。确认让后续视频使用此首帧?</p>
<div class="mt-2 flex gap-3">
<NButton type="primary" :disabled="blocked" @click="emit('confirm')">确认切换</NButton>
<NButton text size="small" @click="emit('cancel')">取消</NButton>
</div>
</ContextNotice>
</div>
</article>
<SourceReviewDrawer
@@ -300,3 +341,35 @@ const canSelect = computed(
@changed="onSourceChanged"
/>
</template>
<style>
@reference "../../../styles/styles.css";
/* 卡片自身保留中性底面与正方形画面,不依赖生产页面是否已加载。 */
.keyframe-card {
@apply flex h-full min-w-0 flex-col rounded-none bg-(--app-subtle);
}
.keyframe-card .asset-image {
@apply aspect-square rounded-none;
}
/* 状态和操作使用稳定槽位,短卡片也将操作对齐至底部。 */
.keyframe-card-body {
@apply flex flex-1 flex-col gap-2 p-3;
}
.keyframe-card-status {
@apply flex min-h-[22px] flex-wrap items-center gap-1.5;
}
.keyframe-card-name {
@apply truncate text-sm font-medium leading-5;
}
.keyframe-card-actions {
@apply mt-auto flex min-h-[34px] flex-wrap items-center gap-2;
}
/* 详情浮层保持可读宽度与独立滚动,不撑高任何图片卡片。 */
.keyframe-card-details {
width: min(340px, calc(100vw - 64px));
max-height: min(480px, 65dvh);
overflow-y: auto;
overflow-wrap: anywhere;
white-space: normal;
}
</style>
@@ -9,6 +9,7 @@ import ImageGenerationPreview from '../../subject-images/components/ImageGenerat
import { useImageGenerationPreview, type ImageGenerationSubmission } from '../../subject-images/generation-preview'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem } from 'naive-ui'
@@ -155,6 +156,16 @@ const boundedBudget = computed(() =>
)
: null
)
/** 仅有真实阻断或可选许可时展示人工准入,普通有效授权不常驻未知费用说明。 */
const showAdditionalOptions = computed(
() =>
canInspectAdditional.value &&
(!!additionalId.value ||
!!additionalOptions.value.length ||
additionalQuery.loading.value ||
!!additionalQuery.error.value ||
additionalQuery.data.value?.billingBlocked)
)
watch(
[() => props.projectId, () => props.shotId, open],
() => {
@@ -287,6 +298,7 @@ watch(
:title="`${replacePrimary ? '生成替代候选' : '生成首帧候选'} · ${shotTitle}`"
description="新图通过检查后可设为主首帧。"
:busy="submitting"
description-as-info
>
<AppForm
ref="formRef"
@@ -319,16 +331,21 @@ watch(
生成模型目录读取失败:{{ generationCatalogError }}
</ContextNotice>
<!-- 以下是用户主动选择的原精确计划追加许可,普通unknown不放行。 -->
<section v-if="canInspectAdditional" class="workspace-section-stack mt-5">
<p class="text-sm">
原请求和费用仍未知。只可使用已单独批准的有限许可,重新预览核对精确计划;不会自动追加或消费剩余次数。
<section v-if="showAdditionalOptions" class="workspace-panel workspace-section-stack mt-5">
<p v-if="additionalQuery.data.value?.billingBlocked" class="text-sm">
原请求在途或费用待核对。有限许可不会核清旧费用。
</p>
<FieldLabel
label="人工有限许可"
description="只作用于已批准的镜头和精确计划;每次由你主动操作,不自动消耗剩余次数。"
icon="info"
/>
<NSelect
v-model:value="additionalId"
clearable
:options="additionalOptions"
:disabled="submitting || additionalQuery.loading.value"
placeholder="主动选择已有人工追加许可(可不选,仅免费预览)"
placeholder="选择人工有限许可(可选)"
aria-label="本次人工追加许可"
/><NButton
:loading="additionalQuery.loading.value"
@@ -338,7 +355,7 @@ watch(
>
<p v-if="additionalQuery.error.value" role="alert">{{ additionalQuery.error.value }}</p>
<p v-if="additionalParent" class="text-sm">
原镜头 {{ additionalParent.input.targetId }} · 原型号 {{ additionalParent.input.model }} · 原预留
原型号 {{ additionalParent.input.model }} · 原预留
{{ formatMicros(additionalParent.input.reservedMicros) }} · 原账单
{{ formatMicros(additionalParent.output?.actualBilledMicros) }}
</p>
@@ -346,6 +363,28 @@ watch(
本镜已用 {{ boundedTarget.usedRequests }}/{{ boundedTarget.maxRequests }} 次 · 原预算剩余
{{ formatMicros(boundedBudget?.remainingMicros) }}。旧未知费用未被核清。
</p>
<RecordDetails
v-if="additionalPermit"
title="许可记录"
:records="[
{
fields: [
{
label: '适用方式',
value:
additionalPermit.input.mode === 'bounded'
? '限定镜头与计划'
: '同一计划人工追加'
},
{ label: '批准人', value: additionalPermit.input.approvedBy },
{ label: '批准说明', value: additionalPermit.input.approvalNote },
{ label: '批准次数', value: additionalPermit.input.maxRequests },
{ label: '已用次数', value: additionalPermit.usedRequests },
{ label: '剩余次数', value: additionalPermit.remainingRequests }
]
}
]"
/>
</section>
<!-- 以下是正式摄影设计与画面状态 -->
<ModelCapabilities
@@ -401,7 +440,9 @@ watch(
/>
<!-- 以下是正式画幅、尺寸及连续性诊断 -->
<KeyframePreviewChecks v-if="preview" :preview="preview" class="mt-3" />
<p v-if="chargeNotice" class="text-sm text-muted" role="status">{{ chargeNotice }}</p>
<ContextNotice v-if="chargeNotice" emphasized :show-icon="false" role="status">{{
chargeNotice
}}</ContextNotice>
<NCheckbox
v-if="requiresCostConfirmation"
id="confirm-keyframe-cost"
@@ -42,9 +42,7 @@ const label = computed(() => {
<p>{{ label }} · {{ executionStageLabel(execution.stage) }}</p>
<p v-if="execution.total > 0">审核计划进度:{{ execution.current }} / {{ execution.total }}</p>
<p v-else>尚无可确认的步骤进度。</p>
<p class="wrap-anywhere text-xs text-muted">
执行编号:{{ execution.id }} · {{ formatDate(execution.updatedAt) }}
</p>
<p class="wrap-anywhere text-xs text-muted">更新于 {{ formatDate(execution.updatedAt) }}</p>
<p v-if="typeof execution.result?.summary === 'string'">
历史执行摘要:{{ userFacingText(execution.result.summary) }}
</p>
@@ -6,7 +6,7 @@ import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, ref, watch } from 'vue'
import { NButton, NInput, NCollapse, NCollapseItem } from 'naive-ui'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { useQuery } from '../../../composables/useQuery'
import { imageAuthorizationApi } from '../../image-authorization/api'
import { formatMicros } from '../../image-authorization/model'
@@ -339,21 +339,37 @@ const records = computed(() =>
<p v-if="generationRecords.loading.value" role="status">正在读取原图片请求…</p>
<p v-else-if="generationRecords.error.value" role="alert">{{ generationRecords.error.value }}</p>
<p v-else-if="!generationRecords.data.value?.length" class="text-xs text-muted">
未找到此图片的原OpenAI费用记录;不据此推断费用为0。
暂无这张图片的费用记录,不能据此判断免费。
</p>
<article
v-for="row in generationRecords.data.value ?? []"
:key="row.id"
class="my-3 space-y-2 text-xs wrap-anywhere"
aria-label="原图片生成记录"
>
<p>原请求 {{ row.id }} · {{ generationStatusLabels[row.status] ?? '待确认' }}</p>
<p>原图片生成:{{ generationStatusLabels[row.status] ?? '待确认' }}</p>
<p>
原预留 {{ formatMicros(row.input.reservedMicros) }} · 公开用量价
{{ formatMicros(row.output?.usageCostMicros) }} · 实际账单
{{ formatMicros(row.output?.actualBilledMicros) }}
</p>
<p v-if="row.billingAudit?.released">费用已核清;原执行、机器质量及主首帧状态保持独立。</p>
<RawDataDetails :value="row" title="原模型、来源、精确计划与回执" />
<RecordDetails
inline
title="当次生成记录"
:records="[
{
fields: [
{ label: '模型', value: row.input.model },
{ label: '生成范围', value: '本镜头的原图片' },
{
label: '使用许可',
value: row.input.additionalAuthorizationId ? '人工有限许可' : '原图片授权'
}
]
}
]"
/>
</article>
</NCollapseItem>
</NCollapse>
@@ -436,7 +452,6 @@ const records = computed(() =>
<p>补跑要求:原通用检查已通过;本次仅补跑一个物理步骤,不重复提交通用检查。</p>
<p>物理专项原失败原因:{{ userFacingText(physicalTarget.error, '原物理回执未能形成有效结果。') }}</p>
<p>原费用已记录,保留原回执;本次需要独立授权,可能产生新费用。</p>
<p class="wrap-anywhere text-xs text-muted">原审核任务:{{ physicalTarget.id }}</p>
</template>
<p v-else>原审核已人工终止,未标记通过。请填写已取得的独立授权编号,新审核可能产生费用。</p>
<NInput
@@ -479,11 +494,9 @@ const records = computed(() =>
: '暂无结论'
}}
</p>
<p class="mt-2 wrap-anywhere text-xs text-muted">审核任务:{{ record.id }}</p>
<section v-if="record.legacyTermination" class="mt-2 space-y-1 text-sm">
<p>历史审核已人工终止,原任务状态:{{ stepLabels[record.status] ?? '待确认' }};未标记通过。</p>
<p>人工终止时间:{{ formatDate(record.legacyTermination.terminatedAt) }}</p>
<p class="wrap-anywhere">审计编号:{{ record.legacyTermination.auditId }}</p>
<p>
费用结论:{{
{
@@ -512,9 +525,7 @@ const records = computed(() =>
</p>
<p v-if="record.recoveryReason" class="text-muted">{{ userFacingText(record.recoveryReason) }}</p>
<p v-if="record.error" class="text-danger">{{ userFacingText(record.error) }}</p>
<p v-if="record.sourceReviewId" class="wrap-anywhere text-sm">
独立新来源审核 · 人工记录 {{ record.sourceReviewId }}(与旧 Vision 分开存证)
</p>
<p v-if="record.sourceReviewId" class="wrap-anywhere text-sm">已按新来源独立审核,旧审核记录仍保留。</p>
<template v-if="record.validation">
<p>合并结论:{{ userFacingText(record.validation.summary) }}</p>
<p v-for="(issue, index) in record.validation.issues" :key="index" class="text-danger">
@@ -4,12 +4,7 @@ import { formatDate } from '../../../lib/format'
import { userFacingText } from '../../../lib/user-facing-text'
import type { KeyframeValidationStep } from '../quality.types'
import type { ValidationExecutionStep } from '../validation-executions.types'
import {
validationQualityLabels,
validationStatusLabels,
validationStepNames,
validationUsageLabels
} from '../validation-execution-labels'
import { validationQualityLabels, validationStatusLabels, validationStepNames } from '../validation-execution-labels'
/** 原任务摘要与逐次执行共用公开步骤展示,复用用量不重复归入本次。 */
defineProps<{
@@ -47,7 +42,9 @@ function stepTitle(step: KeyframeValidationStep | ValidationExecutionStep) {
: '执行方式未记录'
}}
</p>
<p v-if="step.usageAttribution === 'reused'" class="text-muted">以下为原调用计量,不重复计入本次。</p>
<p v-if="step.usageAttribution === 'reused'" class="text-muted">
本步骤复用原调用,不重复计入本次费用。
</p>
<p v-else-if="step.usageAttribution === 'unknown'" class="text-muted">
计量归属未记录,不能推算本次费用。
</p>
@@ -59,19 +56,15 @@ function stepTitle(step: KeyframeValidationStep | ValidationExecutionStep) {
</ul>
<p v-else class="mt-2 text-xs text-muted">{{ step.issues ? '未记录问题。' : '未记录问题证据。' }}</p>
<p v-if="step.error" class="mt-2 text-sm">{{ userFacingText(step.error) }}</p>
<!-- 以下是必要的原始请求、时间和计量,默认收起 -->
<!-- 步骤时间与调用方式按需核对,内部请求与原始计量留在数据层。 -->
<NCollapse class="mt-2"
><NCollapseItem name="diagnostics" title="高级详情">
><NCollapseItem name="diagnostics" title="步骤记录">
<dl class="space-y-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-if="'sourceExecutionId' in step && step.sourceExecutionId">
复用来源执行:{{ step.sourceExecutionId }}
</div>
<div v-if="'usageAttribution' in step">
计量归属:{{
调用方式:{{
step.usageAttribution === 'this_execution'
? '本次新调用'
: step.usageAttribution === 'reused'
@@ -79,10 +72,6 @@ function stepTitle(step: KeyframeValidationStep | ValidationExecutionStep) {
: '未记录'
}}
</div>
<div v-for="(count, unit) in step.usage" :key="unit">
{{ validationUsageLabels[unit] }}词元:{{ count }}
</div>
<div v-if="!step.usage || !Object.keys(step.usage).length">未记录计量。</div>
</dl>
</NCollapseItem></NCollapse
>
@@ -2,6 +2,7 @@
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NSelect } from 'naive-ui'
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { useActionMessage, showActionFeedback } from '../../../components/ui/useActionMessage'
import { ApiError, errorMessage } from '../../../lib/http'
import { layoutApi, type ConfirmedLayout, type LayoutSupplementPreview } from '../layout-api'
@@ -200,7 +201,7 @@ async function confirmLayout() {
placeholder="选择当前布局"
aria-label="待审结构布局"
/>
<p v-if="layout" class="wrap-anywhere text-xs text-muted">当前布局版本:{{ layout.version }}</p>
<p v-if="layout" class="text-xs text-muted">已读取当前布局,保存前会再次核对版本。</p>
<NInput
v-model:value="instruction"
type="textarea"
@@ -218,23 +219,42 @@ async function confirmLayout() {
:input-props="{ 'aria-label': '布局结构依据' }"
/>
<NButton :loading="loading" :disabled="!valid || saving" @click="loadPreview">免费预览结构约束</NButton>
<!-- 以下是待审提示词、独立指纹与正式确认参数模块 -->
<!-- 以下是待审画面描述与完整业务约束,版本保护仍使用原始参数。 -->
<section v-if="preview" class="space-y-3 text-sm">
<p>待审输入不能用于生图;需要确认布局并重新确认母版。</p>
<NCollapse>
<NCollapseItem name="preview" title="预览画面描述与高级详情">
<NCollapseItem name="preview" title="预览画面描述">
<pre class="whitespace-pre-wrap break-words text-xs">{{ preview.providerPrompt }}</pre>
<dl class="mt-3 space-y-2 wrap-anywhere text-xs text-muted">
<div>待审指纹:{{ preview.draftFingerprint }}</div>
<div>可用于生产:{{ preview.productionReady ? '是' : '否' }}</div>
<div>需要布局确认:{{ preview.requiresLayoutConfirmation ? '是' : '否' }}</div>
<div>需要母版重新确认:{{ preview.requiresMasterReconfirmation ? '是' : '否' }}</div>
</dl>
<pre class="mt-3 whitespace-pre-wrap break-words text-xs">{{
JSON.stringify(preview.layoutConfirmation, null, 2)
}}</pre>
</NCollapseItem>
</NCollapse>
<RecordDetails
title="本次完整布局约束"
:records="[
{
fields: [
{ label: '布局', value: preview.layoutConfirmation.name },
{ label: '依据', value: preview.layoutConfirmation.evidence }
]
},
...preview.layoutConfirmation.constraints.map((constraint, index) => ({
title: `约束 ${index + 1}`,
fields: [
{ label: '要求', value: constraint.description },
{ label: '来源', value: constraint.source === 'script' ? '剧本事实' : '人工美术设计' },
{ label: '画面要求', value: constraint.keyframeInstruction },
...(constraint.compositionRules ?? []).flatMap(rule => [
{ label: '构图要求', value: rule.requirement },
{ label: '验收依据', value: rule.acceptance }
])
]
}))
]"
/>
<WorkspaceSectionHeading
title="正式布局确认"
description="保存会改变布局版本。母版、场景形态及已有首帧需要重新核对,不会自动生成素材。"
@@ -252,8 +272,6 @@ async function confirmLayout() {
<!-- 以下是版本变化与最新母版来源影响,不自动生成或替换主图 -->
<section v-if="confirmed" class="space-y-2 wrap-anywhere text-sm" role="status">
<p class="font-semibold">布局已更新</p>
<p class="text-xs">原版本:{{ confirmed.previous }}</p>
<p class="text-xs">新版本:{{ confirmed.layout.version }}</p>
<p>
布局母版:{{
layouts
@@ -340,7 +340,7 @@ const rules = computed(() => ({
...sizeRules(() => formModel.value)
}))
/** 更多参数折叠状态。 */
const optionsExpanded = ref<string[]>(['options'])
const optionsExpanded = ref<string[]>([])
</script>
<template>
@@ -497,6 +497,7 @@ const optionsExpanded = ref<string[]>(['options'])
</NCollapse>
<ContextNotice
v-if="!visionHistoryRef?.authorizationAvailable && !(visionKey && action === 'validate')"
emphasized
type="warning"
:show-icon="false"
class="mt-4"
@@ -562,7 +563,6 @@ 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>
<!-- 以下是底栏左侧费用确认与右侧操作按钮模块 -->
<template #footer>
<div class="quality-dialog-footer">
@@ -1,5 +1,4 @@
<script setup lang="ts">
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import { userFacingText } from '../../../lib/user-facing-text'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
@@ -189,7 +188,6 @@ function exportResult() {
<p v-for="issue in subject.issues" :key="issue">{{ issue }}</p>
</div>
</template>
<RawDataDetails :value="receipt.result" />
</NCollapseItem>
</NCollapse>
</section>
@@ -23,7 +23,14 @@ import ConfirmAction from '../../workflows/ConfirmAction.vue'
import { runOperation } from '../../workflows/operations'
import { productionApi } from '../api'
import { qualityApi } from '../quality-api'
import { isActiveVideo, primaryKeyframe, primaryVideo, productionStatusLabel, videoRecordedValidation } from '../model'
import {
isActiveVideo,
primaryKeyframe,
primaryVideo,
productionStatusLabel,
videoRecordedValidation,
keyframeDisplayNames
} from '../model'
import { productionIssueText, productionMessage, videoInputStaleReason } from '../production-messages'
import type {
GenerateKeyframeInput,
@@ -205,6 +212,8 @@ const currentVideoInput = computed(() =>
videoInputQuery.data.value?.shotId === key.value ? videoInputQuery.data.value : null
)
const keyframes = computed(() => query.data.value?.keyframes ?? [])
/** 主图与候选共用完整记录的名称,晋升或倒序查看不重新编号。 */
const keyframeNames = computed(() => keyframeDisplayNames(keyframes.value, props.shot.title, props.shot.shotNo))
/** 下载回执丢失或刷新后,只用列表明确保存的恢复结果解除同镜头的保护。 */
watch(keyframes, rows => {
const shotId = props.shot.shotId
@@ -857,6 +866,7 @@ defineExpose({ inspectSpecs, inspecting })
:shot-id="shot.shotId"
:review-revision="reviewRevision"
:item="currentKeyframe"
:display-name="keyframeNames.get(currentKeyframe.id)"
:editing="
editSource?.id === currentKeyframe.id &&
isOperationRunning(getOperation(projectId), `编辑镜头 ${shot.shotId} 首帧`)
@@ -1185,12 +1195,13 @@ defineExpose({ inspectSpecs, inspecting })
>
<!-- 候选图片和对应的人工复核入口按相同候选 ID 分组。 -->
<div v-if="keyframeCandidates.length" class="asset-candidate-grid mt-4">
<div v-for="item in keyframeCandidates" :key="item.id" class="min-w-0">
<div v-for="item in keyframeCandidates" :key="item.id" class="min-w-0 h-full">
<KeyframeCard
:project-id="projectId"
:shot-id="shot.shotId"
:review-revision="reviewRevision"
:item="item"
:display-name="keyframeNames.get(item.id)"
:recovering="isOperationRunning(getOperation(projectId), `恢复已生成首帧 ${item.id}`)"
@recover="recoverSavedKeyframe(item)"
:editing="
@@ -1283,7 +1294,12 @@ defineExpose({ inspectSpecs, inspecting })
>
</template>
</AppDrawer>
<AppDialog v-model:open="historyOpen" title="首帧记录" :busy="historyAuthorizationPending" wide>
<AppDialog
v-model:open="historyOpen"
:title="`首帧记录 · ${keyframeNames.get(historyKeyframeId) ?? '当前图片'}`"
:busy="historyAuthorizationPending"
wide
>
<div v-if="historyOpen && historyKeyframeId" :key="historyKeyframeId" class="workspace-section-stack">
<!-- 以下是按需读取的候选生成证据 -->
<KeyframeInputDetails :project-id="projectId" :shot-id="shot.shotId" :keyframe-id="historyKeyframeId" />
@@ -1364,18 +1380,6 @@ defineExpose({ inspectSpecs, inspecting })
.video-grid {
@apply grid w-full max-w-[260px] grid-cols-1 gap-3;
}
/* 候选画面固定 260px,最多五列;列数减少时仍保持左右边缘对齐。 */
.asset-candidate-grid {
@apply grid w-full max-w-[1348px] items-start gap-3;
grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 260px));
justify-content: space-between;
}
.keyframe-card {
@apply min-w-0 overflow-hidden rounded-none bg-(--app-subtle);
}
.keyframe-card .asset-image {
@apply aspect-square rounded-none;
}
/* 素材背景与标题铺满外层内容宽度。 */
.video-input-section {
width: 100%;
@@ -1416,10 +1420,6 @@ defineExpose({ inspectSpecs, inspecting })
.video-grid {
@apply max-w-none;
}
/* 手机候选按整行展示,避免固定 260px 造成侧边留白。 */
.asset-candidate-grid {
@apply max-w-none grid-cols-[minmax(0,_1fr)];
}
/* 窄屏优先并排展示两列;素材较少时仍等分占满可用宽度。 */
.video-input-grid {
grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
@@ -1,6 +1,6 @@
<script setup lang="ts">
import SourceApplicabilityFields from './SourceApplicabilityFields.vue'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { computed, watch } from 'vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NInputNumber, NSelect } from 'naive-ui'
import AppDrawer from '../../../components/ui/AppDrawer.vue'
@@ -49,6 +49,33 @@ const findingOptions = [
{ label: '通过', value: 'passed' },
{ label: '不通过', value: 'failed' }
]
/** 历史人工观察只显示维度、意见和事实,保留原记录用于后续核对。 */
const observationRecords = computed(() => {
const review = form.record.value?.review
if (!review) return []
return [
{
fields: [
{ label: '审核人', value: review.reviewer },
{ label: '复核理由', value: review.reason }
]
},
...review.observations.map(observation => ({
title: `比较参考 ${observation.imageNumber}`,
fields: [
...Object.entries(sourceFindingLabels).map(([dimension, label]) => ({
label,
value:
findingOptions.find(
option =>
option.value === observation.finding[dimension as keyof typeof sourceFindingLabels]
)?.label ?? '未知/无法看清'
})),
{ label: '可见事实', value: observation.note }
]
}))
]
})
/** 正式动作只从当前预检原文解析,不用编号或关键词猜测。 */
const formalActions = computed(() => {
const raw = form.preview.value?.applicabilityBasis?.facts.rawJson
@@ -82,7 +109,7 @@ const referenceRoleLabels: Record<string, string> = {
'style-scene': '场景风格',
'style-prop': '道具风格'
}
/** 同图同主体合并职责,完整原始绑定仍保留在高级详情。 */
/** 同图同主体合并职责,原始绑定继续用于来源保护。 */
const referenceSummaries = computed(
() =>
new Map(
@@ -134,6 +161,7 @@ const statusLabels: Record<string, string> = {
title="按当前来源人工复核"
description="人工观察、机器审核与跨镜验收分别进行;不会生图或替换主首帧。"
:busy="busy"
description-as-info
>
<div class="source-review-body">
<!-- 以下是当前有效质量摘要,人工观察通过不代表机器质量通过 -->
@@ -180,24 +208,32 @@ const statusLabels: Record<string, string> = {
<WorkspaceSectionHeading
title="保留的原主首帧"
description="点击小图查看原图。当前参考仅用于比较,不代表原图生成时已使用。"
description-as-info
/>
<p v-if="form.restored.value && form.targetMatched.value" class="text-sm text-muted">
已读取当前有效的原观察和依据,无需重复填写或保存;只需修改变化项,未知仍保持未知。
</p>
<RawDataDetails
title="历史输入、图片摘要与来源变化"
:value="{
originalProviderInput: form.preview.value.originalProviderInput,
historicalVision: form.preview.value.historicalVision,
originalPixels: form.preview.value.originalPixels,
sourceChanges: form.preview.value.sourceChanges
}"
<RecordDetails
title="原图片生成记录"
:records="[
{
fields: [
{ label: '原模型', value: form.preview.value.originalProviderInput.model },
{
label: '原画面描述',
value: form.preview.value.originalProviderInput.providerPrompt
},
{ label: '历史审核次数', value: form.preview.value.historicalVision.length }
]
}
]"
/>
</div>
</section>
<WorkspaceSectionHeading
title="本次新参考与逐图观察"
description="新参考仅是本次比较依据,不是原图的生成输入。结构看不清时保留未知,并逐项核对本镜是否需要该证据。"
description-as-info
/>
<!-- 以下是正式动作和适用范围的核对依据 -->
<section v-if="form.preview.value.applicabilityBasis" class="space-y-2 text-sm">
@@ -208,15 +244,10 @@ const statusLabels: Record<string, string> = {
? '固定机位'
: '非固定或尚未确认的机位'
}}
· 正式动作
{{ form.preview.value.applicabilityBasis.actionIds?.join('、') || '未提供,不能判为非阻断' }}
· {{ formalActions.length ? `${formalActions.length} 项正式动作` : '正式动作依据待核对' }}
</p>
<p v-for="action in formalActions" :key="action.id">{{ action.id }}:{{ action.description }}</p>
<p v-if="!formalActions.length">未读到完整正式动作原文,请核对高级详情;不能凭动作编号猜测依赖。</p>
<RawDataDetails
title="核对完整正式动作、摄影与即时状态"
:value="form.preview.value.applicabilityBasis.facts"
/>
<p v-for="action in formalActions" :key="action.id">{{ action.description }}</p>
<p v-if="!formalActions.length">缺少正式动作原文,请先核对当前分镜;不能据此豁免审核。</p>
</section>
<!-- 以下是逐参考的小图与核对表单,必要的未知范围按需展开 -->
<div class="source-review-reference-grid">
@@ -337,13 +368,7 @@ const statusLabels: Record<string, string> = {
<p v-if="form.record.value.invalidation" class="text-sm text-muted">
{{ userFacingText(form.record.value.invalidation) }}
</p>
<NCollapse
><NCollapseItem title="原始人工观察" name="observations">
<pre class="whitespace-pre-wrap wrap-anywhere text-xs">{{
JSON.stringify(form.record.value.review, null, 2)
}}</pre>
</NCollapseItem></NCollapse
>
<RecordDetails title="原始人工观察" :records="observationRecords" />
<NButton
:loading="form.pending.value === 'plan'"
:disabled="
@@ -368,13 +393,6 @@ const statusLabels: Record<string, string> = {
}}
· 最多请求 {{ form.plan.value.steps.length }} 次
</p>
<NCollapse
><NCollapseItem title="完整计划及指纹" name="plan">
<pre class="whitespace-pre-wrap wrap-anywhere text-xs">{{
JSON.stringify(form.plan.value, null, 2)
}}</pre>
</NCollapseItem></NCollapse
>
<NCollapse
><NCollapseItem name="paid-approval" title="准备独立付费审核(按需展开)"
><div class="flex flex-col gap-4">
@@ -470,7 +488,7 @@ const statusLabels: Record<string, string> = {
/>
<p v-if="resultLabel" class="text-sm" role="status">{{ resultLabel }}</p>
<!-- 以下是默认收起的历史追溯,不让已结束执行干扰当前观察 -->
<NCollapse v-if="form.result.value || form.vision.history.data.value?.some(item => item.sourceReviewId)"
<NCollapse v-if="form.vision.history.data.value?.some(item => item.sourceReviewId)"
><NCollapseItem name="source-history" title="历史审核与执行记录">
<section
v-for="record in form.vision.history.data.value?.filter(r => r.sourceReviewId)"
@@ -478,7 +496,7 @@ const statusLabels: Record<string, string> = {
class="space-y-2"
>
<p class="wrap-anywhere text-sm">
独立新来源审核 · 人工记录 {{ record.sourceReviewId }} · 原任务 {{ record.id }} ·
独立新来源审核 ·
{{ userFacingText(record.status) }}
</p>
<KeyframeExecutionHistory
@@ -487,16 +505,8 @@ const statusLabels: Record<string, string> = {
:keyframe-id="keyframeId"
:validation-task-id="record.id"
/>
</section>
<NCollapse v-if="form.result.value"
><NCollapseItem title="本次完整回执(完成不等于通过)" name="receipt">
<pre class="whitespace-pre-wrap wrap-anywhere text-xs">{{
JSON.stringify(form.result.value, null, 2)
}}</pre>
</NCollapseItem></NCollapse
>
</NCollapseItem></NCollapse
>
</section> </NCollapseItem
></NCollapse>
<NButton class="self-start" :loading="form.vision.history.loading.value" @click="refreshQuality"
>只读刷新审核历史</NButton
>
@@ -3,6 +3,14 @@ import { NCollapse, NCollapseItem } from 'naive-ui'
import { AssetImage } from '../../../components/ui'
import { validationStepNames } from '../validation-execution-labels'
import { validationImageUrl, type ValidationPreview } from '../validation-preview'
/** 参考职责使用业务名称,未知职责只说明图片参考,不展示内部枚举。 */
const referenceRoleLabels: Record<string, string> = {
'identity-anchor': '主体外观',
'form-primary': '形态参考',
'layout-master': '空间布局',
'scene-form-view': '场景机位',
'structure-reference': '固定结构'
}
/** 免费普通审核计划;不提供任何自动执行入口。 */
defineProps<{ /** 当前只读计划。 */ plan: ValidationPreview }>()
</script>
@@ -50,7 +58,6 @@ defineProps<{ /** 当前只读计划。 */ plan: ValidationPreview }>()
object-fit="contain"
preview
/>
<p class="wrap-anywhere text-xs">SHA:{{ plan.image.sha256 }}</p>
</div>
<div v-for="reference in plan.references" :key="reference.imageNumber" class="min-w-0 space-y-2">
<p>审核图片 {{ reference.imageNumber }} · 生成参考 {{ reference.generationImageNumber }}</p>
@@ -62,9 +69,8 @@ defineProps<{ /** 当前只读计划。 */ plan: ValidationPreview }>()
preview
/>
<p v-for="(binding, index) in reference.bindings" :key="index">
{{ binding.subjectRef }} · {{ binding.role }}
{{ binding.subjectRef }} · {{ referenceRoleLabels[binding.role] || '图片参考' }}
</p>
<p class="wrap-anywhere text-xs">SHA:{{ reference.sha256 }}</p>
</div>
</div>
</NCollapseItem></NCollapse
+16
View File
@@ -1,6 +1,22 @@
import { reactive } from 'vue'
import type { ProductionIssueCode, ProductionSession, ShotKeyframe, ShotVideo, ShotVideoQualityStatus } from './types'
/**
* 为没有独立名称字段的首帧生成展示名称,按原创建时间编号,不随列表倒序或主图切换改名。
* @param items 同一镜头的完整图片记录
* @param shotTitle 当前镜头名称
* @param shotNo 镜头序号,用于名称缺失时说明归属
* @returns 图片ID与只用于展示的名称,不写回资产
*/
export function keyframeDisplayNames(items: readonly ShotKeyframe[], shotTitle: string, shotNo: number) {
const title = shotTitle.trim() || `镜头 ${shotNo}`
return new Map(
items
.toSorted((a, b) => (a.createdAt ?? '').localeCompare(b.createdAt ?? '') || a.id.localeCompare(b.id))
.map((item, index) => [item.id, `${title} · 图片 ${String(index + 1).padStart(2, '0')}`])
)
}
/** 按项目隔离生产回执,切换页面后仍能查看上一次批量操作结果。 */
const sessions = reactive<Record<string, ProductionSession>>({})
+14 -6
View File
@@ -12,6 +12,7 @@ import { userFacingText } from '../../lib/user-facing-text'
import { isOperationRunning } from '../workflows/operations'
import ContextNotice from '../../components/ui/ContextNotice.vue'
import FieldLabel from '../../components/ui/FieldLabel.vue'
import AppForm from '../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
@@ -504,7 +505,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
fullscreen
>
<!-- 以下是按正式 Episode、Beat、Shot 选择的生成范围。 -->
<section class="workspace-section-stack" aria-label="派生镜头范围">
<section class="workspace-panel workspace-section-stack" aria-label="派生镜头范围">
<label class="workspace-form-field"
><span>生成范围</span
><NSelect
@@ -625,7 +626,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</AppForm>
</section>
<!-- 以下是完整项目进度,仅在生成配置中核对。 -->
<p v-if="projectDesignGap" class="text-sm text-muted">
<p v-if="projectDesignGap" class="workspace-panel text-sm text-muted">
全项目:摄影 {{ projectDesignGap.directionCount }}/{{ projectDesignGap.shotCount }} · 画面
{{ projectDesignGap.visualStateCount }}/{{ projectDesignGap.shotCount }}
<span v-if="projectDesignGap.staleDirectionCount || projectDesignGap.staleVisualStateCount">
@@ -899,13 +900,20 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
段落 {{ shot.beatNo }} · 镜头 {{ shot.shotNo }}
<span v-if="shot.durationSeconds" class="ml-3">{{ shot.durationSeconds }}s</span>
</p>
<h3 class="mt-2 text-lg font-semibold">{{ shot.title }}</h3>
<div class="mt-2 flex items-center gap-2">
<h3 class="text-lg font-semibold">{{ shot.title }}</h3>
<FieldLabel
v-if="shot.visualFocus"
label="视觉重点"
:description="shot.visualFocus"
icon-only
icon="info"
verbatim
/>
</div>
<p v-if="shot.description" class="mt-3 whitespace-pre-wrap text-sm leading-7">
{{ shot.description }}
</p>
<p v-if="shot.visualFocus" class="mt-2 text-xs leading-6 text-muted">
视觉重点:{{ shot.visualFocus }}
</p>
</header>
<div>
<NTabs v-model:value="detailTab" type="line" size="small" aria-label="镜头详情"
@@ -9,24 +9,41 @@ const cameraPosition = defineModel<string>('cameraPosition', { required: true })
</script>
<template>
<!-- 以下是两种摄影修订共用的字段,使用真实纵向间距。 -->
<div class="workspace-section-stack">
<label class="workspace-form-field"
<div class="workspace-form-stack camera-fields-layout">
<label class="workspace-form-field camera-fields-composition"
><span>构图</span
><NInput
v-model:value="composition"
class="workspace-prose-input"
type="textarea"
:disabled="disabled"
aria-label="摄影构图"
:autosize="{ minRows: 3, maxRows: 8 }"
/></label>
<label class="workspace-form-field"
><span>摄影机位置</span
><NInput
v-model:value="cameraPosition"
type="textarea"
:disabled="disabled"
aria-label="摄影机位置"
:autosize="{ minRows: 3, maxRows: 8 }"
:autosize="{ minRows: 4, maxRows: 12 }"
/></label>
<div class="workspace-form-stack">
<label class="workspace-form-field"
><span>摄影机位置</span
><NInput
v-model:value="cameraPosition"
class="workspace-prose-input"
type="textarea"
:disabled="disabled"
aria-label="摄影机位置"
:autosize="{ minRows: 3, maxRows: 8 }"
/></label>
<!-- 联合编辑可把摄影意图放在机位下方,沿用同一套摄影字段。 -->
<slot name="intent" />
</div>
</div>
</template>
<style>
/* 宽屏缩短长文行宽,构图与机位标签对齐;窄屏保持原单列表单。 */
@media (min-width: 1280px) {
.camera-fields-layout {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
align-items: start;
}
}
</style>
@@ -220,6 +220,7 @@ defineExpose({ saving, canAdopt, adopt })
<WorkspaceSectionHeading
title="先修订摄影"
description="免费预检并采用摄影修改,不生成画面状态。已有下游结果时需使用原组合修订。"
description-as-info
/>
<NButton :disabled="saving" :loading="source.loading.value" @click="reloadSource">重新读取正式来源</NButton>
<p v-if="sourceConflict" role="alert">来源或原摄影版本已变化。当前输入保留,请重新读取并核对后再预检。</p>
@@ -15,25 +15,30 @@ const environmentFields = ['timeOfDay', 'weather', 'atmosphere', 'transientState
</script>
<template>
<!-- 以下是原摄影编辑器共用字段,摄影枚举和正式动作保持只读。 -->
<div class="workspace-section-stack">
<div class="workspace-form-stack">
<DirectionCameraFields
v-model:composition="draft.direction.composition"
v-model:camera-position="draft.direction.cameraPosition"
:disabled="disabled"
/>
<label class="workspace-form-field"
><span>摄影意图</span
><NInput
v-model:value="draft.direction.visualIntent"
type="textarea"
:disabled="disabled"
:maxlength="4000"
aria-label="联合摄影意图"
/></label>
>
<template #intent>
<label class="workspace-form-field"
><span>摄影意图</span
><NInput
v-model:value="draft.direction.visualIntent"
class="workspace-prose-input"
type="textarea"
:autosize="{ minRows: 3, maxRows: 6 }"
:disabled="disabled"
:maxlength="4000"
aria-label="联合摄影意图"
/></label>
</template>
</DirectionCameraFields>
<!-- 以下是可选环境修订,完整差异及本集原文在同一联合面板核对。 -->
<NCollapse>
<NCollapse class="workspace-collapse" display-directive="show">
<NCollapseItem name="environment" title="环境修订(需本集原文)">
<div class="workspace-section-stack">
<div class="workspace-form-stack">
<label v-for="field in environmentFields" :key="field" class="workspace-form-field">
<span>{{ jointFieldLabels[field] }}</span>
<NInput
@@ -47,33 +52,40 @@ const environmentFields = ['timeOfDay', 'weather', 'atmosphere', 'transientState
</label>
</div>
</NCollapseItem>
<!-- 以下是原正式主体的开拍状态,不能修改主体集合与形态身份。 -->
<NCollapseItem
v-for="subject in draft.visualState.subjects"
:key="subject.subjectRef"
:name="subject.subjectRef"
:title="`${subject.formName} · ${subject.subjectRef} · 当前开拍状态`"
>
<section class="workspace-form-stack">
<label v-for="field in fields" :key="field" class="workspace-form-field"
><span>{{ jointFieldLabels[field] }}</span
><NInput
v-model:value="subject[field]"
type="textarea"
:maxlength="4000"
:disabled="disabled"
:aria-label="`${subject.subjectRef} · ${jointFieldLabels[field]}`"
/></label>
</section>
</NCollapseItem>
<NCollapseItem name="continuity" title="衔接与时间依据">
<label class="workspace-form-field"
><span>衔接与时间依据</span
><NInput
v-model:value="draft.visualState.continuityNote"
type="textarea"
:maxlength="4000"
:disabled="disabled"
aria-label="联合衔接与时间依据"
/></label>
<VisualStateContinuity
v-if="draft.visualState.continuityNote"
:note="draft.visualState.continuityNote"
/>
</NCollapseItem>
</NCollapse>
<!-- 以下是原正式主体的开拍状态,不能修改主体集合与形态身份。 -->
<section
v-for="subject in draft.visualState.subjects"
:key="subject.subjectRef"
class="workspace-section-stack"
>
<h4 class="text-sm font-medium">{{ subject.formName }} · {{ subject.subjectRef }} · 当前开拍状态</h4>
<label v-for="field in fields" :key="field" class="workspace-form-field"
><span>{{ jointFieldLabels[field] }}</span
><NInput
v-model:value="subject[field]"
type="textarea"
:maxlength="4000"
:disabled="disabled"
:aria-label="`${subject.subjectRef} · ${jointFieldLabels[field]}`"
/></label>
</section>
<label class="workspace-form-field"
><span>衔接与时间依据</span
><NInput
v-model:value="draft.visualState.continuityNote"
type="textarea"
:maxlength="4000"
:disabled="disabled"
aria-label="联合衔接与时间依据"
/></label>
<VisualStateContinuity v-if="draft.visualState.continuityNote" :note="draft.visualState.continuityNote" />
</div>
</template>
@@ -2,11 +2,12 @@
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput } from 'naive-ui'
import { WorkspaceSectionHeading } from '../../../components/ui'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { useActionMessage } from '../../../components/ui/useActionMessage'
import { useQuery } from '../../../composables/useQuery'
import { ApiError, errorMessage } from '../../../lib/http'
import { userFacingText } from '../../../lib/user-facing-text'
import { formatDate } from '../../../lib/format'
import { preparationApi } from '../../storyboard-preparation/api'
import { currentStoryboardApproval } from '../../storyboard-preparation/model'
import { productionApi } from '../../production/api'
@@ -17,7 +18,7 @@ import { runOperation, getOperation } from '../../workflows/operations'
import { storyboardApi } from '../api'
import { mergeDesignedShots } from '../model'
import { derivedReviewApi } from '../derived-review-api'
import { draftFromFormal } from '../derived-review'
import { draftFromFormal, cameraRevisionSummaries } from '../derived-review'
import { jointDraftDifferences, jointValue } from '../joint-review'
import type {
DerivedReviewSelection,
@@ -117,6 +118,20 @@ const source = useQuery(key, async (value, signal) => {
})
/** 原保存记录的修订和状态只由正式GET更新。 */
const saved = computed(() => source.data.value?.saved)
/** 联合模式保留原摄影修订历史,仅展示可读的前后变化。 */
const cameraHistoryRecords = computed(() =>
cameraRevisionSummaries(source.data.value?.shot.direction?.rawJson).map((event, index) => ({
title: `第 ${index + 1} 次摄影修订`,
fields: [
{ label: '审核人', value: event.reviewer },
{ label: '采用时间', value: event.adoptedAt ? formatDate(event.adoptedAt) : '未记录' },
{ label: '原构图', value: event.beforeComposition },
{ label: '采用后构图', value: event.afterComposition },
{ label: '原机位', value: event.beforePosition },
{ label: '采用后机位', value: event.afterPosition }
]
}))
)
/** 全部变化都展示,越界变化不能通过过滤后提交。 */
const differences = computed(() =>
source.data.value && draft.value ? jointDraftDifferences(source.data.value.formal, draft.value) : []
@@ -499,71 +514,127 @@ async function adopt() {
}
/** 同一抽屉固定底栏复用当前模式操作。 */
defineExpose({ saving, savingKind, canSave, canAdopt, save, adopt })
/** 可见功能块依次编号;条件区域隐藏时不留下跳号,也不作为业务步骤状态。 */
const sectionMarkers = computed(() => {
const keys = ['source']
if (draft.value && source.data.value) {
keys.push('history', 'draft', 'differences')
if (hasEnvironmentChanges.value) keys.push('environment')
keys.push('preview', 'confirmation')
if (formalPreview.value) keys.push('formalPreview')
}
const numerals = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII']
return Object.fromEntries(keys.map((sectionKey, index) => [sectionKey, numerals[index]]))
})
</script>
<template>
<!-- 以下是联合模式的来源与已保存原稿,技术版本默认收起。 -->
<div class="workspace-section-stack">
<WorkspaceSectionHeading
title="摄影与开拍状态联合修订"
description="保留主体、形态与动作事实。环境变化需本集原文依据,保存与正式采用分别执行。"
/>
<NButton class="self-start" :disabled="saving" :loading="source.loading.value" @click="reload"
>重新读取正式来源与草案</NButton
>
<p v-if="source.loading.value" role="status">正在核对完整正式来源…</p>
<p v-if="source.error.value" role="alert">{{ source.error.value }}</p>
<p v-if="saved" class="text-sm">
已保存第 {{ saved.revision }} 版 ·
{{
saved.status === 'current'
? '来源当前有效'
: saved.staleReason
? userFacingText(saved.staleReason)
: '原草案来源已变化,请重新核对'
}}。保存记录不代表正式采用。
</p>
<p v-if="conflict" role="alert">
来源、草案或相邻镜头版本发生冲突。当前输入已保留,请重新读取并核对后再次免费预检。
</p>
<p v-if="adopted" role="status">
{{
adopted.reused ? '同一联合修订已采用,本次为幂等回读。' : '联合修订已正式采用。'
}}原草案和历史保留;图片生成、视觉审核及主图确认仍须分别操作。
</p>
<div class="workspace-section-stack workspace-numbered-sections">
<!-- 来源、读取与草案状态为同一功能组,组内间距保持紧凑。 -->
<section class="workspace-section-stack workspace-numbered-section">
<WorkspaceSectionHeading
:marker="sectionMarkers.source"
title="摄影与开拍状态联合修订"
description="保留主体、形态与动作事实。环境变化需本集原文依据,保存与正式采用分别执行。"
description-as-info
/>
<NButton class="self-start" :disabled="saving" :loading="source.loading.value" @click="reload"
>重新读取正式来源与草案</NButton
>
<p v-if="source.loading.value" role="status">正在核对完整正式来源…</p>
<p v-if="source.error.value" role="alert">{{ source.error.value }}</p>
<p v-if="saved" class="text-sm">
已保存第 {{ saved.revision }} 版 ·
{{
saved.status === 'current'
? '来源当前有效'
: saved.staleReason
? userFacingText(saved.staleReason)
: '原草案来源已变化,请重新核对'
}}。保存记录不代表正式采用。
</p>
<p v-if="conflict" role="alert">
来源、草案或相邻镜头版本发生冲突。当前输入已保留,请重新读取并核对后再次免费预检。
</p>
<p v-if="adopted" role="status">
{{
adopted.reused ? '同一联合修订已采用,本次为幂等回读。' : '联合修订已正式采用。'
}}原草案和历史保留;图片生成、视觉审核及主图确认仍须分别操作。
</p>
<NButton v-if="draft && source.data.value" class="self-start" :disabled="saving" @click="editFormal"
>从当前正式内容重新编辑</NButton
>
</section>
<template v-if="draft && source.data.value">
<NButton class="self-start" :disabled="saving" @click="editFormal">从当前正式内容重新编辑</NButton>
<NCollapse
><NCollapseItem
name="formal"
:title="adopted ? '采用后:当前正式摄影与开拍状态' : '修改前:正式摄影与开拍状态'"
><ShotDesign :shot="source.data.value.shot"
/></NCollapseItem>
<NCollapseItem name="history" title="原草案与摄影历史"
><RawDataDetails
:value="{ 草案: saved, 原摄影原文: source.data.value.shot.direction?.rawJson }"
title="高级详情" /></NCollapseItem
></NCollapse>
<section class="workspace-section-stack">
<!-- 历史与正式内容为独立阅读区,不与草案输入混排。 -->
<section class="workspace-section-stack workspace-numbered-section">
<WorkspaceSectionHeading :marker="sectionMarkers.history" title="正式内容与历史" />
<NCollapse class="workspace-collapse"
><NCollapseItem
name="formal"
:title="adopted ? '采用后:当前正式摄影与开拍状态' : '修改前:正式摄影与开拍状态'"
><ShotDesign :shot="source.data.value.shot"
/></NCollapseItem>
<NCollapseItem name="history" title="原草案与摄影历史"
><RecordDetails
inline
v-if="saved"
title="原草案记录"
:records="[
{
fields: [
{ label: '草案版本', value: saved.revision },
{ label: '保存时间', value: new Date(saved.updatedAt).toLocaleString() },
{
label: '来源状态',
value: saved.status === 'current' ? '当前来源有效' : '来源已变化'
},
{ label: '原构图', value: saved.draft.direction.composition },
{ label: '原机位', value: saved.draft.direction.cameraPosition }
]
}
]" /><RecordDetails
inline
title="摄影修订记录"
:records="cameraHistoryRecords" /></NCollapseItem
></NCollapse>
</section>
<!-- 完整编辑表单独立分组,以交替底面区分历史和差异。 -->
<section class="workspace-section-stack workspace-numbered-section">
<WorkspaceSectionHeading
:marker="sectionMarkers.draft"
:title="adopted ? '已采用的完整草案' : '修改后:待审完整草案'"
/><JointDraftFields v-model="draft" :disabled="saving || !!adopted" />
/>
<!-- 同级序标与正文共用当前功能区的内边距,不再嵌套第二块底面。 -->
<JointDraftFields v-model="draft" :disabled="saving || !!adopted" />
</section>
<!-- 以下是全部字段前后差异,越界项明确阻止联合采用。 -->
<section class="workspace-section-stack" aria-label="完整联合差异">
<WorkspaceSectionHeading :title="`完整字段差异(${differences.length} 项)`" />
<p v-if="boundaryNotice" class="text-sm" role="status">{{ boundaryNotice }}</p>
<p v-if="!differences.length" class="text-sm text-muted">与当前正式内容相同。</p>
<article v-for="(item, index) in differences" :key="index" class="space-y-2 text-sm">
<h4 class="font-medium">{{ item.label }}{{ item.allowed ? '' : ' · 不允许联合修改' }}</h4>
<p class="whitespace-pre-wrap wrap-anywhere">修改前:{{ item.before || '(空)' }}</p>
<p class="whitespace-pre-wrap wrap-anywhere">修改后:{{ item.after || '(空)' }}</p>
</article>
<section class="workspace-section-stack workspace-numbered-section" aria-label="完整联合差异">
<WorkspaceSectionHeading
:marker="sectionMarkers.differences"
:title="`完整字段差异(${differences.length} 项)`"
/>
<div class="workspace-section-stack">
<p v-if="boundaryNotice" class="text-sm" role="status">{{ boundaryNotice }}</p>
<p v-if="!differences.length" class="text-sm text-muted">与当前正式内容相同。</p>
<article v-for="(item, index) in differences" :key="index" class="space-y-2 text-sm">
<h4 class="font-medium">{{ item.label }}{{ item.allowed ? '' : ' · 不允许联合修改' }}</h4>
<p class="whitespace-pre-wrap wrap-anywhere">修改前:{{ item.before || '(空)' }}</p>
<p class="whitespace-pre-wrap wrap-anywhere">修改后:{{ item.after || '(空)' }}</p>
</article>
</div>
</section>
<!-- 以下是存在环境差异时的本集正式全文与人工证据,技术版本默认收起。 -->
<section v-if="hasEnvironmentChanges" class="workspace-section-stack" aria-label="本集原文依据">
<section
v-if="hasEnvironmentChanges"
class="workspace-section-stack workspace-numbered-section"
aria-label="本集原文依据"
>
<WorkspaceSectionHeading
:marker="sectionMarkers.environment"
title="本集原文依据"
description="原文及版本匹配不等于机器语义审核通过,请人工核对环境变化。"
description-as-info
/>
<NButton
class="self-start"
@@ -577,7 +648,7 @@ defineExpose({ saving, savingKind, canSave, canAdopt, save, adopt })
{{ environmentSource.error.value }}
</p>
<template v-if="environmentSource.data.value">
<NCollapse
<NCollapse class="workspace-collapse"
><NCollapseItem
name="episode-original"
:title="`第 ${episodeNo} 集 · ${environmentSource.data.value.title} · 完整原文`"
@@ -587,13 +658,6 @@ defineExpose({ saving, savingKind, canSave, canAdopt, save, adopt })
</p>
</NCollapseItem></NCollapse
>
<RawDataDetails
:value="{
episodeId: environmentSource.data.value.episodeId,
expectedContentFingerprint: environmentSource.data.value.expectedContentFingerprint
}"
title="本集身份与正文版本"
/>
</template>
<label class="workspace-form-field"
><span>本集原文片段(逐字引用)</span>
@@ -613,79 +677,89 @@ defineExpose({ saving, savingKind, canSave, canAdopt, save, adopt })
填写匹配的本集片段后可免费预检。
</p>
</section>
<NButton
class="self-start"
:disabled="saving || !savedMatches || !bounded || !!adopted"
:loading="previewing && previewKind === 'input'"
@click="loadPreview"
>免费核对草案画面输入</NButton
>
<!-- 以下是邻镜正式版本及静态衔接依据,不当作真实视频末态。 -->
<section v-if="preview" class="workspace-section-stack" aria-label="联合相邻镜头依据">
<WorkspaceSectionHeading
title="相邻镜头依据"
description="下列是正式静态输入与版本,不能证明尚未验证的真实视频末态。"
/>
<p v-if="!preview.adjacentDerivedVersions?.length" class="text-sm">本镜没有同集紧邻镜头。</p>
<article
v-for="neighbor in preview.adjacentDerivedVersions"
:key="neighbor.shotId"
class="space-y-2 text-sm"
<!-- 免费画面预览与相邻镜头依据共用一个功能块。 -->
<section class="workspace-section-stack workspace-numbered-section">
<WorkspaceSectionHeading :marker="sectionMarkers.preview" title="画面预览与相邻镜头" />
<NButton
class="self-start"
:disabled="saving || !savedMatches || !bounded || !!adopted"
:loading="previewing && previewKind === 'input'"
@click="loadPreview"
>免费核对草案画面输入</NButton
>
<p>
镜头 {{ props.shots.find(shot => shot.shotId === neighbor.shotId)?.beatNo ?? '待确认' }}.{{
props.shots.find(shot => shot.shotId === neighbor.shotId)?.shotNo ?? '待确认'
}}
</p>
<p class="whitespace-pre-wrap">
{{
source.data.value.rows.find(shot => shot.shotId === neighbor.shotId)?.visualState
?.continuityNote || '尚无已保存衔接说明。'
}}
</p>
<RawDataDetails :value="neighbor" title="相邻镜头版本详情" />
</article>
<!-- 以下是邻镜正式版本及静态衔接依据,不当作真实视频末态。 -->
<section v-if="preview" class="workspace-section-stack" aria-label="联合相邻镜头依据">
<WorkspaceSectionHeading
title="相邻镜头依据"
description="下列是正式静态输入与版本,不能证明尚未验证的真实视频末态。"
description-as-info
/>
<p v-if="!preview.adjacentDerivedVersions?.length" class="text-sm">本镜没有同集紧邻镜头。</p>
<article
v-for="neighbor in preview.adjacentDerivedVersions"
:key="neighbor.shotId"
class="space-y-2 text-sm"
>
<p>
镜头 {{ props.shots.find(shot => shot.shotId === neighbor.shotId)?.beatNo ?? '待确认' }}.{{
props.shots.find(shot => shot.shotId === neighbor.shotId)?.shotNo ?? '待确认'
}}
</p>
<p class="whitespace-pre-wrap">
{{
source.data.value.rows.find(shot => shot.shotId === neighbor.shotId)?.visualState
?.continuityNote || '尚无已保存衔接说明。'
}}
</p>
</article>
<ImageGenerationPreview
:preview="{ ...preview, previewFingerprint: preview.draftFingerprint }"
:loading="false"
error=""
stale-notice=""
display-only
/>
</section>
</section>
<!-- 审核依据与审核人为同一提交表单,使用统一字段间距。 -->
<section class="workspace-form-stack workspace-numbered-section">
<WorkspaceSectionHeading :marker="sectionMarkers.confirmation" title="审核与正式采用" />
<label class="workspace-form-field"
><span>联合修订与剪辑依据</span
><NInput
v-model:value="reason"
type="textarea"
:maxlength="4000"
:disabled="saving"
aria-label="联合修订依据"
/></label>
<label class="workspace-form-field"
><span>审核人</span
><NInput v-model:value="reviewer" :maxlength="120" :disabled="saving" aria-label="联合审核人"
/></label>
<NButton
class="self-start"
:disabled="
!preview || !bounded || !savedMatches || !environmentReady || saving || conflict || !!adopted
"
:loading="previewing && previewKind === 'adoption'"
@click="preflight"
>免费预检联合采用</NButton
>
<NCheckbox v-if="checked" v-model:checked="acknowledged" :disabled="saving"
>我已核对全部差异、相邻镜头版本和剪辑依据,确认采用这份草案。</NCheckbox
>
</section>
<section v-if="formalPreview" class="workspace-section-stack workspace-numbered-section">
<WorkspaceSectionHeading :marker="sectionMarkers.formalPreview" title="采用后的首帧预览" />
<ImageGenerationPreview
:preview="{ ...preview, previewFingerprint: preview.draftFingerprint }"
:preview="formalPreview"
:loading="false"
error=""
stale-notice=""
display-only
/>
</section>
<label class="workspace-form-field"
><span>联合修订与剪辑依据</span
><NInput
v-model:value="reason"
type="textarea"
:maxlength="4000"
:disabled="saving"
aria-label="联合修订依据"
/></label>
<label class="workspace-form-field"
><span>审核人</span
><NInput v-model:value="reviewer" :maxlength="120" :disabled="saving" aria-label="联合审核人"
/></label>
<NButton
class="self-start"
:disabled="
!preview || !bounded || !savedMatches || !environmentReady || saving || conflict || !!adopted
"
:loading="previewing && previewKind === 'adoption'"
@click="preflight"
>免费预检联合采用</NButton
>
<NCheckbox v-if="checked" v-model:checked="acknowledged" :disabled="saving"
>我已核对全部差异、相邻镜头版本和剪辑依据,确认采用这份草案。</NCheckbox
>
<ImageGenerationPreview
v-if="formalPreview"
:preview="formalPreview"
:loading="false"
error=""
stale-notice=""
display-only
/>
</template>
<p v-if="validation" role="alert" class="text-sm">{{ validation }}</p>
</div>
@@ -2,7 +2,7 @@
import { userFacingText } from '../../../lib/user-facing-text'
import { computed, ref, watch } from 'vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NInputNumber, NSelect, NTag } from 'naive-ui'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import { AppDialog, AssetImage } from '../../../components/ui'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
@@ -96,6 +96,18 @@ const taskIssues = computed(() =>
})
: []
)
/** 原审核只展示已有的业务问题文字,不把完整接口对象转为说明。 */
const candidateIssues = computed(() => {
const issues = state.failedCandidate.value?.qualityFailure?.issues
if (!Array.isArray(issues)) return []
return issues.flatMap((item: unknown) => {
if (typeof item === 'string') return [userFacingText(item)]
if (!item || typeof item !== 'object') return []
if ('message' in item && typeof item.message === 'string') return [userFacingText(item.message)]
if ('description' in item && typeof item.description === 'string') return [userFacingText(item.description)]
return []
})
})
/** 完成状态与通过语义分别显示。 */
const taskLabel = computed(() =>
!record.value
@@ -149,6 +161,7 @@ function updateRefs(index: number, value: string) {
title="人工动作修订"
description="免费检查并保存,再付费检查起始画面。通过后可启用修订。"
wide
description-as-info
>
<div class="motion-revision-layout">
<FeedbackMessage v-if="error" :message="error" />
@@ -157,7 +170,7 @@ function updateRefs(index: number, value: string) {
state.context.error.value || error
}}</ContextNotice>
<!-- 以下是集中展示版本与本次主首帧的上下文模块 -->
<section class="motion-revision-context" aria-label="修订版本与主首帧">
<section class="workspace-panel motion-revision-context" aria-label="修订版本与主首帧">
<div class="motion-revision-section-heading">
<div>
<h3>修订版本</h3>
@@ -169,10 +182,32 @@ function updateRefs(index: number, value: string) {
>刷新版本与主首帧</NButton
>
</div>
<RawDataDetails
v-if="state.context.data.value"
:value="state.context.data.value.history"
title="完整修订历史与采用指针"
<RecordDetails
title="修订历史"
:records="
(state.context.data.value?.history.revisions ?? []).map((item, index) => ({
title: `第 ${index + 1} 版 · ${formatDate(item.createdAt)}`,
fields: [
{
label: '来源',
value:
item.source === 'failed_candidate'
? '失败候选原稿'
: item.source === 'manual'
? '人工修订'
: '原始规划'
},
{ label: '采用状态', value: item.isActive ? '已采用' : '未采用' },
{
label: '修订说明',
value:
item.source === 'failed_candidate'
? '原质量未通过,保留作为人工修订起点'
: item.reason
}
]
}))
"
/>
<label v-if="options.length" class="motion-revision-field">
<span>编辑来源</span>
@@ -203,16 +238,17 @@ function updateRefs(index: number, value: string) {
<dl class="motion-revision-source-details">
<div>
<dt>当前主首帧</dt>
<dd>{{ state.context.data.value?.primary?.id ?? '尚无有效主首帧' }}</dd>
<dd>{{ state.context.data.value?.primary ? '已设置,见左侧画面' : '尚无有效主首帧' }}</dd>
</div>
<div>
<dt>当前生效版本</dt>
<dd>
{{
state.context.data.value?.history.activeRevisionId ??
(state.context.data.value?.preview.motionPlanAvailable
? 'AI 原始规划'
: '尚无正式采用版本')
state.context.data.value?.history.activeRevisionId
? '已采用修订(见版本历史)'
: state.context.data.value?.preview.motionPlanAvailable
? 'AI 原始规划'
: '尚无正式采用版本'
}}
</dd>
</div>
@@ -227,13 +263,20 @@ function updateRefs(index: number, value: string) {
>
<h3 class="text-sm font-semibold">原失败动作候选</h3>
<template v-if="state.requiresCandidate.value">
<label class="workspace-form-field"
><span>原Task(可选,留空查当前任务)</span
><NInput
v-model:value="state.failedTaskId.value"
:disabled="blocked || state.candidateLoading.value"
aria-label="原失败动作Task"
/></label>
<!-- 默认读取当前失败结果,仅在查找指定历史时填写原任务。 -->
<NCollapse display-directive="show">
<NCollapseItem name="historical-task" title="查找指定历史任务">
<label class="workspace-form-field">
<span>历史任务编号(可选)</span>
<NInput
v-model:value="state.failedTaskId.value"
:disabled="blocked || state.candidateLoading.value"
aria-label="原失败动作Task"
placeholder="留空读取当前失败结果"
/>
</label>
</NCollapseItem>
</NCollapse>
<NButton
class="self-start"
:loading="state.candidateLoading.value"
@@ -243,20 +286,30 @@ function updateRefs(index: number, value: string) {
>
</template>
<p v-if="state.failedCandidate.value" class="text-sm">
原Task {{ state.failedCandidate.value.taskId }} · 原Workflow
{{ state.failedCandidate.value.executionId }} · 原质量
{{ state.failedCandidate.value.status === 'failed' ? '未通过' : '不可作为当前失败候选' }}
原动作质量{{
state.failedCandidate.value.status === 'failed' ? '未通过' : '不可作为当前失败候选'
}};可展开查看原审核记录。
</p>
<RawDataDetails
<RecordDetails
v-if="state.failedCandidate.value"
:value="state.failedCandidate.value"
title="原模型候选、质量与公开回执"
/>
<RawDataDetails
v-if="state.candidateOrigin.value"
:value="state.candidateOrigin.value"
title="失败根版本来源证明"
title="原候选审核记录"
:records="[
{
fields: [
{
label: '原结论',
value: state.failedCandidate.value.status === 'failed' ? '未通过' : '当前不可承接'
},
{
label: '来源状态',
value: state.failedCandidate.value.current ? '当前来源匹配' : '来源已变化,仅供查看'
},
{ label: '问题说明', value: candidateIssues.join(';') || '请核对原动作规划' }
]
}
]"
/>
<NButton
v-if="state.candidateOrigin.value && !state.failedCandidate.value"
class="self-start"
@@ -462,16 +515,6 @@ function updateRefs(index: number, value: string) {
{{ preview.startStatePlan.feeEstimate.amount ?? '未知' }}
{{ preview.startStatePlan.feeEstimate.currency }}
</p>
<RawDataDetails
v-if="preview.source"
:value="{
source: preview.source,
sourceFingerprint: preview.sourceFingerprint,
previewFingerprint: preview.previewFingerprint,
startStatePlan: preview.startStatePlan
}"
title="当前来源、版本与精确起点计划"
/>
</section>
<!-- 以下是收费视觉校验与激活模块,费用说明和操作成组排列 -->
<section class="workspace-panel motion-revision-section" aria-label="动作起点视觉校验">
@@ -495,7 +538,27 @@ function updateRefs(index: number, value: string) {
<NButton type="primary" :disabled="!canActivate" @click="state.activate">激活此修订</NButton>
</div>
<div v-if="record || state.execution.query.error.value" class="motion-revision-feedback">
<p v-if="record" role="status">{{ taskLabel }} · {{ record.id }}</p>
<p v-if="record" role="status">{{ taskLabel }}</p>
<RecordDetails
v-if="record"
title="起点审核记录"
:records="[
{
fields: [
{ label: '当前结论', value: taskLabel },
{
label: '开始时间',
value: record.startedAt ? formatDate(record.startedAt) : '未记录'
},
{
label: '结束时间',
value: record.completedAt ? formatDate(record.completedAt) : '尚未结束'
},
{ label: '费用', value: '按原独立审核记录核对,不以任务结束推断为零费用' }
]
}
]"
/>
<p v-if="state.execution.query.error.value" class="text-danger">
{{ state.execution.query.error.value }}
</p>
@@ -527,7 +590,7 @@ function updateRefs(index: number, value: string) {
.motion-revision-layout {
display: flex;
flex-direction: column;
gap: calc(var(--app-content-gap) * 2);
gap: var(--app-content-gap);
}
.motion-revision-layout > .workspace-panel {
margin: 0;
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import type { ShotContinuityEvidence } from '../generation-spec.types'
/** Storyboard及首帧共用正式人工规划依据,不复制或改写尾态与质量。 */
const props = defineProps<{ /** 当前正式编译的连续性证据。 */ continuity?: ShotContinuityEvidence | null }>()
@@ -22,6 +21,5 @@ const transition = computed(() => {
<!-- 以下是人工规划确认与尚未验证的视频末态,使用中性展示。 -->
<section v-if="transition" class="space-y-2 text-xs" aria-label="人工规划衔接">
<p>人工规划衔接已确认,视频末态尚未验证</p>
<RawDataDetails :value="transition" title="衔接规划来源详情" />
</section>
</template>
@@ -4,13 +4,14 @@ import JointDraftReviewPanel from './JointDraftReviewPanel.vue'
import ShotDesign from './ShotDesign.vue'
import SceneTransitionEvidence from './SceneTransitionEvidence.vue'
import KeyframeCard from '../../production/components/KeyframeCard.vue'
import { keyframeDisplayNames } from '../../production/model'
import KeyframeValidationHistory from '../../production/components/KeyframeValidationHistory.vue'
import { jointDraftDifferences } from '../joint-review'
import DirectionCameraFields from './DirectionCameraFields.vue'
import DirectionStageReview from './DirectionStageReview.vue'
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 RecordDetails from '../../../components/ui/RecordDetails.vue'
import { AppDrawer, WorkspaceSectionHeading } from '../../../components/ui'
import { useActionMessage } from '../../../components/ui/useActionMessage'
import { useQuery } from '../../../composables/useQuery'
@@ -29,7 +30,7 @@ import GenerationModelControls from '../../generation-config/components/Generati
import type { GenerationOptions } from '../../generation-config/types'
import { storyboardApi } from '../api'
import { derivedReviewApi } from '../derived-review-api'
import { draftFromFormal, reviseSubjectGaze } from '../derived-review'
import { draftFromFormal, reviseSubjectGaze, cameraRevisionSummaries } from '../derived-review'
import type {
DerivedReviewSelection,
DraftProviderInput,
@@ -153,6 +154,10 @@ const cameraAssets = useQuery(cameraAssetKey, async (value, signal) => {
if (!Array.isArray(rows) || rows.some(row => row.shotId !== shotId)) throw new Error('图片候选不属于当前镜头。')
return rows
})
/** 与首帧候选管理使用相同镜头名称及图片编号。 */
const cameraAssetNames = computed(() =>
keyframeDisplayNames(cameraAssets.data.value ?? [], props.shot.title, props.shot.shotNo)
)
/** 当前可查看的原稿,保留过期草案的全部内容。 */
const savedDraftText = computed(() =>
savedDraft.data.value ? JSON.stringify(savedDraft.data.value.draft, null, 2) : ''
@@ -203,14 +208,7 @@ const configuration = useQuery(key, async (id, signal) => {
/** 正式场景衔接证据;不会用前镜首帧冒充尾态。 */
const continuity = computed(() => formalQuery.data.value?.generation.continuity)
/** 原摄影修订事件仅只读展示,不能回写历史。 */
const cameraHistory = computed<unknown[]>(() => {
try {
const raw = JSON.parse(formalQuery.data.value?.shot.direction?.rawJson ?? 'null')
return Array.isArray(raw?.cameraRevisionHistory) ? raw.cameraRevisionHistory : []
} catch {
return []
}
})
const cameraHistory = computed(() => cameraRevisionSummaries(formalQuery.data.value?.shot.direction?.rawJson))
/** 普通摄影完整差异,保存草案中的越界项也不能隐藏。 */
const cameraDifferences = computed(() => {
const value = formalQuery.data.value,
@@ -695,6 +693,22 @@ async function adopt() {
saving.value = false
}
}
/** 原摄影模式按实际可见功能块编号,与联合模式使用同一视觉层级。 */
const sectionMarkers = computed(() => {
const sections = ['approval']
if (formal.value) {
sections.push('formal')
if (mode.value === 'camera' && cameraDifferences.value.length) sections.push('differences')
if (cameraAdoptionNotice.value || cameraFormalPreview.value || cameraFeePlan.value?.billingBlocked)
sections.push('adopted')
}
sections.push('saved')
if (reviewed.value?.selection.draft.subjectStateRevision) sections.push('gazeScope')
if (!useSaved.value) sections.push('edit')
sections.push('preview')
const numerals = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']
return Object.fromEntries(sections.map((sectionKey, index) => [sectionKey, numerals[index]]))
})
</script>
<template>
@@ -732,131 +746,165 @@ async function adopt() {
:disabled="disabled"
@adopted="directionAdopted"
/>
<div v-else class="workspace-section-stack workspace-section-stack-spacious">
<div v-else class="workspace-section-stack workspace-numbered-sections">
<!-- 以下是当前分镜来源、质量诊断与人工确认状态 -->
<section v-if="preflight.data.value" class="space-y-2 text-sm">
<WorkspaceSectionHeading title="正式分镜审核" />
<p>
{{ preflight.data.value.current.valid ? '已审核' : '待审核' }} ·
{{ preflight.data.value.quality.coverage.episodeCount }} 集 ·
{{ preflight.data.value.quality.coverage.shotCount }} 镜 ·
{{ preflight.data.value.quality.preflightEligible ? '检查通过' : '有待处理项' }}
<section class="workspace-numbered-section workspace-section-stack text-sm">
<WorkspaceSectionHeading :marker="sectionMarkers.approval" title="正式分镜审核" />
<template v-if="preflight.data.value">
<p>
{{ 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">请先在制作准备中审核分镜。</p>
<NCollapse class="workspace-collapse">
<NCollapseItem name="audit" title="审核详情">
<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>
</NCollapseItem>
</NCollapse>
</template>
<p v-else-if="preflight.loading.value" role="status" class="text-sm text-muted">
正在读取正式审核状态…
</p>
<p v-if="!preflight.data.value.current.valid" class="text-muted">请先在制作准备中审核分镜。</p>
<NCollapse>
<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>
</NCollapseItem>
</NCollapse>
<NButton v-if="preflight.error.value" @click="preflight.refresh">重新读取审核状态</NButton>
</section>
<p v-else-if="preflight.loading.value" role="status" class="text-sm text-muted">正在读取正式审核状态…</p>
<NButton v-if="preflight.error.value" @click="preflight.refresh">重新读取审核状态</NButton>
<!-- 以下是原摄影、完整差异及历史,只读按需展开,不创建第二套摄影编辑器。 -->
<template v-if="formal">
<NButton
class="self-start"
:disabled="saving || savingDraft"
:loading="formalQuery.loading.value"
@click="formalQuery.refresh"
>刷新正式摄影与来源</NButton
>
<p v-if="formalQuery.error.value" role="alert" class="text-sm">{{ formalQuery.error.value }}</p>
<NCollapse v-model:expanded-names="cameraExpanded">
<NCollapseItem name="camera-formal" title="当前正式摄影与状态"
><ShotDesign
v-if="formalQuery.data.value && !formalQuery.error.value"
:shot="formalQuery.data.value.shot"
/></NCollapseItem>
<NCollapseItem name="camera-history" title="摄影修订历史"
><p v-if="!cameraHistory.length" class="text-sm text-muted">暂无摄影修订记录。</p>
<RawDataDetails
v-for="(event, index) in cameraHistory"
:key="index"
:value="event"
:title="`第 ${index + 1} 次摄影修订`"
/></NCollapseItem>
<NCollapseItem name="camera-assets" title="已有图片与质量(只读)">
<p v-if="cameraAssets.loading.value" role="status">正在读取原图片与审核…</p>
<p v-if="cameraAssets.error.value" role="alert">{{ cameraAssets.error.value }}</p>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3">
<KeyframeCard
v-for="item in cameraAssets.data.value ?? []"
:key="item.id"
:item="item"
<section class="workspace-numbered-section workspace-section-stack">
<WorkspaceSectionHeading :marker="sectionMarkers.formal" title="正式摄影、图片与历史" />
<NButton
class="self-start"
:disabled="saving || savingDraft"
:loading="formalQuery.loading.value"
@click="formalQuery.refresh"
>刷新正式摄影与来源</NButton
>
<p v-if="formalQuery.error.value" role="alert" class="text-sm">{{ formalQuery.error.value }}</p>
<NCollapse class="workspace-collapse" v-model:expanded-names="cameraExpanded">
<NCollapseItem name="camera-formal" title="当前正式摄影与状态"
><ShotDesign
v-if="formalQuery.data.value && !formalQuery.error.value"
:shot="formalQuery.data.value.shot"
/></NCollapseItem>
<NCollapseItem name="camera-history" title="摄影修订历史"
><p v-if="!cameraHistory.length" class="text-sm text-muted">暂无摄影修订记录。</p>
<RecordDetails
inline
title="摄影修订记录"
:records="
cameraHistory.map((event, index) => ({
title: `第 ${index + 1} 次摄影修订`,
fields: [
{ label: '审核人', value: event.reviewer },
{
label: '采用时间',
value: event.adoptedAt ? formatDate(event.adoptedAt) : '未记录'
},
{ label: '原构图', value: event.beforeComposition },
{ label: '采用后构图', value: event.afterComposition },
{ label: '原机位', value: event.beforePosition },
{ label: '采用后机位', value: event.afterPosition }
]
}))
"
/></NCollapseItem>
<NCollapseItem name="camera-assets" title="已有图片与质量(只读)">
<p v-if="cameraAssets.loading.value" role="status">正在读取原图片与审核…</p>
<p v-if="cameraAssets.error.value" role="alert">{{ cameraAssets.error.value }}</p>
<!-- 图片与候选管理共用紧凑卡片网格,不随全屏抽屉等分放大。 -->
<div class="asset-candidate-grid">
<KeyframeCard
v-for="item in cameraAssets.data.value ?? []"
:key="item.id"
:item="item"
:display-name="cameraAssetNames.get(item.id)"
:project-id="projectId"
:shot-id="shot.shotId"
:shot-no="shot.shotNo"
:stale="false"
:blocked="true"
:validation-passed="null"
:review-revision="cameraReviewRevision"
:confirming="false"
readonly
@history="cameraHistoryAssetId = item.id"
/>
</div>
<KeyframeValidationHistory
v-if="cameraHistoryAssetId"
:key="cameraHistoryAssetId + ':' + cameraReviewRevision"
:project-id="projectId"
:shot-id="shot.shotId"
:shot-no="shot.shotNo"
:stale="false"
:blocked="true"
:validation-passed="null"
:review-revision="cameraReviewRevision"
:confirming="false"
readonly
@history="cameraHistoryAssetId = item.id"
:keyframe-id="cameraHistoryAssetId"
initial-open
:disabled="true"
/>
</div>
<KeyframeValidationHistory
v-if="cameraHistoryAssetId"
:key="cameraHistoryAssetId + ':' + cameraReviewRevision"
:project-id="projectId"
:shot-id="shot.shotId"
:keyframe-id="cameraHistoryAssetId"
initial-open
:disabled="true"
/>
</NCollapseItem>
</NCollapse>
<SceneTransitionEvidence
v-if="!formalQuery.error.value && !formalQuery.loading.value"
:continuity="continuity"
/>
</NCollapseItem>
</NCollapse>
<SceneTransitionEvidence
v-if="!formalQuery.error.value && !formalQuery.loading.value"
:continuity="continuity"
/>
</section>
<section
v-if="mode === 'camera' && cameraDifferences.length"
class="workspace-section-stack"
class="workspace-numbered-section workspace-section-stack"
aria-label="摄影完整差异"
>
<WorkspaceSectionHeading :title="`完整字段差异(${cameraDifferences.length}项)`" />
<WorkspaceSectionHeading
:marker="sectionMarkers.differences"
:title="`完整字段差异(${cameraDifferences.length}项)`"
/>
<article v-for="(item, index) in cameraDifferences" :key="index" class="space-y-2 text-sm">
<h4>{{ item.label }}</h4>
<p class="whitespace-pre-wrap wrap-anywhere">修改前:{{ item.before || '(空)' }}</p>
<p class="whitespace-pre-wrap wrap-anywhere">修改后:{{ item.after || '(空)' }}</p>
</article>
</section>
<p v-if="cameraAdoptionNotice" role="status" class="text-sm">{{ cameraAdoptionNotice }}</p>
<ImageGenerationPreview
v-if="cameraFormalPreview"
:preview="cameraFormalPreview"
:loading="false"
error=""
stale-notice=""
display-only
/>
<KeyframePreviewChecks v-if="cameraFormalPreview" :preview="cameraFormalPreview" />
<RawDataDetails
v-if="cameraFeePlan"
:value="cameraFeePlan"
title="新来源费用计划(不代表授权或核清)"
/>
<!-- 正式采用回执与只读预览独立成块,不代表生图或质量通过。 -->
<section
v-if="cameraAdoptionNotice || cameraFormalPreview || cameraFeePlan?.billingBlocked"
class="workspace-numbered-section workspace-section-stack"
>
<WorkspaceSectionHeading :marker="sectionMarkers.adopted" title="采用结果与正式预览" />
<p v-if="cameraAdoptionNotice" role="status" class="text-sm">{{ cameraAdoptionNotice }}</p>
<ImageGenerationPreview
v-if="cameraFormalPreview"
:preview="cameraFormalPreview"
:loading="false"
error=""
stale-notice=""
display-only
/>
<KeyframePreviewChecks v-if="cameraFormalPreview" :preview="cameraFormalPreview" />
<p v-if="cameraFeePlan?.billingBlocked" class="text-sm">
图片费用仍待核对;本次摄影采用未生成图片。
</p>
</section>
</template>
<!-- 以下是服务端待审草案、版本和保留的原稿 -->
<section class="space-y-3 text-sm">
<WorkspaceSectionHeading title="已保存草案" />
<section class="workspace-numbered-section workspace-section-stack text-sm">
<WorkspaceSectionHeading
:marker="sectionMarkers.saved"
title="已保存草案"
:description="
savedDraft.data.value?.status === 'stale'
? userFacingText(savedDraft.data.value.staleReason, '请刷新正式来源并重新核对。')
: undefined
"
description-as-info
/>
<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.revision }} 版 · {{ formatDate(savedDraft.data.value.updatedAt) }}
</p>
<p v-if="savedDraft.data.value.status === 'stale'" class="text-muted">
{{ userFacingText(savedDraft.data.value.staleReason, '请刷新正式来源并重新核对。') }}
</p>
<div class="flex flex-wrap gap-2">
<NButton
v-if="!useSaved"
@@ -870,17 +918,10 @@ async function adopt() {
}}</NButton>
<NButton size="small" @click="copySavedDraft">复制原稿</NButton>
</div>
<NCollapse v-if="useSaved">
<NCollapse class="workspace-collapse" v-if="useSaved">
<NCollapseItem name="saved-draft" title="查看草案">
<p>构图:{{ savedDraft.data.value.draft.direction.composition }}</p>
<p>摄影机位置:{{ savedDraft.data.value.draft.direction.cameraPosition }}</p>
<RawDataDetails
title="高级详情"
:value="{
草案: savedDraft.data.value.draft,
模型参数: savedDraft.data.value.providerInput
}"
/>
</NCollapseItem>
</NCollapse>
</template>
@@ -896,8 +937,11 @@ async function adopt() {
</section>
<!-- 以下是已审视线变更范围,不将修订解释为质量通过 -->
<section v-if="reviewed?.selection.draft.subjectStateRevision" class="space-y-2 text-sm">
<WorkspaceSectionHeading title="本次采用范围:主体视线" />
<section
v-if="reviewed?.selection.draft.subjectStateRevision"
class="workspace-numbered-section workspace-section-stack text-sm"
>
<WorkspaceSectionHeading :marker="sectionMarkers.gazeScope" title="本次采用范围:主体视线" />
<p v-for="change in reviewed.selection.draft.subjectStateRevision.changes" :key="change.subjectRef">
{{ change.subjectRef }}:{{ change.before || '未填写' }} → {{ change.after }}
</p>
@@ -905,8 +949,8 @@ async function adopt() {
<p class="text-muted">当前质量可能变为来源过期;修订不代表视觉审核通过。</p>
</section>
<!-- 以下是受控摄影修订与场景沿用 -->
<section v-if="formal && !useSaved" class="space-y-3 text-sm">
<WorkspaceSectionHeading title="待审修改" />
<section v-if="formal && !useSaved" class="workspace-numbered-section workspace-form-stack text-sm">
<WorkspaceSectionHeading :marker="sectionMarkers.edit" 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">
@@ -993,8 +1037,8 @@ async function adopt() {
</template>
</template>
</section>
<section v-else-if="!useSaved" class="space-y-3">
<WorkspaceSectionHeading title="导入待审摄影草案" />
<section v-else-if="!useSaved" class="workspace-numbered-section workspace-form-stack">
<WorkspaceSectionHeading :marker="sectionMarkers.edit" title="导入待审摄影草案" />
<NInput
v-model:value="imported"
type="textarea"
@@ -1006,129 +1050,139 @@ async function adopt() {
</section>
<!-- 以下是沿用项目模型目录的预览参数 -->
<section v-if="configuration.data.value && !useSaved" class="space-y-4">
<WorkspaceSectionHeading title="预览模型" />
<GenerationModelControls
type="image"
:catalog="configuration.data.value.catalog"
:aspect-ratio="configuration.data.value.profile.aspectRatio"
:provider="provider"
:options="options"
@update:provider="
value => {
providerEdited = true
provider = value
}
"
@update:options="
value => {
providerEdited = true
options = value
}
"
:disabled="saving"
/>
</section>
<NButton v-if="configuration.error.value" @click="configuration.refresh">重新读取模型配置</NButton>
<NButton
:loading="previewing"
:disabled="!canPreview || saving || savingDraft || previewing"
@click="loadPreview"
>免费预览摄影草案</NButton
>
<!-- 以下是已冻结的草案、场景几何依据及实际模型输入 -->
<section v-if="reviewed && previewDisplay" class="space-y-4 text-sm">
<RawDataDetails
:value="{
formalSourceFingerprint: reviewed.selection.expectedCurrentFormalSourceFingerprint,
currentDerivedFingerprint: reviewed.preview.currentDerivedFingerprint,
adjacentDerivedVersions: reviewed.preview.adjacentDerivedVersions
}"
title="当前与相邻镜头版本"
/>
<WorkspaceSectionHeading title="草案预览" description="采用后可预览正式首帧。" />
<NTag size="small" :bordered="false">{{
reviewed.preview.productionGate.ready ? '项目制作已就绪' : '项目制作未就绪'
}}</NTag>
<p v-if="reviewed.preview.productionGate.reason" class="text-muted">
{{ userFacingText(reviewed.preview.productionGate.reason) }}
</p>
<dl class="detail-grid">
<dt>摄影</dt>
<dd>
{{ directionLabel(reviewed.selection.draft.direction.shotSize, 'shotSize') }} ·
{{ directionLabel(reviewed.selection.draft.direction.cameraAngle, 'cameraAngle') }} ·
{{ directionLabel(reviewed.selection.draft.direction.cameraMovement, 'cameraMovement') }}
</dd>
<dt>构图</dt>
<dd>{{ reviewed.selection.draft.direction.composition }}</dd>
<dt>机位</dt>
<dd>{{ reviewed.selection.draft.direction.cameraPosition }}</dd>
<dt>视觉意图</dt>
<dd>{{ reviewed.selection.draft.direction.visualIntent }}</dd>
<dt>环境</dt>
<dd>
{{
Object.values(reviewed.selection.draft.visualState.environment)
.filter(Boolean)
.join(' · ') || '未指定'
}}
</dd>
</dl>
<NCollapse>
<NCollapseItem name="visual" title="场景与角色状态">
<VisualStateContinuity
v-if="reviewed.selection.draft.visualState.continuityNote"
:note="reviewed.selection.draft.visualState.continuityNote"
class="mb-2"
/>
<ul class="space-y-2">
<li
v-for="subject in reviewed.selection.draft.visualState.subjects"
:key="subject.subjectRef"
>
<strong>{{ subject.formName }} · {{ subject.subjectRef }}</strong>
<p>
{{
[
subject.expression,
subject.pose,
subject.gaze,
subject.position,
subject.transientState
]
.filter(Boolean)
.join(' · ') || '无即时变化'
}}
</p>
</li>
</ul>
<RawDataDetails
v-if="reviewed.preview.sceneSources.length"
title="场景参考详情"
:value="reviewed.preview.sceneSources"
/>
</NCollapseItem>
</NCollapse>
<KeyframePreviewChecks :preview="reviewed.preview" />
<ImageGenerationPreview
:preview="previewDisplay"
:loading="false"
error=""
stale-notice=""
display-only
/>
<NInput
v-model:value="reviewer"
:maxlength="120"
:disabled="saving"
placeholder="填写审核人"
aria-label="审核人"
/>
<NCheckbox v-model:checked="acknowledged" :disabled="saving"
>我已核对本镜草案和实际参考,确认采用。</NCheckbox
<section class="workspace-numbered-section workspace-section-stack">
<WorkspaceSectionHeading :marker="sectionMarkers.preview" title="预览与采用确认" />
<NCollapse
class="workspace-collapse"
v-if="configuration.data.value && !useSaved"
display-directive="show"
><NCollapseItem name="preview-model" title="预览模型与参数"
><section class="space-y-4">
<GenerationModelControls
type="image"
:catalog="configuration.data.value.catalog"
:aspect-ratio="configuration.data.value.profile.aspectRatio"
:provider="provider"
:options="options"
@update:provider="
value => {
providerEdited = true
provider = value
}
"
@update:options="
value => {
providerEdited = true
options = value
}
"
:disabled="saving"
/></section></NCollapseItem
></NCollapse>
<NButton v-if="configuration.error.value" @click="configuration.refresh">重新读取模型配置</NButton>
<NButton
class="self-start"
:loading="previewing"
:disabled="!canPreview || saving || savingDraft || previewing"
@click="loadPreview"
>免费预览摄影草案</NButton
>
<!-- 以下是已冻结的草案、场景几何依据及实际模型输入 -->
<section v-if="reviewed && previewDisplay" class="space-y-4 text-sm">
<RecordDetails
title="本次核对范围"
:records="[
{
fields: [
{ label: '当前镜头', value: `${shot.beatNo}.${shot.shotNo}` },
{
label: '相邻镜头',
value: `${reviewed.preview.adjacentDerivedVersions?.length ?? 0} 镜`
},
{ label: '来源保护', value: '正式采用时再次核对,变化后需重新确认' }
]
}
]"
/>
<WorkspaceSectionHeading title="草案预览" description="采用后可预览正式首帧。" />
<NTag size="small" :bordered="false">{{
reviewed.preview.productionGate.ready ? '项目制作已就绪' : '项目制作未就绪'
}}</NTag>
<p v-if="reviewed.preview.productionGate.reason" class="text-muted">
{{ userFacingText(reviewed.preview.productionGate.reason) }}
</p>
<dl class="detail-grid">
<dt>摄影</dt>
<dd>
{{ directionLabel(reviewed.selection.draft.direction.shotSize, 'shotSize') }} ·
{{ directionLabel(reviewed.selection.draft.direction.cameraAngle, 'cameraAngle') }} ·
{{ directionLabel(reviewed.selection.draft.direction.cameraMovement, 'cameraMovement') }}
</dd>
<dt>构图</dt>
<dd>{{ reviewed.selection.draft.direction.composition }}</dd>
<dt>机位</dt>
<dd>{{ reviewed.selection.draft.direction.cameraPosition }}</dd>
<dt>视觉意图</dt>
<dd>{{ reviewed.selection.draft.direction.visualIntent }}</dd>
<dt>环境</dt>
<dd>
{{
Object.values(reviewed.selection.draft.visualState.environment)
.filter(Boolean)
.join(' · ') || '未指定'
}}
</dd>
</dl>
<NCollapse class="workspace-collapse">
<NCollapseItem name="visual" title="场景与角色状态">
<VisualStateContinuity
v-if="reviewed.selection.draft.visualState.continuityNote"
:note="reviewed.selection.draft.visualState.continuityNote"
class="mb-2"
/>
<ul class="space-y-2">
<li
v-for="subject in reviewed.selection.draft.visualState.subjects"
:key="subject.subjectRef"
>
<strong>{{ subject.formName }} · {{ subject.subjectRef }}</strong>
<p>
{{
[
subject.expression,
subject.pose,
subject.gaze,
subject.position,
subject.transientState
]
.filter(Boolean)
.join(' · ') || '无即时变化'
}}
</p>
</li>
</ul>
</NCollapseItem>
</NCollapse>
<KeyframePreviewChecks :preview="reviewed.preview" />
<ImageGenerationPreview
:preview="previewDisplay"
:loading="false"
error=""
stale-notice=""
display-only
/>
<NInput
v-model:value="reviewer"
:maxlength="120"
:disabled="saving"
placeholder="填写审核人"
aria-label="审核人"
/>
<NCheckbox v-model:checked="acknowledged" :disabled="saving"
>我已核对本镜草案和实际参考,确认采用。</NCheckbox
>
</section>
</section>
</div>
<template #footer>
@@ -10,12 +10,12 @@ defineProps<{ shot: DesignedShot }>()
</script>
<template>
<div :key="shot.shotId" class="workspace-section-stack workspace-section-stack-spacious">
<section>
<div :key="shot.shotId" class="workspace-section-stack">
<section class="workspace-panel">
<!-- 以下是统一的导演设计模块标题 -->
<WorkspaceSectionHeading title="导演摄影设计" />
<template v-if="shot.direction"
><div class="mt-4 mb-5 flex flex-wrap gap-2">
><div class="mt-3 mb-3 flex flex-wrap gap-2">
<NTag
v-for="field in [
{ key: 'shotSize', label: '景别' },
@@ -32,38 +32,46 @@ defineProps<{ shot: DesignedShot }>()
</div>
<dl class="detail-grid">
<dt>视觉意图</dt>
<dd>{{ shot.direction.visualIntent }}</dd>
<dd class="line-clamp-2">{{ shot.direction.visualIntent }}</dd>
</dl>
<!-- 以下是按需展开的完整摄影原文,不裁剪或改写创作内容。 -->
<NCollapse class="mt-4">
<NCollapse class="workspace-collapse mt-4">
<NCollapseItem name="camera-detail" title="构图与机位">
<dl class="detail-grid">
<dt>构图</dt>
<dd class="whitespace-pre-wrap wrap-anywhere">{{ shot.direction.composition }}</dd>
<dt>机位</dt>
<dd class="whitespace-pre-wrap wrap-anywhere">{{ shot.direction.cameraPosition }}</dd>
<dt>完整视觉意图</dt>
<dd class="whitespace-pre-wrap wrap-anywhere">{{ shot.direction.visualIntent }}</dd>
</dl>
</NCollapseItem>
</NCollapse></template
>
<p v-else class="mt-4 text-sm text-muted">此镜头尚无已保存的导演设计。</p>
</section>
<section>
<section class="workspace-panel workspace-panel-facts">
<!-- 以下是统一的画面状态模块标题 -->
<WorkspaceSectionHeading title="画面状态 · 开拍0秒" />
<template v-if="shot.visualState"
><dl class="detail-grid mt-4">
<dt>时间</dt>
<dd>{{ shot.visualState.timeOfDay || '未指定' }}</dd>
<dt>天气</dt>
<dd>{{ shot.visualState.weather || '不适用 / 未指定' }}</dd>
<dt>氛围</dt>
<dd>{{ shot.visualState.atmosphere || '未指定' }}</dd>
<dt>环境变化</dt>
<dd>{{ shot.visualState.environmentTransientState || '无临时变化' }}</dd>
</dl>
<!-- 以下是完整连续依据与主体状态,普通浏览默认收起。 -->
<NCollapse class="mt-4">
<NCollapse class="workspace-collapse mt-4">
<NCollapseItem name="environment" title="天气与环境变化">
<dl class="detail-grid">
<dt>天气</dt>
<dd>{{ shot.visualState.weather || '不适用 / 未指定' }}</dd>
<dt>环境变化</dt>
<dd class="whitespace-pre-wrap wrap-anywhere">
{{ shot.visualState.environmentTransientState || '无临时变化' }}
</dd>
</dl>
</NCollapseItem>
<NCollapseItem name="continuity" title="衔接与时间依据">
<VisualStateContinuity
v-if="shot.visualState.continuityNote"
@@ -1,5 +1,5 @@
<script setup lang="ts">
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import RecordDetails from '../../../components/ui/RecordDetails.vue'
import SceneTransitionEvidence from './SceneTransitionEvidence.vue'
import { userFacingText } from '../../../lib/user-facing-text'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
@@ -212,7 +212,32 @@ function exportResult(kind: 'spec' | 'prompt') {
>{{ spec.subjects.length }} 个主体 · {{ spec.durationSeconds }} 秒</span
><NButton @click="exportResult('spec')" text size="small"><Download :size="13" />导出方案</NButton>
</div>
<RawDataDetails :value="spec" title="完整生成方案(高级)" />
<RecordDetails
title="本镜头生成内容"
:records="[
{
title: '当前环境',
fields: [
{ label: '时间', value: spec.environment.timeOfDay },
{ label: '天气', value: spec.environment.weather },
{ label: '氛围', value: spec.environment.atmosphere },
{ label: '环境变化', value: spec.environment.transientState }
]
},
...spec.subjects.map(subject => ({
title: subject.subjectName || '主体名称未记录',
fields: [
{ label: '形态', value: subject.subjectFormName },
{ label: '表情', value: subject.expression },
{ label: '姿态', value: subject.pose },
{ label: '视线', value: subject.gaze },
{ label: '位置', value: subject.position },
{ label: '临时状态', value: subject.transientState }
]
}))
]"
/>
<SceneTransitionEvidence :continuity="spec.continuity" />
</template>
</section>
+57
View File
@@ -2,6 +2,63 @@ import type { KeyframeSpec } from '../production/types'
import type { ShotReviewDraft } from './derived-review.types'
import type { DesignedShot } from './types'
/** 用户需要核对的摄影修订历史,内部版本仍由原服务保存和保护。 */
export interface CameraRevisionSummary {
/** 审核人。 */ reviewer: string
/** 原采用时间。 */ adoptedAt: string
/** 原构图。 */ beforeComposition: string
/** 采用后构图。 */ afterComposition: string
/** 原机位。 */ beforePosition: string
/** 采用后机位。 */ afterPosition: string
}
/**
* 从正式摄影历史读取明确的业务字段,不能把未知对象直接显示给用户。
* @param raw 正式摄影保存的原始记录
* @returns 可读历史,不包含来源指纹或内部请求
*/
export function cameraRevisionSummaries(raw: string | null | undefined): CameraRevisionSummary[] {
try {
const parsed: unknown = JSON.parse(raw ?? 'null')
if (
!parsed ||
typeof parsed !== 'object' ||
!('cameraRevisionHistory' in parsed) ||
!Array.isArray(parsed.cameraRevisionHistory)
)
return []
return parsed.cameraRevisionHistory.flatMap((item: unknown) => {
if (!item || typeof item !== 'object' || Array.isArray(item)) return []
const record = item as Record<string, unknown>,
before =
record.before && typeof record.before === 'object'
? (record.before as Record<string, unknown>)
: {},
after =
record.after && typeof record.after === 'object' ? (record.after as Record<string, unknown>) : {}
return [
{
reviewer: historyText(record.reviewer),
adoptedAt: historyText(record.adoptedAt),
beforeComposition: historyText(before.composition),
afterComposition: historyText(after.composition),
beforePosition: historyText(before.cameraPosition),
afterPosition: historyText(after.cameraPosition)
}
]
})
} catch {
return []
}
}
/**
* 仅读取正式记录中的文字,不把对象和内部结构转成字符串。
* @param value 原字段
* @returns 原文或空值
*/
function historyText(value: unknown) {
return typeof value === 'string' ? value : ''
}
/**
* 从正式记录创建受控草案,保留原来的动作、形态及环境。
* @param shot 已保存的摄影和即时状态
@@ -8,8 +8,8 @@ import { referenceImageUrl } from '../../../lib/assets'
import { userFacingText } from '../../../lib/user-facing-text'
import type { ImageReferenceBinding } from '../generation-preview'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
import FieldLabel from '../../../components/ui/FieldLabel.vue'
import type { ImageGenerationPreview } from '../generation-preview'
/** 三个图片入口共用的最终输入与参考职责展示。 */
@@ -90,21 +90,35 @@ const omitted = computed(
>
| undefined
)
/**
* 机位长说明按需查看,卡片保留实际参考顺序与职责。
* @param bindings 当前图片原始职责
* @returns 未改写的机位说明
*/
function referenceNotes(bindings: ImageReferenceBinding[]) {
return bindings
.map(binding => binding.viewDescription)
.filter(Boolean)
.join('\n')
}
</script>
<template>
<!-- 以下是免费实际输入预览模块,参数调整后必须重新读取 -->
<section class="min-w-0 space-y-4" aria-label="本次生成预览">
<WorkspaceSectionHeading v-if="!displayOnly" title="本次生成预览" description="免费查看提示词和参考图。" />
<NButton
v-if="!displayOnly"
class="workspace-action-button"
:loading="loading"
:disabled="disabled || loading"
@click="emit('load')"
>
<template #icon><Eye :size="16" /></template>预览实际生成输入
</NButton>
<WorkspaceSectionHeading v-if="!displayOnly" title="本次生成预览">
<template #actions>
<NButton
v-if="!displayOnly"
class="workspace-action-button"
:loading="loading"
:disabled="disabled || loading"
@click="emit('load')"
>
<template #icon><Eye :size="16" /></template>预览实际生成输入
</NButton>
</template>
</WorkspaceSectionHeading>
<ContextNotice v-if="staleNotice" type="warning" :show-icon="false">{{ staleNotice }}</ContextNotice>
<ContextNotice v-if="error" type="error" :show-icon="false">{{ error }}</ContextNotice>
<div v-if="preview" class="min-w-0 space-y-3 text-xs leading-6">
@@ -115,7 +129,7 @@ const omitted = computed(
>
</div>
<!-- 以下是实际图片顺序和全部参考职责 -->
<ul v-if="references.length" class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
<ul v-if="references.length" class="image-reference-grid">
<li v-for="item in references" :key="item.order" class="min-w-0">
<div class="asset-image max-w-sm">
<RevealImage
@@ -134,21 +148,27 @@ const omitted = computed(
: '图片无法预览'
}}</span>
</div>
<p class="mt-1 font-medium">图 {{ item.order }}</p>
<p class="mt-1 flex items-center gap-2 font-medium">
图 {{ item.order
}}<FieldLabel
label="参考机位"
:description="referenceNotes(item.bindings)"
icon-only
icon="info"
verbatim
/>
</p>
<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] ?? '图片参考'
}}<template v-if="binding.subjectRef"> · {{ binding.subjectRef }}</template>
<template v-if="'viewDescription' in binding && binding.viewDescription">
· {{ binding.viewDescription }}</template
>
</p>
</li>
</ul>
<p v-else class="text-muted">本次没有图片参考。</p>
<NCollapse :default-expanded-names="['prompt']">
<NCollapse>
<NCollapseItem name="prompt" title="本次实际使用的画面描述">
<p class="whitespace-pre-wrap wrap-anywhere">{{ preview.providerPrompt }}</p>
<p
@@ -175,14 +195,6 @@ const omitted = computed(
</ul>
</NCollapseItem>
</NCollapse>
<RawDataDetails
:value="{
generationConfig: preview.generationConfig,
previewFingerprint: preview.previewFingerprint,
providerInputSnapshot: preview.providerInputSnapshot
}"
title="生成参数与参考图详情"
/>
</div>
</section>
</template>
@@ -479,7 +479,7 @@ function isInputMode(value: unknown, inputMode: string): boolean {
: '正在准备本次任务'
}}</template>
<template v-if="execution.currentResourceId && !scriptCreation && !breakdownTask && !derivedTask">
· 当前镜头 <code>{{ execution.currentResourceId }}</code></template
· 正在处理当前镜头</template
>
</p>
<ContextNotice
@@ -674,17 +674,12 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<!-- 以下是首帧工作流中断后的人工核查说明 -->
<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">
<NCollapse
v-if="!breakdownTask && !embedded && (recoveryKey || (videoQuality && settledItems.length))"
class="mt-3 text-xs text-muted"
>
<NCollapseItem name="task-details" title="任务详情">
<p class="mt-2 break-all font-mono">任务编号 · {{ execution.id }}</p>
<pre v-if="derivedTask && claims.length" class="mt-2 whitespace-pre-wrap wrap-anywhere">{{
JSON.stringify(claims, null, 2)
}}</pre>
<pre
v-if="derivedTask && (execution.error || result.episodes)"
class="mt-2 whitespace-pre-wrap wrap-anywhere"
>{{ JSON.stringify({ error: execution.error, result: execution.result }, null, 2) }}</pre>
<p v-if="recoveryKey" class="mt-2 break-all">原执行 · {{ execution.metadata?.recoveryOf }}</p>
<p v-if="recoveryKey" class="mt-2">本次从原任务继续处理,原记录仍保留。</p>
<!-- 以下是逐镜已结束质量任务的持久化状态模块 -->
<ul v-if="videoQuality && settledItems.length" class="mt-2 space-y-2">
<li v-for="item in settledItems" :key="item.shotId" class="break-all">
@@ -693,7 +688,7 @@ function isInputMode(value: unknown, inputMode: string): boolean {
class="text-button"
>查看镜头</a
>
· {{ executionStageLabel(item.status) }} · 视频 {{ item.videoId }}
· {{ executionStageLabel(item.status) }}
</li>
</ul>
</NCollapseItem>
+111
View File
@@ -1,3 +1,27 @@
/* 分镜审核与素材管理按可用宽度自适应排满,每项和所有行统一等高。 */
.asset-candidate-grid {
display: grid;
width: 100%;
align-items: stretch;
grid-auto-rows: 1fr;
gap: 12px;
grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
justify-content: start;
}
/* 参考输入以缩略图核对顺序,不在全屏审核中放大为正文尺寸。 */
.image-reference-grid {
display: grid;
gap: 12px;
grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
}
@media (max-width: 760px) {
/* 手机按可用内容宽度展示单列,正文与抽屉底栏继续各自布局。 */
.asset-candidate-grid {
max-width: none;
grid-template-columns: minmax(0, 1fr);
}
}
/* 管理后台视口边界:document 不滚动,各个工作区和面板独立滚动。 */
:root {
/* 页面外层留白与模块间距统一为 15px,各工作区共用同一对齐基线。 */
@@ -220,10 +244,97 @@ body {
.workspace-section-stack.workspace-section-stack-spacious {
gap: calc(var(--app-content-gap) * 2);
}
/* 公共弹层标题仅占一行,收缩标题而不挤占状态、说明和关闭入口。 */
.app-panel-title {
display: block;
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 公共弹层底栏按钮按原尺寸增加20%高度,文字和横向排布保持原规则。 */
.app-dialog .dialog-footer .n-button,
.app-drawer .app-drawer-footer .n-button {
height: calc(var(--n-height) * 1.2);
min-height: calc(var(--n-height) * 1.2);
}
/* 手机面板底栏:按钮等分并铺满每一行,长标签按实际宽度换行。 */
@media (max-width: 639px) {
.app-dialog.app-mobile-panel .dialog-footer,
.app-drawer.app-mobile-panel .app-drawer-footer {
justify-content: space-around;
flex-wrap: wrap;
}
.app-dialog.app-mobile-panel .dialog-footer > :is(.n-button, .confirm-action),
.app-drawer.app-mobile-panel .app-drawer-footer > :is(.n-button, .confirm-action) {
flex: 1 1 0;
min-width: max-content;
}
.app-dialog.app-mobile-panel .dialog-footer > :only-child,
.app-drawer.app-mobile-panel .app-drawer-footer > :only-child {
flex: 1;
min-width: 0;
}
.app-dialog.app-mobile-panel .dialog-footer > .confirm-action > .n-button,
.app-drawer.app-mobile-panel .app-drawer-footer > .confirm-action > .n-button {
width: 100%;
}
}
/* 编号功能区以交替底面区分,不再叠加块间空白;每块使用相同内边距。 */
.workspace-section-stack.workspace-numbered-sections {
gap: 0;
}
.workspace-numbered-sections > .workspace-numbered-section {
padding: 20px;
background: var(--app-subtle);
}
.workspace-numbered-sections > .workspace-numbered-section:nth-child(even) {
/* 偶数块也有独立底面,与弹窗背景和输入控件均保持层次。 */
background: var(--app-control-hover);
}
@media (max-width: 639px) {
.workspace-numbered-sections > .workspace-numbered-section {
padding: var(--app-content-padding);
}
}
/* 表单字段之间统一16px,标签到控件仍沿用8px,不混用模块间距。 */
.workspace-form-stack {
display: flex;
flex-direction: column;
gap: var(--app-field-gap);
}
/* 同类折叠统一行高;覆盖组件默认首行和后续行不同的 margin/padding。 */
.workspace-collapse.n-collapse > .n-collapse-item {
margin: 0;
border-top: 0;
}
.workspace-collapse.n-collapse > .n-collapse-item > .n-collapse-item__header {
min-height: 44px;
padding: 10px 0;
}
.workspace-collapse.n-collapse > .n-collapse-item:first-child > .n-collapse-item__header {
padding-top: 10px;
}
.workspace-collapse.n-collapse
> .n-collapse-item
> .n-collapse-item__content-wrapper
> .n-collapse-item__content-inner {
padding: 6px 0 var(--app-field-gap);
}
/* 摄影等长文编辑共用舒展行距,原文不裁剪或改写。 */
.workspace-prose-input.n-input :is(.n-input__textarea-el, .n-input__textarea-mirror) {
line-height: 1.85;
font-size: 14px;
}
.workspace-panel {
padding: 20px;
background: var(--app-subtle);
}
/* 当前开拍事实与摄影规划使用不同中性底面,背景差异不表达审核通过。 */
.workspace-panel-facts {
background: var(--app-control);
}
.workspace-panel + .workspace-panel {
margin-top: 20px;
}
+15
View File
@@ -43,6 +43,21 @@ export async function expandSections() {
}
}
/**
* 只展开用户需要核对的真实详情,不用测试直接访问默认隐藏的控件。
* @param label 完整折叠标题
* @param root 弹窗所在document或独立组件根节点
*/
export async function expandSection(label: string, root: ParentNode = document) {
const header = [...root.querySelectorAll<HTMLElement>('.n-collapse-item__header-main')].find(
item => item.textContent?.trim() === label
)
if (!header) throw new Error('找不到详情:' + label)
if (header.closest('.n-collapse-item')?.classList.contains('n-collapse-item--active')) return
header.click()
await flushPromises()
}
/** Naive Select 没有原生 select,通过公开事件模拟选项变化并保留业务守卫。 */
export function selectControl(wrapper: VueWrapper, attribute: string, value: string) {
const select = wrapper.findAllComponents(NSelect).find(item => item.attributes(attribute) === value)
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-CN" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>移动弹窗手势隔离验收</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./mobile-panels.ts"></script>
</body>
</html>
+109
View File
@@ -0,0 +1,109 @@
import { createApp, defineComponent, h, ref } from 'vue'
import { NButton, NCheckbox, NConfigProvider, NInput, darkTheme } from 'naive-ui'
import AppDialog from '../../src/components/ui/AppDialog.vue'
import AppDrawer from '../../src/components/ui/AppDrawer.vue'
import '../../src/styles/styles.css'
import '../../src/styles/admin.css'
/** 本页所有请求都拒绝,不连接项目或模型。 */
window.fetch = async () => new Response(JSON.stringify({ message: '隔离验收禁止联网请求' }), { status: 403 })
/** 覆盖手机和桌面超长标题,完整原文仍通过标题提示保留。 */
const longTitle = '标题只占一行,超出宽度显示省略号,并保留完整名称。'.repeat(8)
/** 仅在内存中观察关闭、输入、提交锁和长内容,不保存正式数据。 */
const Preview = defineComponent({
setup() {
/** 普通弹窗开关。 */ const dialog = ref(false)
/** 全屏抽屉开关。 */ const drawer = ref(false)
/** 模拟真实提交锁,不发起任务。 */ const busy = ref(false)
/** 切换普通弹窗长内容。 */ const long = ref(false)
/** 关闭后重新打开仍保留父组件输入。 */ const draft = ref('这段隔离输入关闭后仍保留')
/** 展示真实完成关闭次数。 */ const closed = ref(0)
/**
* 两种公共弹层共用的验证正文。
* @param full 是否默认长内容
* @returns 原生表单及长文
*/
function body(full: boolean) {
return h('div', { class: 'workspace-section-stack' }, [
h('p', '按住顶部横条向下拖动关闭;轻触和短拖保持展开。'),
h(
NCheckbox,
{ checked: busy.value, 'onUpdate:checked': (value: boolean) => (busy.value = value) },
() => '模拟提交中'
),
h(NInput, {
value: draft.value,
'onUpdate:value': (value: string) => (draft.value = value),
'aria-label': '隔离输入'
}),
!full &&
h(
NCheckbox,
{ checked: long.value, 'onUpdate:checked': (value: boolean) => (long.value = value) },
() => '显示长内容'
),
...(full || long.value
? Array.from({ length: 35 }, (_, index) =>
h(
'p',
`段落 ${index + 1}:这是只读测试内容,用于核对正文滚动不会拖动面板,底部关闭按钮保持可见。`
)
)
: [])
])
}
return () =>
h(
NConfigProvider,
{ theme: darkTheme },
{
default: () =>
h('main', { style: 'padding:24px' }, [
h('h1', '手机面板隔离验收'),
h(
'p',
{ style: 'margin:16px 0' },
`真实请求0次 · 关闭完成${closed.value}次 · 普通弹窗${dialog.value ? '已打开' : '已关闭'} · 全屏抽屉${drawer.value ? '已打开' : '已关闭'}`
),
h('div', { class: 'flex flex-wrap gap-3' }, [
h(NButton, { onClick: () => (dialog.value = true) }, () => '打开普通弹窗'),
h(NButton, { onClick: () => (drawer.value = true) }, () => '打开全屏抽屉')
]),
h(
AppDialog,
{
open: dialog.value,
'onUpdate:open': (value: boolean) => (dialog.value = value),
title: `普通弹窗 · ${longTitle}`,
busy: busy.value,
onClosed: () => closed.value++
},
{ default: () => body(false) }
),
h(
AppDrawer,
{
open: drawer.value,
'onUpdate:open': (value: boolean) => (drawer.value = value),
title: `全屏抽屉 · ${longTitle}`,
busy: busy.value,
onClosed: () => closed.value++
},
{
default: () => body(true),
footer: () => [
h(
NButton,
{ disabled: busy.value, onClick: () => (drawer.value = false) },
() => '关闭'
),
h(NButton, { disabled: true, type: 'primary' }, () => '模拟保存')
]
}
)
])
}
)
}
})
createApp(Preview).mount('#app')
+8 -3
View File
@@ -22,14 +22,19 @@ const review = {
)
}
/**
* 只允许免费诊断和只读回读,批准、签收、执行及恢复全部拒绝。
* 只允许免费诊断、布局输入预览和只读回读,批准、签收、执行及恢复全部拒绝。
* @param input 请求地址
* @param init 请求选项
* @returns 隔离响应
*/
window.fetch = async (input, init) => {
const path = String(input)
if (init?.method && init.method !== 'GET' && !path.endsWith('/continuity/diagnosis'))
const path = new URL(String(input), window.location.origin).pathname
if (
init?.method &&
init.method !== 'GET' &&
!path.endsWith('/continuity/diagnosis') &&
!path.endsWith('/keyframe/preview')
)
return new Response(JSON.stringify({ message: '隔离页禁止写入与付费' }), { status: 403 })
let data: unknown
if (path.includes('/vision/preview'))
+5 -1
View File
@@ -58,7 +58,11 @@ describe('管理后台组件边界', () => {
const assetPicker = /\.style-asset-picker\s*\{[^}]*\}/
expect(css.match(assetPicker)?.[0]).toContain('max-height: 280px;')
expect(css.match(assetPicker)?.[0]).toContain('overflow-y: auto;')
expect(css.replace(mobileReading, '').replace(assetPicker, '')).not.toMatch(
/** 图片详情浮层有独立高度上限,不让长错误改变卡片与页面高度。 */
const candidateDetails = /\.keyframe-card-details\s*\{[^}]*\}/
expect(css.match(candidateDetails)?.[0]).toContain('max-height: min(480px, 65dvh);')
expect(css.match(candidateDetails)?.[0]).toContain('overflow-y: auto;')
expect(css.replace(mobileReading, '').replace(assetPicker, '').replace(candidateDetails, '')).not.toMatch(
/overflow(?:-[xy])?\s*:\s*(?:auto|scroll)\b/
)
})
+216
View File
@@ -0,0 +1,216 @@
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { NDrawer } from 'naive-ui'
import MobilePanelHandle from '@/components/ui/MobilePanelHandle.vue'
import AppDialog from '@/components/ui/AppDialog.vue'
import AppDrawer from '@/components/ui/AppDrawer.vue'
/** 当前测试挂载实例,结束后释放监听和计时。 */
let wrapper: VueWrapper | undefined
afterEach(() => {
wrapper?.unmount()
wrapper = undefined
document.body.innerHTML = ''
vi.useRealTimers()
vi.restoreAllMocks()
})
/**
* 明确模拟手机断点及旋转,动画偏好默认正常。
* @param initial 初始是否手机
* @returns 改变断点的方法
*/
function viewport(initial = true) {
let mobile = initial
const listeners = new Set<(event: MediaQueryListEvent) => void>()
vi.spyOn(window, 'matchMedia').mockImplementation(
query =>
({
media: query,
get matches() {
return query === '(max-width: 639px)' && mobile
},
onchange: null,
addEventListener: (_type: string, listener: EventListenerOrEventListenerObject) => {
if (query === '(max-width: 639px)') listeners.add(listener as (event: MediaQueryListEvent) => void)
},
removeEventListener: (_type: string, listener: EventListenerOrEventListenerObject) =>
listeners.delete(listener as (event: MediaQueryListEvent) => void),
addListener: vi.fn<() => void>(),
removeListener: vi.fn<() => void>(),
dispatchEvent: () => true
}) as MediaQueryList
)
return (next: boolean) => {
mobile = next
listeners.forEach(listener => listener({ matches: next } as MediaQueryListEvent))
}
}
/**
* 发送真实指针事件,显式指定时间以验证拖动距离和甩动速度。
* @param node 手柄或正文节点
* @param type 指针阶段
* @param y 当前纵坐标
* @param time 当前毫秒
* @param x 当前横坐标
* @param id 指针身份
*/
function pointer(node: Element, type: string, y: number, time: number, x = 10, id = 1) {
const event = new PointerEvent(type, {
bubbles: true,
cancelable: true,
pointerId: id,
isPrimary: id === 1,
button: 0,
clientX: x,
clientY: y
})
Object.defineProperty(event, 'timeStamp', { value: time })
node.dispatchEvent(event)
}
/** 创建一个真实面板容器,所有手势只作用于最近这一层。 */
function handle() {
viewport()
vi.useFakeTimers()
const panel = document.createElement('div')
panel.className = 'app-mobile-panel'
document.body.append(panel)
vi.spyOn(panel, 'getBoundingClientRect').mockReturnValue({ height: 600 } as DOMRect)
wrapper = mount(MobilePanelHandle, { attachTo: panel, props: { active: true } })
return { panel, grip: wrapper.get('button').element }
}
describe('手机面板手柄关闭', () => {
it('轻触、短拖和横向移动均回位,正文没有拖动关闭监听', async () => {
const { panel, grip } = handle()
pointer(grip, 'pointerdown', 0, 0)
pointer(grip, 'pointerup', 0, 100)
await vi.advanceTimersByTimeAsync(180)
pointer(grip, 'pointerdown', 0, 200)
pointer(grip, 'pointermove', 30, 500)
expect(panel.style.transform).toContain('30px')
pointer(grip, 'pointerup', 30, 800)
grip.dispatchEvent(new MouseEvent('click', { detail: 0, bubbles: true }))
await vi.advanceTimersByTimeAsync(180)
expect(panel.style.transform).toBe('')
pointer(grip, 'pointerdown', 0, 900)
pointer(grip, 'pointerup', 120, 950, 200)
await vi.advanceTimersByTimeAsync(180)
pointer(panel, 'pointerdown', 0, 1000)
pointer(panel, 'pointermove', 300, 1300)
pointer(panel, 'pointerup', 300, 1400)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
})
it.each([
[160, 1000],
[64, 40]
])('明确下拉或快速甩动关闭一次:%s像素/%s毫秒', async (distance, time) => {
const { panel, grip } = handle()
pointer(grip, 'pointerdown', 0, 0)
pointer(grip, 'pointermove', distance, time)
pointer(grip, 'pointerup', distance, time)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toEqual([[]])
expect(panel.hasAttribute('data-drag-dismissed')).toBe(true)
pointer(grip, 'pointerup', distance, time + 1)
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toHaveLength(1)
await wrapper!.setProps({ active: false })
await wrapper!.setProps({ active: true })
expect(panel.style.transform).toBe('')
expect(panel.hasAttribute('data-drag-dismissed')).toBe(false)
})
it.each(['pointercancel', 'lostpointercapture'])('系统取消%s时不关闭', async type => {
const { grip } = handle()
pointer(grip, 'pointerdown', 0, 0)
pointer(grip, 'pointermove', 200, 100)
pointer(grip, type, 200, 110)
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
})
it('拖动中进入提交状态撤销手势,离场动画中加锁也不关闭', async () => {
const { grip } = handle()
pointer(grip, 'pointerdown', 0, 0)
pointer(grip, 'pointermove', 200, 100)
await wrapper!.setProps({ disabled: true })
pointer(grip, 'pointerup', 200, 120)
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
await wrapper!.setProps({ disabled: false })
pointer(grip, 'pointerdown', 0, 500)
pointer(grip, 'pointerup', 200, 600)
await wrapper!.setProps({ disabled: true })
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
})
it('额外触点不能接管主指针,向上拖动不关闭', async () => {
const { panel, grip } = handle()
pointer(grip, 'pointerdown', 100, 0)
pointer(grip, 'pointerdown', 0, 1, 10, 2)
pointer(grip, 'pointermove', 400, 30, 10, 2)
expect(panel.style.transform).toBe('')
pointer(grip, 'pointermove', 40, 100)
pointer(grip, 'pointerup', 40, 200)
await vi.advanceTimersByTimeAsync(180)
expect(wrapper!.emitted('dismiss')).toBeUndefined()
})
it.each([AppDialog, AppDrawer])('公共弹层复用手柄,提交锁与键盘关闭同时生效', async component => {
viewport()
wrapper = mount(component, {
attachTo: document.body,
props: { open: true, title: '隔离弹窗', busy: true },
slots: { default: '<p>原正文保持</p>' }
})
await flushPromises()
const grip = document.querySelector<HTMLButtonElement>('.mobile-panel-handle')!
expect(grip.disabled).toBe(true)
expect(document.querySelector('.app-mobile-panel')?.textContent).toContain('原正文保持')
await wrapper.setProps({ busy: false })
grip.dispatchEvent(new MouseEvent('click', { detail: 0, bubbles: true }))
expect(wrapper.emitted('update:open')?.at(-1)).toEqual([false])
})
it('切回桌面时清除正在拖动的位移,继续沿用原抽屉布局', async () => {
const changeViewport = viewport()
wrapper = mount(AppDrawer, { attachTo: document.body, props: { open: true, title: '隔离抽屉' } })
await flushPromises()
expect(wrapper.getComponent(NDrawer).props('placement')).toBe('bottom')
const grip = document.querySelector('.mobile-panel-handle')!,
panel = document.querySelector<HTMLElement>('.app-mobile-panel')!
pointer(grip, 'pointerdown', 0, 0)
pointer(grip, 'pointermove', 90, 100)
expect(panel.style.transform).toContain('90px')
changeViewport(false)
await flushPromises()
expect(wrapper.getComponent(NDrawer).props('placement')).toBe('right')
expect(document.querySelector('.mobile-panel-handle')).toBeNull()
expect(panel.style.transform).toBe('')
expect(wrapper.emitted('update:open')).toBeUndefined()
})
it.each([AppDialog, AppDrawer])('正文滚动才显示标题阴影,回到顶部和重新打开均清除', async component => {
viewport()
wrapper = mount(component, {
attachTo: document.body,
props: { open: true, title: '滚动阴影' },
slots: { default: '<p>长正文</p>' }
})
await flushPromises()
const frame = document.querySelector<HTMLElement>('.app-mobile-panel')!
const scroll = frame.querySelector<HTMLElement>('.n-scrollbar-container')!
expect(frame.classList.contains('has-body-scroll')).toBe(false)
Object.defineProperty(scroll, 'scrollTop', { value: 80, writable: true })
scroll.dispatchEvent(new Event('scroll'))
await flushPromises()
expect(frame.classList.contains('has-body-scroll')).toBe(true)
scroll.scrollTop = 0
scroll.dispatchEvent(new Event('scroll'))
await flushPromises()
expect(frame.classList.contains('has-body-scroll')).toBe(false)
scroll.scrollTop = 60
scroll.dispatchEvent(new Event('scroll'))
await flushPromises()
await wrapper.setProps({ open: false })
await wrapper.setProps({ open: true })
await flushPromises()
expect(document.querySelector('.app-mobile-panel')?.classList.contains('has-body-scroll')).toBe(false)
})
})
@@ -0,0 +1,96 @@
import { type Component } from 'vue'
import { flushPromises, mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import AppDialog from '@/components/ui/AppDialog.vue'
import AppDrawer from '@/components/ui/AppDrawer.vue'
import WorkspaceSectionHeading from '@/components/ui/WorkspaceSectionHeading.vue'
import FieldLabel from '@/components/ui/FieldLabel.vue'
import ImageGenerationPreview from '@/features/subject-images/components/ImageGenerationPreview.vue'
import { imagePreviewFixture } from '../../fixtures/image-preview'
/** 各种公共标题保持相同的说明入口,动态状态不被隐藏。 */
const cases: Array<{
/** 当前公共布局。 */ component: Component
/** 可访问说明名称。 */ label: string
/** 原布局需要的显隐参数。 */ extra: Record<string, unknown>
}> = [
{ component: AppDialog, label: '操作说明', extra: { open: true } },
{ component: AppDrawer, label: '操作说明', extra: { open: true } },
{ component: WorkspaceSectionHeading, label: '审核范围说明', extra: {} }
]
describe('分镜界面按需显示说明', () => {
it.each(cases)('$label 首屏保留标题,完整说明由用户主动展开', async ({ component, label, extra }) => {
const wrapper = mount(component, {
props: {
...extra,
title: '审核范围',
description: '完整操作说明应能保留并随时核对',
descriptionAsInfo: true
},
global: { stubs: { teleport: true } }
})
try {
await flushPromises()
expect(wrapper.text()).toContain('审核范围')
expect(wrapper.text()).not.toContain('完整操作说明应能保留')
await wrapper.get(`button[aria-label="${label}"]`).trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('完整操作说明应能保留并随时核对')
} finally {
wrapper.unmount()
}
})
it('动态状态插槽直接显示,不能被静态说明收起选项隐藏', async () => {
const wrapper = mount(AppDialog, {
props: { open: true, title: '原任务', description: '流程说明', descriptionAsInfo: true },
slots: { description: '<p>当前费用未知,请核查原请求</p>' },
global: { stubs: { teleport: true } }
})
try {
await flushPromises()
expect(wrapper.text()).toContain('当前费用未知,请核查原请求')
expect(wrapper.find('button[aria-label="操作说明"]').exists()).toBe(false)
} finally {
wrapper.unmount()
}
})
it('视觉重点等创作内容原样展示,不被系统术语转换改写', async () => {
const original = 'Prompt 是角色在画面中写下的原始台词'
const wrapper = mount(FieldLabel, {
props: { label: '视觉重点', description: original, iconOnly: true, icon: 'info', verbatim: true },
global: { stubs: { teleport: true } }
})
try {
expect(wrapper.text()).not.toContain(original)
await wrapper.get('button').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain(original)
} finally {
wrapper.unmount()
}
})
it('图片预览先显示参考与主要操作,完整提示词仍可主动核对', async () => {
const original = '必须完整保留的画面描述,'.repeat(30)
const wrapper = mount(ImageGenerationPreview, {
props: {
preview: { ...imagePreviewFixture(), providerPrompt: original },
loading: false,
error: '',
staleNotice: ''
}
})
try {
expect(wrapper.text()).toContain('预览实际生成输入')
expect(wrapper.text()).not.toContain(original)
await wrapper
.findAll('.n-collapse-item__header-main')
.find(row => row.text() === '本次实际使用的画面描述')!
.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain(original)
} finally {
wrapper.unmount()
}
})
})
@@ -56,8 +56,8 @@ describe('联合审核单次批准和业务状态', () => {
const w = await open(status)
expect(w.text()).toContain('未知')
expect(w.text()).toContain('空间参考')
expect(w.text()).toContain('s1')
expect(w.text()).toContain('s2')
expect(w.text()).toContain('审核范围第 1 镜')
expect(w.text()).toContain('审核范围第 2 镜')
expect(auth).not.toHaveBeenCalled()
expect(execute).not.toHaveBeenCalled()
expect((w.vm as unknown as { canExecute: boolean }).canExecute).toBeFalsy()
@@ -32,6 +32,7 @@ describe('连续性审核真实组件流程', () => {
props: { open: true, projectId: 'mock-project', shots: continuityShots, disabled: false },
global: {
stubs: {
teleport: true,
AppDrawer: { template: '<div><slot/><slot name="footer"/></div>' },
AssetImage: true,
LayoutSupplementPanel: true
@@ -42,6 +43,9 @@ describe('连续性审核真实组件流程', () => {
expect(mock.calls.every(item => item.method === 'GET')).toBe(true)
await click('免费读取当前证据')
expect(wrapper.text()).toContain('证据不足')
expect(wrapper.text()).not.toContain('开门、关门属于即时状态')
await wrapper.get('button[aria-label="人工观察说明"]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('开门、关门属于即时状态')
const inputs = wrapper.findAllComponents(NInput)
inputs.find(item => item.props('placeholder') === '固定地标一')!.vm.$emit('update:value', '窗')
@@ -122,6 +126,14 @@ describe('连续性审核真实组件流程', () => {
await flushPromises()
await click('免费预览结构约束')
expect(wrapper.text()).toContain('需要确认布局并重新确认母版')
await wrapper
.findAll('.n-collapse-item__header-main')
.find(item => item.text() === '本次完整布局约束')!
.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('固定连接位置')
expect(wrapper.text()).not.toContain(fingerprint)
expect(wrapper.text()).not.toContain('"layoutConfirmation"')
inputs
.find(item => item.props('placeholder') === '待审结构约束,例如固定连接位置与活动方向')!
.vm.$emit('update:value', '修改后的门轴')
@@ -0,0 +1,57 @@
import { flushPromises, mount } from '@vue/test-utils'
import { describe, expect, it, vi } from 'vitest'
import KeyframeDialog from '@/features/production/components/KeyframeDialog.vue'
import { billingCatalog, billingProfile, imageAuthorizationsFixture } from '../../fixtures/billing'
describe('首帧生成首屏只展示当前需要的信息', () => {
it('普通有效授权不常驻未知费用提示;出现真实阻断后重新打开才展示人工许可', async () => {
const list = imageAuthorizationsFixture(),
generate = vi.fn<() => Promise<{ accepted: boolean }>>(async () => ({ accepted: true }))
const fetcher = vi.fn<typeof fetch>(async url => {
const path = String(url)
if (path.endsWith('/generation-models')) return Response.json({ data: billingCatalog })
if (path.endsWith('/creative-profile')) return Response.json({ data: billingProfile })
if (path.endsWith('/resolve'))
return Response.json({
data: {
provider: 'openai-image',
model: 'gpt-image-2.5-flare',
options: { size: '1024x1024', quality: 'auto', count: 1 }
}
})
if (path.endsWith('/image-authorizations')) return Response.json({ data: list })
throw new Error('未模拟:' + path)
})
vi.stubGlobal('fetch', fetcher)
const wrapper = mount(KeyframeDialog, {
props: {
projectId: 'clean-density-project',
shotId: 'density-shot',
shotTitle: '当前镜头',
disabled: false,
open: true,
submitGeneration: generate
},
global: { stubs: { teleport: true } }
})
try {
await flushPromises()
expect(wrapper.find('[aria-label="本次人工追加许可"]').exists()).toBe(false)
expect(wrapper.text()).not.toContain('原请求在途或费用待核对')
expect(wrapper.text()).toContain('预览实际生成输入')
list.billingBlocked = true
await wrapper.setProps({ open: false })
await flushPromises()
await wrapper.setProps({ open: true })
await flushPromises()
expect(wrapper.find('[aria-label="本次人工追加许可"]').exists()).toBe(true)
expect(wrapper.text()).toContain('有限许可不会核清旧费用')
expect(generate).not.toHaveBeenCalled()
expect(
fetcher.mock.calls.some(([url]) => /\/keyframe$|\/generate|\/primary|\/vision/.test(String(url)))
).toBe(false)
} finally {
wrapper.unmount()
}
})
})
@@ -2,6 +2,7 @@ import { flushPromises, mount } from '@vue/test-utils'
import { describe, expect, it, vi } from 'vitest'
import KeyframeInputDetails from '@/features/production/components/KeyframeInputDetails.vue'
import { historicalReferenceUrl, type HistoricalKeyframeReference } from '@/features/production/keyframe-input'
import { expandSection } from '@/testing/naive'
/** 两种职责对应同一张实际参考图。 */
const reference: HistoricalKeyframeReference = {
@@ -66,6 +67,8 @@ describe('历史首帧输入', () => {
expect(fetcher).not.toHaveBeenCalled()
await wrapper.get('.n-collapse-item__header-main').trigger('click')
await flushPromises()
expect(wrapper.text()).not.toContain('当次描述 one')
await expandSection('本次实际使用的画面描述', wrapper.element)
expect(wrapper.text()).toContain('当次描述 one')
expect(wrapper.text()).toContain('原图已变化')
expect(wrapper.text()).toContain('@CH01')
@@ -73,6 +76,8 @@ describe('历史首帧输入', () => {
expect(wrapper.find('img').exists()).toBe(false)
await wrapper.setProps({ keyframeId: 'two' })
await flushPromises()
expect(wrapper.text()).not.toContain('当次描述 two')
await expandSection('本次实际使用的画面描述', wrapper.element)
expect(wrapper.text()).toContain('当次描述 two')
expect(wrapper.text()).not.toContain('当次描述 one')
expect(wrapper.text()).toContain('原图不可用')
+5 -1
View File
@@ -14,6 +14,7 @@ import {
validOptionalSize
} from '@/features/production/model'
import { keyframeFixture, videoFixture } from '@/features/production/testing/fixtures'
import { expandSection } from '@/testing/naive'
let wrapper: VueWrapper | undefined
afterEach(() => {
@@ -59,7 +60,8 @@ describe('镜头生产数据契约', () => {
expect(source).toMatch(
/\.video-input-grid\s*\{[^}]*max-width:\s*calc\(var\(--video-input-count\) \* 220px \+ \(var\(--video-input-count\) - 1\) \* 12px\)/
)
expect(source).toMatch(/\.keyframe-card \.asset-image\s*\{[^}]*aspect-square/)
const keyframeCard = readFileSync('src/features/production/components/KeyframeCard.vue', 'utf8')
expect(keyframeCard).toMatch(/\.keyframe-card \.asset-image\s*\{[^}]*aspect-square/)
const videoCard = readFileSync('src/features/production/components/VideoCard.vue', 'utf8')
expect(videoCard).toContain('class="block aspect-square w-full bg-[#080808] object-contain"')
expect(source).toMatch(/\.video-input-card\s*\{[^}]*bg-\(--app-control\)/)
@@ -359,6 +361,8 @@ describe('镜头生产数据契约', () => {
})
expect(document.body.textContent).toContain('1 张参考图')
expect(document.body.textContent).toContain('未进入模型的参考图')
expect(document.body.textContent).not.toContain('最终首帧 Prompt')
await expandSection('本次实际使用的画面描述')
expect(document.body.textContent).toContain('最终首帧 Prompt')
expect(wrapper.emitted('generate')).toBeUndefined()
})
@@ -272,6 +272,14 @@ it('抽屉使用真实表单,打开只读历史,免费预检逐项展示全
expect(wrapper.text()).toContain('@SC1')
expect(wrapper.text()).toContain('@SC2')
expect(wrapper.text()).not.toContain('登记本次费用批准')
await wrapper
.findAll('.n-collapse-item__header-main')
.find(item => item.text() === '原图片生成记录')!
.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('历史描述')
expect(wrapper.text()).not.toContain(hash)
expect(wrapper.find('pre').exists()).toBe(false)
} finally {
wrapper.unmount()
}
@@ -7,9 +7,27 @@ import KeyframeValidationHistory from '@/features/production/components/Keyframe
import { additionalImageFixture } from '../../fixtures/image-additional'
import { AssetImage } from '@/components/ui'
import { keyframeFixture } from '@/features/production/testing/fixtures'
import { keyframeDisplayNames } from '@/features/production/model'
import { imagePreviewFixture } from '../../fixtures/image-preview'
describe('V8-10免费输入与独立门禁', () => {
it('图片名称按原创建时间编号,倒序与主图切换仍使用相同名称', () => {
const old = keyframeFixture({ id: 'old', createdAt: '2026-11-01T00:00:00Z', isPrimary: false }),
recent = keyframeFixture({ id: 'recent', createdAt: '2026-11-02T00:00:00Z', isPrimary: true })
const names = keyframeDisplayNames([recent, old], '午后收整工具', 1)
expect(names.get('old')).toBe('午后收整工具 · 图片 01')
expect(names.get('recent')).toBe('午后收整工具 · 图片 02')
expect(
keyframeDisplayNames(
[
{ ...old, isPrimary: true },
{ ...recent, isPrimary: false }
],
'午后收整工具',
1
)
).toEqual(names)
})
it('旧图片按需查看原费用与来源,切换项目/候选后不混入其它记录或未执行计划', async () => {
const fetcher = vi.fn<typeof fetch>(async url => {
const path = String(url)
@@ -17,11 +35,12 @@ describe('V8-10免费输入与独立门禁', () => {
const projectId = path.includes('/second-project/') ? 'second-project' : 'original-project',
list = additionalImageFixture(projectId)
list.requests[0]!.input.targetId = 'history-shot'
list.requests[0]!.input.model = '原图片实际型号'
list.requests[0]!.input.candidateId = projectId === 'second-project' ? 'second-image' : 'old-image'
list.requests.push({
...structuredClone(list.requests[0]!),
id: 'another-candidate-request',
input: { ...list.requests[0]!.input, candidateId: 'unrelated-image' }
input: { ...list.requests[0]!.input, candidateId: 'unrelated-image', model: '其它图片的型号' }
})
return Response.json({ data: list })
}
@@ -59,6 +78,9 @@ describe('V8-10免费输入与独立门禁', () => {
.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('原预留 USD 0.5')
expect(wrapper.text()).toContain('原图片实际型号')
expect(wrapper.text()).not.toContain('其它图片的型号')
expect(wrapper.findAll('[aria-label="原图片生成记录"]')).toHaveLength(1)
expect(wrapper.text()).toContain('实际账单 未知')
expect(wrapper.text()).toContain('历史审核未通过,当前来源已变化')
expect(wrapper.text()).not.toContain('another-candidate-request')
@@ -104,7 +126,9 @@ describe('V8-10免费输入与独立门禁', () => {
id: 'old-image',
shotId: 'quality-shot',
isPrimary: true,
imageUrl: '/mock.png'
imageUrl: '/mock.png',
model: '仅供详情核对的原型号',
error: '这份很长的历史错误只应在详情中展示'
}),
projectId: 'quality-project',
shotId: 'quality-shot',
@@ -113,11 +137,21 @@ describe('V8-10免费输入与独立门禁', () => {
blocked: true,
validationPassed: true,
confirming: false,
readonly: true
}
readonly: true,
displayName: '午后收整工具 · 图片 01'
},
global: { stubs: { teleport: true } }
})
try {
await flushPromises()
expect(wrapper.get('.keyframe-card-name').text()).toBe('午后收整工具 · 图片 01')
expect(wrapper.text()).not.toContain('这份很长的历史错误')
expect(wrapper.text()).not.toContain('仅供详情核对的原型号')
expect(wrapper.text()).toContain('审核来源过期')
await wrapper.get('button[aria-label="查看首帧详情"]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('这份很长的历史错误只应在详情中展示')
expect(wrapper.text()).toContain('仅供详情核对的原型号')
expect(wrapper.text()).toContain(
machine === 'failed' ? '历史审核未通过,当前来源已变化' : '历史审核通过,当前来源已变化'
)
@@ -55,10 +55,11 @@ describe('按任务读取执行历史的页面流程', () => {
expect(wrapper.text()).toContain('执行完成,质量请查看当前结论')
expect(wrapper.text()).toContain('本次新提交步骤:物理关系;复用已有步骤:通用画面')
await expand('通用画面')
expect(wrapper.text()).toContain('原调用计量,不重复计入本次')
await expand('高级详情')
expect(wrapper.text()).toContain('输入词元:100')
expect(wrapper.text()).toContain('复用来源执行:old-run')
expect(wrapper.text()).toContain('本步骤复用原调用,不重复计入本次费用')
await expand('步骤记录')
expect(wrapper.text()).toContain('原调用复用')
expect(wrapper.text()).not.toContain('输入词元')
expect(wrapper.text()).not.toContain('old-run')
expect(wrapper.text()).not.toContain('合计词元:0')
await wrapper
.findAll('button')
@@ -168,9 +168,19 @@ describe('已有失败图片的摄影修订', () => {
it('保存不采用;明确采用后旧failed转当前stale,原Primary/图片/审核和费用仍保留', async () => {
const { wrapper, fetcher, rows } = await camera()
try {
expect(
wrapper
.findAll('.workspace-numbered-sections > .workspace-numbered-section')
.map(block => block.get('.workspace-section-marker').text())
).toEqual(['I', 'II', 'III', 'IV', 'V'])
const input = wrapper.findAllComponents(NInput).find(row => row.attributes('aria-label') === '摄影构图')!
input.vm.$emit('update:value', '本次新构图,保持正式主体与原动作')
await flushPromises()
expect(
wrapper
.findAll('.workspace-numbered-sections > .workspace-numbered-section')
.map(block => block.get('.workspace-section-marker').text())
).toEqual(['I', 'II', 'III', 'IV', 'V', 'VI'])
await click(wrapper, '保存草案')
expect(
fetcher.mock.calls.some(([url]) => String(url).endsWith('/storyboard-derived-reviews/confirm'))
@@ -205,6 +215,8 @@ describe('已有失败图片的摄影修订', () => {
depthOfField: 'shallow',
visualIntent: '观察来信'
})
await wrapper.findAll('.keyframe-card')[0]!.get('button[aria-label="查看首帧详情"]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('历史审核未通过,当前来源已变化')
expect(wrapper.text()).toContain('草案来源已变化')
expect(wrapper.text()).toContain('主首帧')
@@ -194,6 +194,17 @@ describe('原摄影抽屉内的联合流程', () => {
it.each([false, true])('保存、画面预览、联合免费预检和采用分开,幂等回执=%s', async reused => {
const { wrapper, fetcher, fixture } = await editor(false, reused)
expect(wrapper.text()).toContain('完整字段差异(4 项)')
expect(wrapper.findAll('.workspace-section-marker').map(item => item.text())).toEqual([
'I',
'II',
'III',
'IV',
'V',
'VI'
])
expect(wrapper.findAll('.workspace-panel > .workspace-section-heading .workspace-section-marker')).toHaveLength(
0
)
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
wrapper
.findAllComponents(NInput)
@@ -280,6 +291,15 @@ describe('原摄影抽屉内的联合流程', () => {
it('环境差异须逐字本集证据,冻结原字节全文SHA;保存和预检不自动采用', async () => {
const { wrapper, fetcher, episode } = await editor(false, false, true)
expect(wrapper.text()).toContain('本集原文依据')
expect(wrapper.findAll('.workspace-section-marker').map(item => item.text())).toEqual([
'I',
'II',
'III',
'IV',
'V',
'VI',
'VII'
])
await wrapper.vm.save()
await flushPromises()
await click(wrapper, '免费核对草案画面输入')
+3 -1
View File
@@ -10,7 +10,7 @@ import GenerateImageDialog from '@/features/subject-images/components/GenerateIm
import ImageGalleryDialog from '@/features/subject-images/components/ImageGalleryDialog.vue'
import { coverImage, hasRunningImages, primaryImage, validImageSize } from '@/features/subject-images/model'
import { formFixture, imageFixture } from '@/features/subject-images/testing/fixtures'
import { expandSections } from '@/testing/naive'
import { expandSections, expandSection } from '@/testing/naive'
/** 当前测试使用真实目录契约构造项目模型配置。 */
const creativeProfile = generationProfile('gallery-test')
@@ -153,6 +153,8 @@ describe('形态图片选择与操作', () => {
await flushPromises()
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/subject-forms/form-db-1/images/preview')
expect(document.body.textContent).toContain('seedream / image-model')
expect(document.body.textContent).not.toContain('最终形态 Prompt')
await expandSection('本次实际使用的画面描述')
expect(document.body.textContent).toContain('最终形态 Prompt')
expect(wrapper.emitted('generate')).toBeUndefined()
})
+24 -6
View File
@@ -39,9 +39,8 @@ import { subjectImagesApi } from '@/features/subject-images/api'
import { styleFixture, styleImageFixture } from '@/features/visual-style/testing/fixtures'
import { identityFixture, identityImageFixture } from '@/features/subject-identity/testing/fixtures'
import { getIdentitySession } from '@/features/subject-identity/model'
import { drawerPanel, expandSections, selectControl } from '@/testing/naive'
import { drawerPanel, expandSections, expandSection, selectControl } from '@/testing/naive'
import ProductionPage from '@/features/production/ProductionPage.vue'
import RawDataDetails from '@/components/ui/RawDataDetails.vue'
import { getProductionSession } from '@/features/production/model'
import { generationConfigApi } from '@/features/generation-config/api'
import { AppDialog } from '@/components/ui'
@@ -1791,7 +1790,24 @@ describe('工作台页面交互', () => {
description: '真实镜头',
visualFocus: '信封',
durationSeconds: 5,
subjects: [{ subjectId: 'subject-db', subjectFormId: 'form-db' }],
subjects: [
{
subjectId: 'subject-db',
subjectFormId: 'form-db',
subjectRef: '@CH0001',
subjectName: '林知夏',
subjectFormName: '日常',
module: 'character',
identityDescription: '正式人物',
appearancePrompt: '原形态描述',
generationPrompt: '原生成描述',
expression: '平静',
pose: '站立',
gaze: '信封',
position: '画面右侧',
transientState: '手持信封'
}
],
direction: shot.direction,
environment: {
timeOfDay: '夜晚',
@@ -1817,9 +1833,11 @@ describe('工作台页面交互', () => {
button('整理生成方案').click()
await flushPromises()
expect(wrapper.find('pre').exists()).toBe(false)
await wrapper.getComponent(RawDataDetails).get('.n-collapse-item__header-main').trigger('click')
expect(wrapper.get('pre').text()).toContain('form-db')
expect(wrapper.get('pre').text()).toContain('地面积水')
await expandSection('本镜头生成内容', wrapper.element)
expect(wrapper.text()).toContain('日常')
expect(wrapper.text()).toContain('地面积水')
expect(wrapper.find('pre').exists()).toBe(false)
expect(wrapper.text()).not.toContain('form-db')
expect(fetcher.mock.calls[2]?.[0]).toBe('/api/storyboard-shots/shot-db-1-1/generation-spec')
expect(fetcher.mock.calls.every(([, init]) => init?.method !== 'POST')).toBe(true)
})