From 83482a70c50d85d6481f41e69f4b53dfaa3f986a Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 12 Oct 2026 19:02:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(short-drama-agent-front):=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A6=96=E5=B8=A7=E8=AD=A6=E5=91=8A=E9=95=9C=E5=A4=B4?= =?UTF-8?q?=E5=B9=B6=E6=94=AF=E6=8C=81=E5=AE=9A=E4=BD=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/storyboard/StoryboardPage.vue | 41 +++++++++------ .../subject-images/SubjectImagesPage.vue | 52 ++++++++++++++++--- .../subject-images/asset-impact.test.ts | 26 ++++++++++ tests/features/workflows/pages.test.ts | 16 ++++-- 4 files changed, 109 insertions(+), 26 deletions(-) diff --git a/src/features/storyboard/StoryboardPage.vue b/src/features/storyboard/StoryboardPage.vue index 0d4c805..c8409a7 100644 --- a/src/features/storyboard/StoryboardPage.vue +++ b/src/features/storyboard/StoryboardPage.vue @@ -53,21 +53,25 @@ const productionReady = computed(() => directionComplete.value && visualStateCom /** 分镜时长审计为只读预警,接口失败不能影响分镜设计。 */ const durationAudit = ref(null) const durationAuditError = ref('') -watch(id, async (projectId, _old, onCleanup) => { - const controller = new AbortController() - onCleanup(() => controller.abort()) - durationAudit.value = null - durationAuditError.value = '' - if (!projectId) return - try { - const result = await storyboardApi.durationAudit(projectId, controller.signal) - if (!controller.signal.aborted) durationAudit.value = result - } catch { - if (!controller.signal.aborted) durationAuditError.value = '分镜时长审计暂时不可用,不影响当前分镜操作。' - } -}, { immediate: true }) -const currentEpisodeDurationIssues = computed(() => - durationAudit.value?.issues.filter(issue => issue.episodeNo === episodeNo.value) ?? [] +watch( + id, + async (projectId, _old, onCleanup) => { + const controller = new AbortController() + onCleanup(() => controller.abort()) + durationAudit.value = null + durationAuditError.value = '' + if (!projectId) return + try { + const result = await storyboardApi.durationAudit(projectId, controller.signal) + if (!controller.signal.aborted) durationAudit.value = result + } catch { + if (!controller.signal.aborted) durationAuditError.value = '分镜时长审计暂时不可用,不影响当前分镜操作。' + } + }, + { immediate: true } +) +const currentEpisodeDurationIssues = computed( + () => durationAudit.value?.issues.filter(issue => issue.episodeNo === episodeNo.value) ?? [] ) const coverage = computed(() => [ @@ -167,9 +171,12 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int 本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。 -
本集有 {{ currentEpisodeDurationIssues.length }} 条分镜时长建议(不阻断生成)
+
+ 本集有 {{ currentEpisodeDurationIssues.length }} 条分镜时长建议(不阻断生成) +
- Beat {{ issue.beatNo }} · Shot {{ issue.shotNo }}:{{ issue.message }} + Beat {{ issue.beatNo }} · Shot {{ issue.shotNo }}:{{ issue.message }}
{{ durationAuditError }} diff --git a/src/features/subject-images/SubjectImagesPage.vue b/src/features/subject-images/SubjectImagesPage.vue index 26cb8ae..239119d 100644 --- a/src/features/subject-images/SubjectImagesPage.vue +++ b/src/features/subject-images/SubjectImagesPage.vue @@ -456,13 +456,53 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule(' title="下游主首帧需要处理" data-keyframe-impact > - {{ impact.stale.value.length }} - 个镜头的主首帧已标记为过期。此警告不表示形态图片本身失效;请选择镜头核对当前素材,确认过期后再重建首帧。 +
+

+ {{ impact.stale.value.length }} + 个镜头的首帧需要核对。此警告不表示形态图片本身失效;请先查看对应镜头与关联素材,确认原因后再处理。 +

+ 重新检查 +

- 其中 - {{ impact.stale.value.filter(item => item.inconsistent).length }} - 个镜头的首帧与视频检查结果不一致,不建议直接重复生图。 + 其中 {{ impact.stale.value.filter(item => item.inconsistent).length }} + 个镜头的首帧与视频检查结果不一致,请先核对状态。

+ + +
    +
  • + 第 {{ shot.episodeNo }} 集 · BEAT {{ shot.beatNo }} / 镜头 {{ shot.shotNo }} + {{ + shot.inconsistent ? '状态待核对' : '首帧过期' + }} + 查看关联素材 + 查看镜头 → +
  • +
+
镜头影响检查失败,暂时无法确认有无过期首帧:{{ impact.query.error.value }} @@ -486,7 +526,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule(' { expect(wrapper!.text()).toContain('待处理首帧关联此素材') expect(fetcher.mock.calls.filter(([url]) => String(url).endsWith('/references'))).toHaveLength(1) }) + it('警告列出具体集数与镜头,可定位关联素材或打开对应生产镜头', async () => { + const { router, fetcher } = await gallery() + const warning = wrapper!.get('[data-keyframe-impact]') + expect(warning.text()).toContain('第 2 集 · BEAT 2 / 镜头 1') + const shotLink = warning.get('a[data-impact-shot-link]') + const location = new URL(shotLink.attributes('href')!, 'http://localhost') + expect(location.pathname).toBe('/projects/capability-test/production') + expect(location.searchParams.get('episodeNo')).toBe('2') + expect(location.searchParams.get('shotId')).toBe('shot-target') + await warning.get('[data-impact-materials]').trigger('click') + await flushPromises() + expect(router.currentRoute.value.query.sourceShotId).toBe('shot-target') + expect(wrapper!.get('.asset-impact-context').text()).toContain('雨夜形态') + expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true) + }) + + it('警告重新检查后移除已恢复的镜头,不继续展示旧结果', async () => { + const { keyframes, videos, fetcher } = await gallery() + keyframes.items[0]!.primaryKeyframeStale = false + videos.items[0]!.issues = [] + await wrapper!.get('[data-refresh-keyframe-impact]').trigger('click') + await flushPromises() + expect(wrapper!.find('[data-keyframe-impact]').exists()).toBe(false) + expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true) + }) + it('镜头导航与筛选共行,无关联说明时不留横条,查看全部素材清除定位和筛选', async () => { const { references, router, fetcher } = await gallery() references.references = [] diff --git a/tests/features/workflows/pages.test.ts b/tests/features/workflows/pages.test.ts index dcfdef5..48d0ffc 100644 --- a/tests/features/workflows/pages.test.ts +++ b/tests/features/workflows/pages.test.ts @@ -59,7 +59,7 @@ function jsonResponse(data: unknown) { } /** - * 为页面模拟请求补齐正式模型目录和配置,后台启动返回 202 句柄,结果只从任务 GET 读取;响应逐次复制避免消费同一正文。 + * 为页面模拟请求补齐模型配置与只读时长审计,后台启动返回 202 句柄,结果只从任务 GET 读取;响应逐次复制避免消费同一正文。 * @param fetcher 业务 API 模拟请求 */ function stubFetch(fetcher: Mock) { @@ -70,6 +70,15 @@ function stubFetch(fetcher: Mock) { const path = String(url) if (path.endsWith('/generation-models')) return jsonResponse(imageCatalog) if (path.endsWith('/creative-profile')) return jsonResponse(generationProfile(fixture.id)) + if (path.endsWith('/storyboard/duration-audit')) + return jsonResponse({ + projectId: fixture.id, + episodeCount: 2, + beatCount: 4, + shotCount: 4, + warningCount: 0, + issues: [] + }) if (path.includes('/workflow-executions/')) return jsonResponse(executions.get(path.split('/').at(-1)!)) const response = await implementation(url, init) const workflowName = path.endsWith('/storyboard-directions/generate') @@ -1724,7 +1733,7 @@ describe('工作台页面交互', () => { expect(wrapper!.text()).toContain('新标题和剧情详情尚未提供') expect(drawerPanel().text()).toContain('本集新镜头已保存') expect(drawerPanel().text()).toContain('2 个镜头') - expect(fetcher.mock.calls.filter(([, init]) => !init?.method || init.method === 'GET')).toHaveLength(8) + expect(fetcher.mock.calls.filter(([, init]) => !init?.method || init.method === 'GET')).toHaveLength(9) expect(fetcher.mock.calls.some(([url]) => String(url) === '/api/workflow-executions/page-execution-1')).toBe( true ) @@ -1819,7 +1828,8 @@ describe('工作台页面交互', () => { expect(wrapper!.getComponent(ShotDesign).props('shot').shotId).toBe('shot-db-2-1') expect(wrapper!.text()).toContain('第2集镜头1') expect(wrapper!.text()).not.toContain('第1集镜头1') - expect(fetcher.mock.calls).toHaveLength(4) + expect(fetcher.mock.calls).toHaveLength(5) + expect(fetcher.mock.calls.every(([, init]) => !init?.method || init.method === 'GET')).toBe(true) }) it('首次分镜读取失败时禁用生成,重试恢复后才允许操作', async () => {