feat: 同步动作与首帧编辑能力并统一工作区反馈
接入动作时间轴、密度审计、人工视线目标和后台首帧编辑;独立读取已保存提示词,并在首帧晋升前重新核对持久化质量状态。 统一 NMessage 结果反馈、局部 loading 和业务说明间距,保留真实长任务进度与部分失败语义。 验证:pnpm check(49 个文件、393 项测试)、pnpm build;当前环境无法完成 localhost 浏览器验收及真实后端联调。
This commit is contained in:
1 parent
83482a70c5
commit
7a60db3ced
76 files changed
+2485
-457
No files matched your search
@@ -1,4 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { isOperationRunning } from '../workflows/operations'
|
||||
|
||||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||||
|
||||
import AppForm from '../../components/ui/AppForm.vue'
|
||||
import { NFormItem } from 'naive-ui'
|
||||
import { integerRule } from '../../lib/form-rules'
|
||||
@@ -7,7 +11,6 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
import WorkspaceTools from '../../components/ui/WorkspaceTools.vue'
|
||||
import {
|
||||
NScrollbar,
|
||||
NAlert,
|
||||
NButton,
|
||||
NCheckbox,
|
||||
NCollapse,
|
||||
@@ -411,12 +414,11 @@ function runNextAction() {
|
||||
<SubjectIdentitySkeleton v-if="initialLoading" />
|
||||
<WorkspacePage v-else split compact mobile-scroll class="identity-workspace-page">
|
||||
<template #notice>
|
||||
<NAlert v-if="subjectImagesAccess.enabled" type="success" :show-icon="false">
|
||||
所有需要确认的角色身份已经准备好,可以继续制作主体形态图片。
|
||||
<RouterLink :to="`/projects/${projectId}/subject-images`" class="text-button ml-2"
|
||||
<div v-if="subjectImagesAccess.enabled" class="flex justify-end text-xs">
|
||||
<RouterLink :to="`/projects/${projectId}/subject-images`" class="text-button"
|
||||
>继续形态图片 →</RouterLink
|
||||
>
|
||||
</NAlert>
|
||||
</div>
|
||||
</template>
|
||||
<template #header>
|
||||
<!-- 以下是类型筛选、主体数量与操作入口 -->
|
||||
@@ -436,6 +438,8 @@ function runNextAction() {
|
||||
<span class="toolbar-summary">共 {{ subjects.length }} 个主体</span>
|
||||
<div class="toolbar-actions">
|
||||
<WorkspaceTools
|
||||
:pending="operation.pending"
|
||||
:pending-label="operation.label"
|
||||
v-model:open="toolsOpen"
|
||||
title="角色选角总览与批量操作"
|
||||
:has-receipt="!!session.receipt"
|
||||
@@ -452,16 +456,16 @@ function runNextAction() {
|
||||
<div class="workspace-overview-panel">
|
||||
<div class="overview-content workspace-section-stack dialog-flat-stack">
|
||||
<h3 class="text-sm font-semibold">角色选角总览与批量操作</h3>
|
||||
<NAlert type="info" :show-icon="false" class="text-xs">
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
人物需要依次完成身份描述、选角候选、确认角色母版并锁定,之后才能用于镜头制作。未明确人物背景时,AI
|
||||
默认以中国人物作为选角基线;项目和角色的明确事实始终优先。场景和道具使用稳定身份母版流程。
|
||||
</NAlert>
|
||||
<NAlert v-if="styleQuery.data.value && !hasStyle" type="info" :show-icon="false">
|
||||
</ContextNotice>
|
||||
<ContextNotice v-if="styleQuery.data.value && !hasStyle" type="info" :show-icon="false">
|
||||
先创建项目视觉风格,才能 AI 生成身份或身份图片。<RouterLink
|
||||
:to="`/projects/${projectId}/visual-style`"
|
||||
class="text-button ml-2"
|
||||
>设置视觉风格 →</RouterLink
|
||||
></NAlert
|
||||
></ContextNotice
|
||||
>
|
||||
<section v-if="casting" class="workspace-panel" aria-label="角色选角流程">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
@@ -535,6 +539,7 @@ function runNextAction() {
|
||||
>覆盖未锁定身份文本
|
||||
</NCheckbox>
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '批量生成角色身份文本')"
|
||||
:label="force ? '重生成角色身份文本' : '补齐角色身份文本'"
|
||||
:disabled="
|
||||
blocked ||
|
||||
@@ -549,6 +554,7 @@ function runNextAction() {
|
||||
@confirm="generateProject(true)"
|
||||
/>
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '批量生成角色选角候选')"
|
||||
label="AI 批量生成角色候选图"
|
||||
:disabled="
|
||||
castingBlocked ||
|
||||
@@ -591,6 +597,7 @@ function runNextAction() {
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '批量生成场景身份母版')"
|
||||
label="生成场景母版"
|
||||
:disabled="
|
||||
blocked ||
|
||||
@@ -605,6 +612,7 @@ function runNextAction() {
|
||||
@confirm="generateStableAnchors('scene')"
|
||||
/>
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, '批量生成道具身份母版')"
|
||||
label="生成道具母版"
|
||||
:disabled="
|
||||
blocked || !hasStyle || !batchValid || dirty || !subjects.length
|
||||
@@ -680,7 +688,7 @@ function runNextAction() {
|
||||
{{ session.receipt.result.generated }} · 失败
|
||||
{{ session.receipt.result.failed }}
|
||||
</p>
|
||||
<NAlert
|
||||
<ContextNotice
|
||||
v-if="session.receipt.result.failed"
|
||||
role="alert"
|
||||
type="error"
|
||||
@@ -688,7 +696,7 @@ function runNextAction() {
|
||||
class="mt-3"
|
||||
>
|
||||
本次存在部分失败,成功结果不会回滚。请检查逐角色原因后再重试。
|
||||
</NAlert>
|
||||
</ContextNotice>
|
||||
<ul class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="failure in session.receipt.result.failures" :key="failure.subjectId">
|
||||
{{ failure.subjectRef }} · {{ failure.subjectId }}:{{ failure.error }}
|
||||
@@ -707,7 +715,7 @@ function runNextAction() {
|
||||
<NScrollbar
|
||||
class="workspace-feedback"
|
||||
v-if="catalog.error.value || styleQuery.error.value || castingQuery.error.value"
|
||||
><NAlert role="alert" type="error" :show-icon="false"
|
||||
><ContextNotice role="alert" type="error" :show-icon="false"
|
||||
>{{ catalog.error.value || styleQuery.error.value || castingQuery.error.value }}
|
||||
当前相关操作已暂停,请刷新核对后端。
|
||||
<NButton
|
||||
@@ -718,9 +726,9 @@ function runNextAction() {
|
||||
@click="catalog.refresh"
|
||||
>重试读取目录</NButton
|
||||
>
|
||||
</NAlert></NScrollbar
|
||||
</ContextNotice></NScrollbar
|
||||
>
|
||||
<NAlert
|
||||
<ContextNotice
|
||||
v-if="profileQuery.data.value && !hasCreativeProfile"
|
||||
type="warning"
|
||||
:show-icon="false"
|
||||
@@ -730,7 +738,7 @@ function runNextAction() {
|
||||
<span><strong>需要先配置项目生成模型</strong>,否则身份图和选角候选无法生成。</span>
|
||||
<NButton type="primary" @click="openProfileSettings">立即配置</NButton>
|
||||
</div>
|
||||
</NAlert>
|
||||
</ContextNotice>
|
||||
<div v-if="subjects.length" class="identity-workspace-region">
|
||||
<!-- 以下是与分镜一致的融合工作区模块,目录与详情共用外层背景。 -->
|
||||
<div class="panel workspace-surface directory-workspace identity-workspace">
|
||||
@@ -795,12 +803,12 @@ function runNextAction() {
|
||||
class="panel-scroll"
|
||||
content-class="directory-workspace-content identity-detail-content"
|
||||
>
|
||||
<NAlert v-if="pendingSelection" type="info" :show-icon="false" class="mb-4"
|
||||
<ContextNotice v-if="pendingSelection" type="info" :show-icon="false" class="mb-4"
|
||||
><p class="text-xs">当前主体有未保存修改,切换会丢弃草稿。</p>
|
||||
<div class="mt-3 flex gap-3">
|
||||
<NButton @click="discardAndSelect">放弃草稿并切换</NButton
|
||||
><NButton @click="pendingSelection = ''" text size="small">继续编辑</NButton>
|
||||
</div></NAlert
|
||||
</div></ContextNotice
|
||||
>
|
||||
<section v-if="subject" ref="identityContentRoot" class="identity-subject-content">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
@@ -813,9 +821,14 @@ function runNextAction() {
|
||||
刷新身份
|
||||
</NButton>
|
||||
</div>
|
||||
<NAlert v-if="detail.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||||
<ContextNotice
|
||||
v-if="detail.error.value"
|
||||
role="alert"
|
||||
type="error"
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>{{ detail.error.value }} 查询失败时不允许生成或覆盖。
|
||||
</NAlert>
|
||||
</ContextNotice>
|
||||
<!-- 以下是切换主体时的局部骨架模块,保留真实主体名称与目录 -->
|
||||
<IdentityDetailSkeleton v-if="detailInitialLoading" class="mt-5" />
|
||||
<template v-if="detail.data.value">
|
||||
@@ -860,6 +873,7 @@ function runNextAction() {
|
||||
请先保存身份修改,再使用 AI 或生成图片。
|
||||
</p>
|
||||
<IdentityEditor
|
||||
:saving="isOperationRunning(operation, '保存主体身份')"
|
||||
:key="`${selectedId}:${editorRevision}`"
|
||||
:identity="identity"
|
||||
:module="subject.module"
|
||||
@@ -870,6 +884,7 @@ function runNextAction() {
|
||||
<!-- 以下是唯一的单主体 AI 文本生成入口,覆盖已有文本时沿用确认弹窗 -->
|
||||
<template #generate>
|
||||
<ConfirmAction
|
||||
:loading="isOperationRunning(operation, 'AI 生成主体身份')"
|
||||
v-if="identity?.description?.trim() || identity?.generationPrompt?.trim()"
|
||||
label="AI 生成主体身份"
|
||||
description="AI 将重新生成当前主体的身份描述和核心提示词,并覆盖已保存的文本;已有图片不会自动更新。"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { NAlert, NButton, NCheckbox, NFormItem, NInput } from 'naive-ui'
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { NButton, NCheckbox, NFormItem, NInput } from 'naive-ui'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import AppForm from '../../../components/ui/AppForm.vue'
|
||||
@@ -75,10 +77,10 @@ const formModel = computed(() => ({ prompt: prompt.value }))
|
||||
class="dialog-form-stack"
|
||||
@submit="submit"
|
||||
>
|
||||
<NAlert type="info" :show-icon="false" class="text-xs">
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
AI
|
||||
会根据角色身份、项目视觉风格和选角要求生成一张新的候选图,不会复用当前身份母版。生成完成后,请在图库点击“确认选角并锁定”,将图片设为角色母版。
|
||||
</NAlert>
|
||||
</ContextNotice>
|
||||
<NFormItem
|
||||
class="block"
|
||||
path="prompt"
|
||||
|
||||
@@ -6,7 +6,12 @@ import { computed, reactive, ref, watch } from 'vue'
|
||||
import type { SaveIdentityInput, SubjectIdentity } from '../types'
|
||||
|
||||
/** 身份文本草稿不随轮询覆盖;父页面切换主体或保存成功后重建编辑器。 */
|
||||
const props = defineProps<{ identity: SubjectIdentity | null; disabled: boolean; module: string }>()
|
||||
const props = defineProps<{
|
||||
identity: SubjectIdentity | null
|
||||
disabled: boolean
|
||||
/** 当前表单保存请求是否仍在执行。 */ saving?: boolean
|
||||
module: string
|
||||
}>()
|
||||
/** 保存当前主体草稿,并同步尚未保存的修改状态。 */
|
||||
const emit = defineEmits<{ save: [input: SaveIdentityInput]; dirty: [value: boolean] }>()
|
||||
/** 身份描述、核心提示词和锁定状态共同组成编辑草稿。 */
|
||||
@@ -77,7 +82,7 @@ function save() {
|
||||
>
|
||||
<!-- 以下是表单底部的 AI 生成与人工保存模块,状态通过按钮表达 -->
|
||||
<div class="page-form-actions">
|
||||
<NButton :disabled="disabled || !dirty" attr-type="submit">{{
|
||||
<NButton :disabled="disabled || !dirty" attr-type="submit" :loading="saving">{{
|
||||
dirty || !hasSavedText ? '保存主体身份' : '已保存'
|
||||
}}</NButton>
|
||||
<div v-if="$slots.generate" class="identity-generation-action"><slot name="generate" /></div>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
|
||||
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { referenceGenerationCatalog, referenceGenerationOptions } from '../reference-generation'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import { getOperation, runOperation } from '../../workflows/operations'
|
||||
import AppForm from '../../../components/ui/AppForm.vue'
|
||||
import { NFormItem } from 'naive-ui'
|
||||
import { fieldRule } from '../../../lib/form-rules'
|
||||
import { NAlert, NButton, NCheckbox, NInput, NSelect } from 'naive-ui'
|
||||
import { NButton, NCheckbox, NInput, NSelect } from 'naive-ui'
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue'
|
||||
import { AppDialog, FieldLabel } from '../../../components/ui'
|
||||
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
|
||||
@@ -203,10 +207,10 @@ const rules = {
|
||||
class="dialog-form-stack"
|
||||
@submit="submit"
|
||||
>
|
||||
<NAlert type="info" :show-icon="false" class="text-xs">
|
||||
<ContextNotice type="info" :show-icon="false" class="text-xs">
|
||||
调用 图片模型,每次新增一张图片,可能产生费用。第一张成功的 primary 图自动成为母版;已有母版时,新
|
||||
primary 图仅作为停用候选保留。
|
||||
</NAlert>
|
||||
</ContextNotice>
|
||||
<!-- 以下是多视角与已有身份图选择模块,单一选项不显示选择器 -->
|
||||
<NFormItem
|
||||
v-if="allowedViews.length > 1"
|
||||
@@ -289,7 +293,7 @@ const rules = {
|
||||
<NButton v-else :disabled="disabled || !valid" :loading="previewLoading" @click="loadPreview"
|
||||
>预览本次真实输入</NButton
|
||||
>
|
||||
<NAlert v-if="previewError" type="error">{{ previewError }}</NAlert>
|
||||
<FeedbackMessage v-if="previewError" :message="previewError" />
|
||||
<div v-if="preview" class="text-xs space-y-3">
|
||||
<p>实际供应方:{{ preview.provider }} · 模型:{{ preview.model }}</p>
|
||||
<p class="whitespace-pre-wrap">最终提示词:{{ preview.providerPrompt }}</p>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { referenceGenerationCatalog, referenceGenerationOptions } from '../reference-generation'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { NAlert, NButton, NCheckbox, NInputNumber } from 'naive-ui'
|
||||
import { NButton, NCheckbox, NInputNumber } from 'naive-ui'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
|
||||
import type { CreativeProfile, GenerationModelCatalog, GenerationOptions } from '../../generation-config/types'
|
||||
@@ -84,10 +86,10 @@ function submit() {
|
||||
<!-- 以下是单主体母版质量生成费用确认模块 -->
|
||||
<AppDialog v-model:open="open" title="生成稳定母版并校验质量" :description="subjectName">
|
||||
<div class="dialog-form-stack">
|
||||
<NAlert type="warning" :show-icon="false"
|
||||
<ContextNotice type="warning" :show-icon="false"
|
||||
>最多生成
|
||||
{{ maxRepairAttempts + 1 }}
|
||||
张候选,并逐张调用视觉校验;道具还可能调用结构编译模型,均可能产生费用。只有真实通过后,后端才会切换母版并锁定身份。</NAlert
|
||||
张候选,并逐张调用视觉校验;道具还可能调用结构编译模型,均可能产生费用。只有真实通过后,后端才会切换母版并锁定身份。</ContextNotice
|
||||
>
|
||||
<GenerationModelControls
|
||||
type="image"
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useProjectGenerationRevision } from '../generation-config/context'
|
||||
import { generationConfigApi } from '../generation-config/api'
|
||||
import { subjectImagesApi } from '../subject-images/api'
|
||||
import { hasRunningImages } from '../subject-images/model'
|
||||
import { runOperation, type OperationNotice } from '../workflows/operations'
|
||||
import { batchResultNotice, runOperation, type OperationNotice } from '../workflows/operations'
|
||||
import { useProjectMutationGuard } from '../workflows/useProjectMutationGuard'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { subjectIdentityApi } from './api'
|
||||
@@ -378,15 +378,21 @@ export function useSubjectIdentity() {
|
||||
: module
|
||||
? `批量生成${module === 'scene' ? '场景' : '道具'}身份文本`
|
||||
: '批量生成全部主体身份文本'
|
||||
await runOperation(id, title, async () => {
|
||||
target.receipt = {
|
||||
kind: 'identities',
|
||||
title,
|
||||
result: charactersOnly
|
||||
? await subjectIdentityApi.generateCharacters(id, input)
|
||||
: await subjectIdentityApi.generateProject(id, input)
|
||||
}
|
||||
})
|
||||
await runOperation(
|
||||
id,
|
||||
title,
|
||||
async () => {
|
||||
target.receipt = {
|
||||
kind: 'identities',
|
||||
title,
|
||||
result: charactersOnly
|
||||
? await subjectIdentityApi.generateCharacters(id, input)
|
||||
: await subjectIdentityApi.generateProject(id, input)
|
||||
}
|
||||
return target.receipt.result
|
||||
},
|
||||
result => batchResultNotice(result, title)
|
||||
)
|
||||
await Promise.all([detail.refresh(), castingQuery.refresh()])
|
||||
}
|
||||
|
||||
@@ -406,17 +412,23 @@ export function useSubjectIdentity() {
|
||||
const target = getIdentitySession(id)
|
||||
const title = `批量生成${module === 'scene' ? '场景' : '道具'}身份母版`
|
||||
target.receipt = null
|
||||
await runOperation(id, title, async () => {
|
||||
target.receipt = {
|
||||
kind: 'stable-anchors',
|
||||
title,
|
||||
result: await subjectIdentityApi.generateStableAnchors(id, {
|
||||
module,
|
||||
limit: candidateLimit.value,
|
||||
concurrency: concurrency.value
|
||||
})
|
||||
}
|
||||
})
|
||||
await runOperation(
|
||||
id,
|
||||
title,
|
||||
async () => {
|
||||
target.receipt = {
|
||||
kind: 'stable-anchors',
|
||||
title,
|
||||
result: await subjectIdentityApi.generateStableAnchors(id, {
|
||||
module,
|
||||
limit: candidateLimit.value,
|
||||
concurrency: concurrency.value
|
||||
})
|
||||
}
|
||||
return target.receipt.result
|
||||
},
|
||||
result => batchResultNotice(result, title)
|
||||
)
|
||||
await Promise.all([catalog.refresh(), detail.refresh()])
|
||||
}
|
||||
|
||||
@@ -435,16 +447,22 @@ export function useSubjectIdentity() {
|
||||
const target = getIdentitySession(id)
|
||||
const title = '批量生成角色选角候选'
|
||||
target.receipt = null
|
||||
await runOperation(id, title, async () => {
|
||||
target.receipt = {
|
||||
kind: 'casting',
|
||||
title,
|
||||
result: await subjectIdentityApi.generateCastingCandidates(id, {
|
||||
limit: candidateLimit.value,
|
||||
concurrency: concurrency.value
|
||||
})
|
||||
}
|
||||
})
|
||||
await runOperation(
|
||||
id,
|
||||
title,
|
||||
async () => {
|
||||
target.receipt = {
|
||||
kind: 'casting',
|
||||
title,
|
||||
result: await subjectIdentityApi.generateCastingCandidates(id, {
|
||||
limit: candidateLimit.value,
|
||||
concurrency: concurrency.value
|
||||
})
|
||||
}
|
||||
return target.receipt.result
|
||||
},
|
||||
result => batchResultNotice(result, title)
|
||||
)
|
||||
await Promise.all([detail.refresh(), castingQuery.refresh()])
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user