feat(short-drama-agent-front): 接入分阶段镜头生产与摄影修订

This commit is contained in:
GJ committed 2026-11-15 20:55:51 +08:00
1 parent 1e9ef33d1d
commit 87427d9d43
29 files changed
+2787 -136

No files matched your search

+38 -17
View File
@@ -117,6 +117,19 @@ function stubFetch(fetcher: Mock<typeof fetch>) {
const current = preparationFixture(fixture.id)
return jsonResponse({ ...current.approval, valid: true, confirmation: current.record })
}
if (path.endsWith('/production/entry-readiness'))
return jsonResponse({
...preparationFixture(fixture.id).entry,
derivedAssets: {
shotCount: 4,
directionCount: 2,
directionCoverage: 0.5,
visualStateCount: 0,
visualStateCoverage: 0,
staleDirectionCount: 0,
staleVisualStateCount: 0
}
})
if (path.endsWith('/generation-models')) return jsonResponse(imageCatalog)
if (path.endsWith('/creative-profile')) return jsonResponse(generationProfile(fixture.id))
/** 主体与首帧表单使用原配置解析接口,不创建图片候选。 */
@@ -284,6 +297,8 @@ async function mountStoryboard() {
})
await flushPromises()
await expandSections()
selectControl(wrapper!, 'aria-label', '派生生成范围').vm.$emit('update:value', 'project')
await flushPromises()
return provided
}
@@ -1830,8 +1845,8 @@ describe('工作台页面交互', () => {
stubFetch(fetcher)
await mountStoryboard()
await flushPromises()
await confirmGeneration('补齐项目导演设计')
expect(button('补齐项目导演设计').disabled).toBe(true)
await confirmGeneration('补齐全项目摄影设计')
expect(button('补齐全项目摄影设计').disabled).toBe(true)
await drawerPanel().get('.app-drawer-footer button').trigger('click')
await flushPromises()
expect(wrapper!.get('[data-workspace-tools]').attributes('aria-expanded')).toBe('false')
@@ -1854,15 +1869,15 @@ describe('工作台页面交互', () => {
await flushPromises()
expect(getStoryboardSession(fixture.id).receipt).toMatchObject({
kind: 'batch',
title: '项目导演设计'
title: '摄影设计任务'
})
expect(getOperation(fixture.id).pending).toBe(false)
const posts = fetcher.mock.calls.filter(([, init]) => init?.method === 'POST')
expect(posts).toHaveLength(1)
expect(JSON.parse(posts[0]![1]!.body as string)).toEqual({ concurrency: 2, force: false })
expect(JSON.parse(posts[0]![1]!.body as string)).toEqual({ concurrency: 1, force: false })
})
it('分镜只提供正式项目生成,逐集失败回执保留零次修复参数', async () => {
it('分镜保留显式批量范围,逐集失败回执保留零次修复参数', async () => {
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (url, init) => {
if (init?.method === 'POST')
return new Response(
@@ -1899,15 +1914,18 @@ describe('工作台页面交互', () => {
await flushPromises()
expect(wrapper!.text()).not.toContain('生成本集导演设计')
expect(wrapper!.text()).not.toContain('生成本集即时状态')
expect(button('补齐项目导演设计').disabled).toBe(false)
expect(button('补齐项目即时状态').disabled).toBe(false)
expect(button('补齐全项目摄影设计').disabled).toBe(false)
selectControl(wrapper!, 'aria-label', '派生生成范围').vm.$emit('update:value', 'episode')
await flushPromises()
expect(button('补齐第 1 集画面状态').disabled).toBe(false)
expect(fetcher.mock.calls.every(([, init]) => init?.method !== 'POST')).toBe(true)
await drawerPanel().get('#storyboard-repairs').setValue('0')
await confirmGeneration('补齐项目即时状态')
await confirmGeneration('补齐第 1 集画面状态')
const post = fetcher.mock.calls.find(([, init]) => init?.method === 'POST')!
expect(JSON.parse(post[1]!.body as string)).toEqual({
concurrency: 2,
concurrency: 1,
force: false,
episodeNo: 1,
maxRepairAttempts: 0
})
expect(drawerPanel().text()).toContain('本次有未完成项')
@@ -1998,15 +2016,18 @@ describe('工作台页面交互', () => {
stubFetch(fetcher)
await mountStoryboard()
await flushPromises()
await confirmGeneration('补齐项目导演设计')
await confirmGeneration('补齐全项目摄影设计')
expect(drawerPanel().get('[aria-label="生成回执"] [role="alert"]').text()).toContain('本次有未完成项')
expect(drawerPanel().text()).toContain('模型校验失败')
await drawerPanel().get('[role="checkbox"]').trigger('click')
await confirmGeneration('重生成全部导演设计')
await drawerPanel()
.findAll('[role="checkbox"]')
.find(item => item.text().includes('覆盖本次范围已有结果'))!
.trigger('click')
await confirmGeneration('重生成全项目摄影设计')
const posts = fetcher.mock.calls.filter(([, init]) => init?.method === 'POST')
expect(posts.map(([, init]) => JSON.parse(init!.body as string))).toEqual([
{ concurrency: 2, force: false },
{ concurrency: 2, force: true }
{ concurrency: 1, force: false },
{ concurrency: 1, force: true }
])
})
@@ -2052,7 +2073,7 @@ describe('工作台页面交互', () => {
/** 切换剧集只增加当前集查询,项目时长预算只在挂载时读取一次。 */
expect(
fetcher.mock.calls.filter(([url]) => !String(url).endsWith('/storyboard-quality-confirmation'))
).toHaveLength(6)
).toHaveLength(7)
expect(
fetcher.mock.calls.filter(([url]) => String(url).endsWith('/storyboard-quality-confirmation'))
).toHaveLength(1)
@@ -2076,11 +2097,11 @@ describe('工作台页面交互', () => {
await mountStoryboard()
await flushPromises()
expect(wrapper!.text()).toContain('数据库暂不可用')
expect(button('补齐项目导演设计').disabled).toBe(true)
expect(button('补齐全项目摄影设计').disabled).toBe(true)
fail = false
button('重试查询').click()
await flushPromises()
expect(button('补齐项目导演设计').disabled).toBe(false)
expect(button('补齐全项目摄影设计').disabled).toBe(false)
/** 重试恢复正式镜头数据,内部编号仍用于业务选择。 */
expect(wrapper!.getComponent(ShotDesign).props('shot').shotId).toBe('shot-db-1-1')
})