feat(short-drama-agent-front): 接入素材预览审核并完善创作流程

This commit is contained in:
GJ committed 2026-11-02 10:16:10 +08:00
1 parent f8b0fbb8ca
commit dc8bb17a23
66 files changed
+2864 -632

No files matched your search

+38 -2
View File
@@ -27,6 +27,7 @@ function readiness(id: string, ready = true): ProjectStageReadiness {
projectId: id,
script: stage(),
breakdown: stage(),
preparation: stage(),
visualStyle: stage(),
identity: stage(),
subjectAssets: stage(),
@@ -133,6 +134,7 @@ describe('剧本完成前的下游访问限制', () => {
const state = readiness(id, false)
state.script = { ready: true, reason: null }
state.breakdown = { ready: true, reason: null }
state.preparation = { ready: true, reason: null }
state.storyboard = { ready: true, reason: null }
vi.mocked(projectsApi.stageReadiness).mockImplementation(async () => structuredClone(state))
vi.spyOn(projectsApi, 'detail').mockResolvedValue(project(id, 'completed'))
@@ -149,11 +151,12 @@ describe('剧本完成前的下游访问限制', () => {
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/visual-style"]`).exists()).toBe(true)
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/subject-identity"]`).exists()).toBe(false)
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/production"]`).exists()).toBe(false)
state.breakdown = { ready: false, reason: '当前分镜审核已失效,请重新核对。' }
state.breakdown = { ready: false, reason: '当前分镜来源已变化,请重新核对。' }
state.preparation = { ready: false, reason: '当前分镜来源已变化,请重新核对。' }
await wrapper!.get('.probe-refresh').trigger('click')
await flushPromises()
expect(wrapper!.find('.workspace-probe').exists()).toBe(false)
expect(wrapper!.get('.project-access-gate').text()).toContain('当前分镜审核已失效')
expect(wrapper!.get('.project-access-gate').text()).toContain('当前分镜来源已变化')
})
it('身份请求不使用全局加载消息,完成和失败使用临时消息且不遗留横幅', async () => {
vi.useFakeTimers()
@@ -403,6 +406,38 @@ describe('剧本完成前的下游访问限制', () => {
expect(mounted).toHaveBeenCalledExactlyOnceWith('storyboard')
})
it('自动检查已就绪但整体审核待完成时可先进入风格准备,镜头制作仍保持限制', async () => {
const id = 'prepare-before-approval'
const state = {
...readiness(id),
preparation: { ready: true, reason: null },
breakdown: { ready: false, reason: '整体审核待完成' }
}
vi.mocked(projectsApi.stageReadiness).mockResolvedValue(state)
vi.spyOn(projectsApi, 'detail').mockResolvedValue(project(id, 'completed'))
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([])
const { mounted } = await openProject(`/projects/${id}/visual-style`)
expect(mounted).toHaveBeenCalledExactlyOnceWith('visual-style')
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/visual-style"]`).exists()).toBe(true)
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/production"]`).exists()).toBe(false)
})
it('部分身份未齐备时可以逐项准备形态资料,但不能提前进入镜头设计或生产', async () => {
const id = 'partial-asset-preparation'
const state = readiness(id)
state.identity = { ready: false, reason: '还有角色尚未确认选角' }
state.subjectAssets = { ready: false, reason: '素材尚未准备完整' }
state.breakdown = { ready: false, reason: '整体审核待完成' }
vi.mocked(projectsApi.stageReadiness).mockResolvedValue(state)
vi.spyOn(projectsApi, 'detail').mockResolvedValue(project(id, 'completed'))
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([])
const { mounted } = await openProject(`/projects/${id}/subject-images`)
expect(mounted).toHaveBeenCalledExactlyOnceWith('subject-images')
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/subject-images"]`).exists()).toBe(true)
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/storyboard"]`).exists()).toBe(false)
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/production"]`).exists()).toBe(false)
})
it('剧本完成仍按服务端前置步骤逐步解锁,不能直接进入生产', async () => {
const state = readiness('staged', false)
state.script = { ready: true, reason: null }
@@ -419,6 +454,7 @@ describe('剧本完成前的下游访问限制', () => {
await flushPromises()
expect(router.currentRoute.value.path).toBe('/projects/staged/breakdown')
state.breakdown = { ready: true, reason: null }
state.preparation = { ready: true, reason: null }
state.subjectAssets = { ready: true, reason: null }
state.storyboard = { ready: false, reason: '请先完成分镜设计' }
await wrapper!.get('.probe-refresh').trigger('click')