feat: 支持确认场景道具身份母版
This commit is contained in:
1 parent
02549188d2
commit
30d2c83860
1 file changed
+31
@@ -326,6 +326,36 @@ export function useSubjectIdentity() {
|
|||||||
await detail.refresh()
|
await detail.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Scene / Prop 人工确认母版时原子完成 Anchor 切换与 Identity 锁定。 */
|
||||||
|
async function confirmStableAnchor(imageId: string) {
|
||||||
|
const image = images.value.find(item => item.id === imageId)
|
||||||
|
if (
|
||||||
|
detailBlocked.value ||
|
||||||
|
(subject.value?.module !== 'scene' && subject.value?.module !== 'prop') ||
|
||||||
|
!identity.value ||
|
||||||
|
!image ||
|
||||||
|
!canBeAnchor(image)
|
||||||
|
)
|
||||||
|
return
|
||||||
|
const subjectId = subject.value.id
|
||||||
|
const identityId = identity.value.id
|
||||||
|
await runOperation(projectId.value, `确认 ${subject.value.name} 身份母版`, async () => {
|
||||||
|
const result = await subjectIdentityApi.confirmStableAnchor(subjectId, imageId)
|
||||||
|
if (
|
||||||
|
!result ||
|
||||||
|
result.identityId !== identityId ||
|
||||||
|
result.subjectId !== subjectId ||
|
||||||
|
!result.isLocked ||
|
||||||
|
result.anchor.id !== imageId ||
|
||||||
|
!result.anchor.isAnchor ||
|
||||||
|
result.anchor.identityId !== identityId ||
|
||||||
|
!canBeAnchor(result.anchor)
|
||||||
|
)
|
||||||
|
throw new Error('接口未确认身份母版与身份锁定,请刷新核对。')
|
||||||
|
})
|
||||||
|
await Promise.all([detail.refresh(), catalog.refresh()])
|
||||||
|
}
|
||||||
|
|
||||||
/** Character 确认选角必须原子切换 Anchor 并锁定 Identity。 */
|
/** Character 确认选角必须原子切换 Anchor 并锁定 Identity。 */
|
||||||
async function confirmCasting(imageId: string) {
|
async function confirmCasting(imageId: string) {
|
||||||
const image = images.value.find(item => item.id === imageId)
|
const image = images.value.find(item => item.id === imageId)
|
||||||
@@ -398,6 +428,7 @@ export function useSubjectIdentity() {
|
|||||||
generateImage,
|
generateImage,
|
||||||
generateCastingCandidate,
|
generateCastingCandidate,
|
||||||
setAnchor,
|
setAnchor,
|
||||||
|
confirmStableAnchor,
|
||||||
confirmCasting
|
confirmCasting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user