feat(short-drama-agent-front): 新增拆解候选与质量修订
This commit is contained in:
1 parent
49ad08a63e
commit
3414cc8232
32 files changed
+2319
-454
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import type { BreakdownState } from './types'
|
||||
|
||||
/**
|
||||
* 仅用最新原始快照提示提交条件,实际替换权限仍由后端事务判断。
|
||||
* @param state 最新原始拆解快照,禁止传入历史回退拼接结果
|
||||
* @returns 提交前需要处理的问题,空字符串表示可以请求后端提交
|
||||
*/
|
||||
export function candidateCommitIssue(state: BreakdownState | null | undefined): string {
|
||||
if (state?.candidateOnly !== true) return '当前最新结果不是候选模式。'
|
||||
if (state.storyboardPersisted === true || state.candidateCommitted === true) return '这份候选已经提交。'
|
||||
if (state.workflowExecution?.status === 'running') return '候选拆解仍在执行。'
|
||||
if (state.storyboardShotValidation?.valid !== true) return '候选分镜尚未通过校验。'
|
||||
if (state.storyboardPendingQualityEpisodeNos?.length) return '仍有剧集未通过质量审核,请先修订。'
|
||||
if (!state.expectedEpisodeFingerprints || !state.runConfig?.sourceEpisodes?.length)
|
||||
return '候选缺少剧本版本信息,请重新生成候选。'
|
||||
const episodes = state.storyboardEpisodeShots ?? []
|
||||
const source = state.runConfig.sourceEpisodes
|
||||
if (
|
||||
!state.subjectCandidates?.length ||
|
||||
!Array.isArray(state.subjectForms) ||
|
||||
episodes.length !== source.length ||
|
||||
source.some(
|
||||
item =>
|
||||
!state.expectedEpisodeFingerprints?.[item.episodeNo] ||
|
||||
!episodes.some(
|
||||
episode => episode.episodeNo === item.episodeNo && episode.beatShots.some(beat => beat.shots.length)
|
||||
)
|
||||
)
|
||||
)
|
||||
return '候选主体或分镜不完整,请先完成拆解。'
|
||||
return ''
|
||||
}
|
||||
Reference in new issue
Block a user