From 3414cc82326bfe24d59051b677677f324c6a3bc9 Mon Sep 17 00:00:00 2001 From: GJ Date: Sat, 17 Oct 2026 08:25:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(short-drama-agent-front):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8B=86=E8=A7=A3=E5=80=99=E9=80=89=E4=B8=8E=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E4=BF=AE=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api-contract-sync.md | 15 + src/components/ui/AppDialog.vue | 3 + src/features/breakdown/BreakdownPage.vue | 90 ++- src/features/breakdown/api.ts | 51 +- src/features/breakdown/candidate.ts | 32 + .../components/BreakdownCandidatePanel.vue | 116 ++++ .../breakdown/components/ShotActionEditor.vue | 291 ++++++++ .../components/StoryboardDiagnosis.vue | 643 ++++++++++-------- .../breakdown/components/StoryboardList.vue | 9 +- .../components/StoryboardQualityRepair.vue | 255 +++++++ src/features/breakdown/repair.ts | 100 +++ src/features/breakdown/repair.types.ts | 159 +++++ src/features/breakdown/types.ts | 41 +- .../components/ProjectSettingsDialog.vue | 53 +- .../components/QualityPolicySettings.vue | 234 +++++++ src/features/production/ProductionPage.vue | 17 +- .../production/useAdvancedProduction.ts | 30 +- src/features/projects/api.ts | 21 + src/features/projects/quality-policy.ts | 55 ++ src/features/projects/types.ts | 38 ++ src/features/storyboard/StoryboardPage.vue | 15 +- .../storyboard/components/ShotTools.vue | 3 - .../subject-identity/SubjectIdentityPage.vue | 19 +- .../subject-images/SubjectImagesPage.vue | 33 +- src/features/visual-style/VisualStylePage.vue | 9 - .../features/breakdown/BreakdownPage.test.ts | 151 +++- .../breakdown/candidate-panel.test.ts | 92 +++ tests/features/breakdown/candidate.test.ts | 74 ++ tests/features/breakdown/repair.test.ts | 44 ++ .../production/backend-contract.test.ts | 21 +- .../features/projects/quality-policy.test.ts | 45 ++ tests/features/workflows/pages.test.ts | 14 +- 32 files changed, 2319 insertions(+), 454 deletions(-) create mode 100644 src/features/breakdown/candidate.ts create mode 100644 src/features/breakdown/components/BreakdownCandidatePanel.vue create mode 100644 src/features/breakdown/components/ShotActionEditor.vue create mode 100644 src/features/breakdown/components/StoryboardQualityRepair.vue create mode 100644 src/features/breakdown/repair.ts create mode 100644 src/features/breakdown/repair.types.ts create mode 100644 src/features/generation-config/components/QualityPolicySettings.vue create mode 100644 src/features/projects/quality-policy.ts create mode 100644 tests/features/breakdown/candidate-panel.test.ts create mode 100644 tests/features/breakdown/candidate.test.ts create mode 100644 tests/features/breakdown/repair.test.ts create mode 100644 tests/features/projects/quality-policy.test.ts diff --git a/docs/api-contract-sync.md b/docs/api-contract-sync.md index 3e1de90..8ba0e24 100644 --- a/docs/api-contract-sync.md +++ b/docs/api-contract-sync.md @@ -1,5 +1,20 @@ # 接口数据同步说明 +## 2026-10-17 候选拆解、质量规则与阶段续跑 + +依据同级后端 `dev@dc884f0f` 的正式路由、候选提交服务、质量策略 schema、人工修订服务与 Production Prepare 节点核对。本轮在前端项目根目录 `dev` 适配,保留工作区原有页面改动。 + +- 拆解启动默认显式传 `candidateOnly: true`;已有结果时使用候选模式。分组、模块、项目、剧本正文或生成模式变化都会撤销旧预览,启动与正式替换分开确认。 +- 新增 `commit-candidate` 入口,只发送 `{ confirmed: true }`。资格读取最新原始 Checkpoint,不从历史回退结果拼接;确认后再读取当前版本,变化时停止提交。后端继续在事务内校验最新候选、剧本正文指纹、审核状态和下游资产,不接受客户端上传主体或分镜数据。 +- 项目配置新增“质量规则”分类,对接 `quality-policy` GET/PUT。完整保留物理模式、三项动作许可、自定义规则和针对主体/资源的精确例外;切换表现方式不会自动放宽动作权限。保存与生成模型配置使用各自的接口和按钮。 +- 拆解设置新增 `storyboard-quality-repair-plan`、`storyboard-quality-repair-candidates` 与 `storyboard-quality-repair`。人工编辑完整必需动作、阶段时长、手部证据及身体/道具资源证据;候选来源发送真实镜头指纹和 Checkpoint ID。修改草稿撤销旧确认,版本变化要求重新读取。保存仅产生新快照,之后仍需恢复拆解及候选正式提交,不显示为已入库。 +- 指定 Production 续跑阶段的预检同步后端门禁:所有续跑均要求角色身份确认;首帧及视频提示词续跑要求主体参考图全部有效;视频提示词续跑额外要求全部已有有效首帧。`planned`/可生成不等同于已有有效资产,不影响默认从头运行时补齐上游的行为。 +- 页面沿用现有公共弹窗、模块留白和固定底栏,动作与资源编辑字段提供可见标签;393px 窄屏按单列显示。 + +验证:本地 Chrome 使用 `localhost:4312` 读取真实后端 `localhost:3412`,完成候选分组预览、费用确认取消、真实修复清单空结果、多行质量规则和精确例外必填验证;在 393px 视口检查表单、正文滚动和底栏。已有项目没有待提交候选或质量阻断镜头,候选版本变化拦截、完整证据编辑、无效动作引用阻断和人工修订提交使用临时隔离验收页验证;该页面已删除,不向真实后端写入,不触发模型生成。 + +代码校验:lint、format:check、typecheck、56 个测试文件/429 项测试、生产构建和差异检查均通过。使用本机已安装 pnpm 的 `--pm-on-fail=ignore` 参数执行脚本,避免自动下载项目声明的另一版包管理器;没有修改依赖或锁文件。 + 核对日期:2026-09-10。依据同级后端仓库 `short-drama-agent` 的 `HEAD=f0321c2`、`src/api/routes` 及实际资产 DTO/service 实现。本轮仅修改前端,沿用已完成页面和正式路由。 | 接口范围 | 精简后的公开数据 | 前端处理 | diff --git a/src/components/ui/AppDialog.vue b/src/components/ui/AppDialog.vue index 96caf8c..ce3ea60 100644 --- a/src/components/ui/AppDialog.vue +++ b/src/components/ui/AppDialog.vue @@ -18,6 +18,8 @@ withDefaults( }>(), { description: '', busy: false, wide: false } ) +/** 关闭动画结束后通知调用方,便于在焦点陷阱释放后定位正文。 */ +const emit = defineEmits<{ closed: [] }>() /** 弹窗显隐状态,关闭行为由 Naive 管理。 */ const open = defineModel('open', { default: false }) /** 正文容器隔离子元素外边距,保留完整的自然内容高度。 */ @@ -93,6 +95,7 @@ onBeforeUnmount(() => { :class="{ 'app-dialog-title-only': !description && !$slots.description }" role="dialog" :aria-label="title" + @after-leave="emit('closed')" >