fix: 同步制作接口并修复浅色主题层次
This commit is contained in:
1 parent
2eea0ea72e
commit
7ea3f2a0b4
19 files changed
+641
-93
No files matched your search
@@ -2,66 +2,59 @@ import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { projectsApi } from '../projects/api'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { subjectImagesApi } from '../subject-images/api'
|
||||
import { hasRunningImages, primaryImage } from '../subject-images/model'
|
||||
import { hasRunningImages } from '../subject-images/model'
|
||||
import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { hasRunningWorkflow } from '../workflows/selectors'
|
||||
import { errorMessage } from '../../lib/http'
|
||||
import { productionApi } from './api'
|
||||
import { getProductionSession } from './model'
|
||||
|
||||
/** 高级串联入口只能消费已验图的主资产,不替用户跳过选角、设计和首帧环节。 */
|
||||
/** 使用后端计划区分可自动补齐和人工阻塞,保留项目归属及活动任务检查。 */
|
||||
export async function checkPipeline(projectId: string) {
|
||||
const [project, checkpoints, forms, keyframes, prompts, videos] = await Promise.all([
|
||||
const [project, checkpoints, forms, plan, status] = await Promise.all([
|
||||
projectsApi.detail(projectId),
|
||||
projectsApi.checkpoints(projectId),
|
||||
subjectImagesApi.listForms(projectId),
|
||||
productionApi.keyframeReadiness(projectId, true),
|
||||
productionApi.promptReadiness(projectId, true),
|
||||
productionApi.videoReadiness(projectId, false)
|
||||
productionApi.plan(projectId),
|
||||
productionApi.status(projectId)
|
||||
])
|
||||
if (project.id !== projectId || forms.some(form => form.subject.projectId !== projectId))
|
||||
if (
|
||||
project.id !== projectId ||
|
||||
plan.projectId !== projectId ||
|
||||
status.projectId !== projectId ||
|
||||
forms.some(form => form.subject.projectId !== projectId)
|
||||
)
|
||||
throw new Error('预检返回了其他项目的数据,请重新读取。')
|
||||
const issues: string[] = []
|
||||
const shotIds = new Set(keyframes.items.map(item => item.shotId))
|
||||
const shotIds = new Set(plan.details.keyframes.map(item => item.shotId))
|
||||
if (
|
||||
shotIds.size !== keyframes.total ||
|
||||
[prompts, videos].some(
|
||||
data =>
|
||||
new Set(data.items.map(item => item.shotId)).size !== shotIds.size ||
|
||||
data.items.some(item => !shotIds.has(item.shotId))
|
||||
shotIds.size !== plan.keyframes.total ||
|
||||
plan.details.keyframes.length !== plan.keyframes.total ||
|
||||
plan.subjectImages.total !== forms.length ||
|
||||
plan.details.subjectImages.length !== forms.length ||
|
||||
plan.details.subjectImages.some(item => !forms.some(form => form.id === item.subjectFormId)) ||
|
||||
[plan.details.videoPrompts, plan.details.videos, status.keyframes.items, status.videos.items].some(
|
||||
items =>
|
||||
items.length !== shotIds.size ||
|
||||
new Set(items.map(item => item.shotId)).size !== shotIds.size ||
|
||||
items.some(item => !shotIds.has(item.shotId))
|
||||
)
|
||||
)
|
||||
issues.push('各阶段镜头列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
issues.push('各阶段资产列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
if (project.status !== 'completed') issues.push('剧本尚未完成,请先完成剧本创作。')
|
||||
if (hasRunningWorkflow(checkpoints)) issues.push('项目仍有后台任务或工作流进行中。')
|
||||
if (!forms.length) issues.push('尚无正式形态,请先完成拆解。')
|
||||
if (!forms.length || !plan.keyframes.total) issues.push('尚无正式形态或镜头,请先完成拆解和分镜。')
|
||||
if (forms.some(form => hasRunningImages(form.images))) issues.push('形态图片仍在生成中。')
|
||||
if (forms.some(form => !primaryImage(form.images)?.imageUrl))
|
||||
issues.push('请先补齐并确认所有形态主图,更新过期母版引用,再生成首帧。')
|
||||
if (
|
||||
!keyframes.total ||
|
||||
keyframes.items.length !== keyframes.total ||
|
||||
keyframes.items.some(
|
||||
item =>
|
||||
!item.primaryKeyframeId || item.primaryKeyframeStale || item.issues.length || item.status === 'blocked'
|
||||
)
|
||||
status.videos.inProgress ||
|
||||
status.videos.items.some(item => item.status === 'in_progress' || item.activeVideoId)
|
||||
)
|
||||
issues.push('请先为全部镜头完成设计、身份检查和有效主首帧;串联流程不会生成首帧。')
|
||||
if (
|
||||
prompts.total !== keyframes.total ||
|
||||
prompts.items.length !== prompts.total ||
|
||||
prompts.items.some(item => item.issues.length || item.status === 'blocked')
|
||||
)
|
||||
issues.push('视频提示词的生成规格或参考图不完整,请到分镜页修复。')
|
||||
if (
|
||||
videos.total !== keyframes.total ||
|
||||
videos.items.length !== videos.total ||
|
||||
videos.items.some(item => item.issues.some(issue => issue.code !== 'missing_prompt'))
|
||||
)
|
||||
issues.push('视频前置检查未通过,请检查参考图和主首帧。')
|
||||
if (videos.inProgress || videos.items.some(item => item.status === 'in_progress' || item.activeVideoId))
|
||||
issues.push('存在活动视频任务,请等待结束后再操作。')
|
||||
return { projectId, issues, shotCount: keyframes.total, checkedAt: new Date().toISOString() }
|
||||
if (status.completed || plan.completed) issues.push('当前项目制作已完成,无需再次启动。')
|
||||
else if (![plan.subjectImages, plan.keyframes, plan.videoPrompts, plan.videos].some(stage => stage.planned > 0))
|
||||
issues.push('当前没有可执行的制作任务,请先处理计划中的阻塞项。')
|
||||
// 人工阻塞在计划中独立展示;不拦截其余 ready 形态的部分成功生产。
|
||||
return { projectId, issues, plan, status, shotCount: plan.keyframes.total, checkedAt: new Date().toISOString() }
|
||||
}
|
||||
|
||||
/** 预检不付费;确认后再次预检并锁住本浏览器项目,长请求不自动重发。 */
|
||||
|
||||
Reference in new issue
Block a user