feat: 明确形态图片异步提交状态
This commit is contained in:
1 parent
ee659a97f3
commit
087bd4aa6f
1 file changed
+5
-2
@@ -129,12 +129,15 @@ export function useSubjectImages() {
|
||||
const form = forms.value.find(item => item.id === formId)
|
||||
if (!form) return
|
||||
const projectId = id.value
|
||||
await runOperation(projectId, `生成 ${form.subject.name} · ${form.name} 图片`, async () => {
|
||||
const ok = await runOperation(projectId, `提交 ${form.subject.name} · ${form.name} 图片生成`, async () => {
|
||||
const image = await subjectImagesApi.generate(formId, input)
|
||||
if (!image || image.subjectFormId !== formId || !['pending', 'generating'].includes(image.status))
|
||||
throw new Error(image?.error || '接口未返回有效的形态图片生成任务,请刷新图片记录核对。')
|
||||
})
|
||||
await query.refresh()
|
||||
if (ok) {
|
||||
await query.refresh()
|
||||
operation.value.notice = `${form.subject.name} · ${form.name} 已提交生成,可稍后刷新图库查看结果。`
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量始终面向整个项目,不受页面筛选影响;force 仅新增候选图,不替换已有主图。 */
|
||||
|
||||
Reference in new issue
Block a user