feat(short-drama-agent-front): 优化身份管理与镜头素材布局
This commit is contained in:
1 parent
dd0bd79a35
commit
3d2c198e52
14 files changed
+1060
-629
No files matched your search
@@ -15,12 +15,13 @@ import {
|
||||
NInput,
|
||||
NInputNumber,
|
||||
NSelect,
|
||||
NTag
|
||||
NTag,
|
||||
type ScrollbarInst
|
||||
} from 'naive-ui'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter, type LocationQueryRaw } from 'vue-router'
|
||||
import { Check, Circle, UserCheck } from '@lucide/vue'
|
||||
import { AssetImage, DirectoryItem, EmptyState, StatusBadge } from '../../components/ui'
|
||||
import { DirectoryItem, EmptyState, StatusBadge } from '../../components/ui'
|
||||
import { downloadText } from '../../lib/format'
|
||||
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
||||
import { castingStatusLabel, currentAnchor } from './model'
|
||||
@@ -35,7 +36,7 @@ import IdentityGallery from './components/IdentityGallery.vue'
|
||||
import IdentityImageDialog from './components/IdentityImageDialog.vue'
|
||||
import CastingCandidateDialog from './components/CastingCandidateDialog.vue'
|
||||
import IdentityThumbnail from './components/IdentityThumbnail.vue'
|
||||
import type { IdentitySubject } from './types'
|
||||
import type { IdentitySubject, IdentityViewType } from './types'
|
||||
|
||||
/** 主体身份工作区按正式主体聚合,不把同一主体的多个 Form 当成不同身份。 */
|
||||
const route = useRoute()
|
||||
@@ -70,7 +71,6 @@ const {
|
||||
canGenerateImage,
|
||||
canGenerateCandidate,
|
||||
activeIdentityGeneration,
|
||||
latestIdentityFailure,
|
||||
batchValid,
|
||||
candidateLimitValid,
|
||||
save,
|
||||
@@ -90,7 +90,7 @@ const {
|
||||
const stageAccess = useProjectStageAccess(projectId, projectContext.stageReadiness)
|
||||
/** 当前项目是否允许进入形态图片,以及尚未开放的具体原因。 */
|
||||
const subjectImagesAccess = computed(() => stageAccess.sections.value['subject-images'])
|
||||
/** 当前主体的生成进度或失败原因统一放在两栏上方,切换主体时跟随正式详情更新。 */
|
||||
/** 只在两栏上方展示当前生成进度,历史失败在候选弹窗的对应图片卡片内说明。 */
|
||||
const generationFeedback = computed(() => {
|
||||
if (!subject.value) return null
|
||||
if (activeIdentityGeneration.value)
|
||||
@@ -98,11 +98,6 @@ const generationFeedback = computed(() => {
|
||||
type: 'info' as const,
|
||||
message: `${subject.value.name} 的身份图片正在生成,刷新页面不会重复提交,请等待当前任务完成。`
|
||||
}
|
||||
if (latestIdentityFailure.value)
|
||||
return {
|
||||
type: 'error' as const,
|
||||
message: `最近一次身份图片生成失败:${latestIdentityFailure.value.error || '未返回具体错误'}。可以调整模型参数后重新生成。`
|
||||
}
|
||||
return null
|
||||
})
|
||||
/** 首次读取目录才替换整页,刷新已有主体时保留选择与阅读位置。 */
|
||||
@@ -115,6 +110,8 @@ const identityBatchModule = ref<'all' | 'character' | 'scene' | 'prop'>('all')
|
||||
/** 单主体稳定母版质量生成弹窗开关。 */
|
||||
const qualityOpen = ref(false)
|
||||
const imageOpen = ref(false)
|
||||
/** 从失败记录重试时保留原视角,普通生成仍使用弹窗默认视角。 */
|
||||
const retryImageView = ref<IdentityViewType>()
|
||||
const castingOpen = ref(false)
|
||||
const pendingSelection = ref('')
|
||||
const anchor = computed(() => currentAnchor(images.value))
|
||||
@@ -142,11 +139,34 @@ const filtered = computed(() =>
|
||||
)
|
||||
/** 主体目录根节点,复用分镜与生产目录的自动定位和平滑滚动。 */
|
||||
const subjectDirectoryRoot = ref<HTMLElement | null>(null)
|
||||
/** 桌面主体正文的独立滚动容器,切换主体时通过组件公开方法回到顶部。 */
|
||||
const identityDetailScrollbar = ref<ScrollbarInst | null>(null)
|
||||
/** 图片管理组件,步骤引导通过公开入口打开候选弹窗。 */
|
||||
const identityGallery = ref<InstanceType<typeof IdentityGallery> | null>(null)
|
||||
/** 手机正文起点,用于在页面共用滚动容器中定位新主体的内容顶部。 */
|
||||
const identityContentRoot = ref<HTMLElement | null>(null)
|
||||
useDirectorySelection(
|
||||
subjectDirectoryRoot,
|
||||
() => selectedId.value,
|
||||
() => filtered.value.map(item => item.id)
|
||||
)
|
||||
/** 只在主体实际改变后重置正文,刷新身份或取消切换时保留当前阅读位置。 */
|
||||
watch(
|
||||
selectedId,
|
||||
(id, previousId) => {
|
||||
if (!id || !previousId || id === previousId) return
|
||||
identityDetailScrollbar.value?.scrollTo({ top: 0, behavior: 'instant' })
|
||||
if (!window.matchMedia('(max-width: 760px)').matches) return
|
||||
const content = identityContentRoot.value
|
||||
const viewport = content?.closest<HTMLElement>('.project-view')
|
||||
if (!content || !viewport) return
|
||||
viewport.scrollTo({
|
||||
top: viewport.scrollTop + content.getBoundingClientRect().top - viewport.getBoundingClientRect().top,
|
||||
behavior: 'instant'
|
||||
})
|
||||
},
|
||||
{ flush: 'post' }
|
||||
)
|
||||
|
||||
/** 深链接仅在目标 ID 变化时选择,不因目录轮询把用户切回原主体。 */
|
||||
const linkedSubjectId = computed(
|
||||
@@ -165,6 +185,10 @@ watch(selectedId, () => {
|
||||
castingOpen.value = false
|
||||
pendingSelection.value = ''
|
||||
})
|
||||
/** 关闭生成弹窗后清除重试视角,避免影响下一次普通生成。 */
|
||||
watch(imageOpen, open => {
|
||||
if (!open) retryImageView.value = undefined
|
||||
})
|
||||
/** 当前主体写入地址,刷新和返回页面后恢复相同主体,再定位到对应目录项。 */
|
||||
watch(
|
||||
selectedId,
|
||||
@@ -212,6 +236,39 @@ function chooseAnchor(imageId: string) {
|
||||
if (subject.value?.module === 'character') void confirmCasting(imageId)
|
||||
else void confirmStableAnchor(imageId)
|
||||
}
|
||||
/** 当前主体生图暂不可用时,在失败记录旁说明具体恢复步骤。 */
|
||||
const imageRetryDisabledReason = computed(() => {
|
||||
if (operation.value.pending) return '当前操作尚未结束,请等待完成后再重新生成。'
|
||||
if (activeIdentityGeneration.value) return '此主体已有图片正在生成,请等待当前任务完成。'
|
||||
if (dirty.value) return '请先保存下方身份文本修改,再重新生成图片。'
|
||||
if (catalog.error.value || !catalog.data.value || detail.error.value || !detail.data.value)
|
||||
return '主体数据读取失败或尚未完成,请先点击“刷新身份”或重试读取目录。'
|
||||
if (styleQuery.error.value || !styleQuery.data.value) return '视觉风格尚未读取成功,请刷新页面后重试。'
|
||||
if (blocked.value) return '当前项目暂不允许生成图片,请检查剧本与拆解状态,或刷新页面后重试。'
|
||||
if (!hasStyle.value) return '请先在视觉风格页面保存项目风格。'
|
||||
if (generationModelsQuery.error.value || !generationModelsQuery.data.value)
|
||||
return '生成模型目录尚未读取成功,请刷新页面后重试。'
|
||||
if (profileQuery.error.value) return '项目生成配置读取失败,请刷新页面后重试。'
|
||||
if (!hasCreativeProfile.value) return '请先在“项目配置”中选择生成模型。'
|
||||
if (!identity.value?.generationPrompt?.trim()) return '请先填写并保存核心提示词,或使用 AI 生成主体身份。'
|
||||
if (subject.value?.module === 'character' && (castingQuery.error.value || !castingQuery.data.value))
|
||||
return '角色选角状态尚未读取成功,请刷新页面后重试。'
|
||||
return ''
|
||||
})
|
||||
/**
|
||||
* 重新生成只打开原图片类型对应的参数弹窗,费用确认前不发送请求。
|
||||
* @param imageId 当前主体中失败图片的正式编号
|
||||
*/
|
||||
function retryIdentityImage(imageId: string) {
|
||||
const image = images.value.find(item => item.id === imageId && item.status === 'failed')
|
||||
if (!image || imageRetryDisabledReason.value) return
|
||||
if (subject.value?.module === 'character' && image.viewType === 'primary') {
|
||||
if (canGenerateCandidate.value) castingOpen.value = true
|
||||
} else if (canGenerateImage.value) {
|
||||
retryImageView.value = image.viewType
|
||||
imageOpen.value = true
|
||||
}
|
||||
}
|
||||
/** 新回执自动展开,避免折叠区隐藏部分失败诊断。 */
|
||||
const toolsOpen = ref(false)
|
||||
watch(
|
||||
@@ -299,8 +356,8 @@ const nextAction = computed<{ action: IdentityFlowAction; title: string; descrip
|
||||
return {
|
||||
action: 'confirm',
|
||||
title: '第 3 步:确认并锁定',
|
||||
description: '在下方选择母版;人物会同时锁定,场景和道具还需保存锁定状态。',
|
||||
label: '前往确认母版'
|
||||
description: '在“管理候选”弹窗中确认母版;人物会同时锁定,场景和道具还需保存锁定状态。',
|
||||
label: '管理候选并确认'
|
||||
}
|
||||
return {
|
||||
action: 'forms',
|
||||
@@ -325,7 +382,7 @@ function runNextAction() {
|
||||
if (subject.value?.module === 'character') castingOpen.value = true
|
||||
else imageOpen.value = true
|
||||
} else if (nextAction.value.action === 'confirm') {
|
||||
document.querySelector('#identity-reference-gallery')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
||||
identityGallery.value?.openCandidates()
|
||||
} else if (nextAction.value.action === 'lock') {
|
||||
document.querySelector('#identity-lock')?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
} else if (nextAction.value.action === 'forms' && subjectImagesAccess.value.enabled) {
|
||||
@@ -676,9 +733,10 @@ function runNextAction() {
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<div class="identity-workspace">
|
||||
<!-- 以下是主体目录 -->
|
||||
<aside class="panel directory-panel identity-directory">
|
||||
<!-- 以下是与分镜一致的融合工作区模块,目录与详情共用外层背景。 -->
|
||||
<div class="panel workspace-surface directory-workspace identity-workspace">
|
||||
<!-- 以下是主体目录模块,标题和搜索固定,条目通过独立滚动容器浏览。 -->
|
||||
<nav class="directory-panel identity-directory" aria-label="主体目录">
|
||||
<div class="directory-heading">
|
||||
<h3>
|
||||
主体目录 <span>{{ filtered.length }} / {{ subjects.length }}</span>
|
||||
@@ -730,166 +788,168 @@ function runNextAction() {
|
||||
<p v-if="!filtered.length" class="py-6 text-xs text-muted">没有匹配主体,请调整筛选。</p>
|
||||
</div>
|
||||
</NScrollbar>
|
||||
</aside>
|
||||
<NScrollbar class="identity-detail panel-scroll min-w-0">
|
||||
<NAlert 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
|
||||
</nav>
|
||||
<!-- 以下是主体详情模块,滚动和内边距由公共工作区布局统一管理。 -->
|
||||
<article class="directory-workspace-detail identity-detail" aria-label="主体身份详情">
|
||||
<NScrollbar
|
||||
ref="identityDetailScrollbar"
|
||||
class="panel-scroll"
|
||||
content-class="directory-workspace-content identity-detail-content"
|
||||
>
|
||||
<section v-if="subject" class="panel workspace-panel">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h3 class="font-semibold">
|
||||
{{ subject.name }} <code class="subject-ref ml-2">{{ subject.ref }}</code>
|
||||
</h3>
|
||||
</div>
|
||||
<NButton :disabled="detail.loading.value" @click="detail.refresh" text size="small">
|
||||
刷新身份
|
||||
</NButton>
|
||||
</div>
|
||||
<NAlert v-if="detail.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||||
>{{ detail.error.value }} 查询失败时不允许生成或覆盖。
|
||||
</NAlert>
|
||||
<!-- 以下是切换主体时的局部骨架模块,保留真实主体名称与目录 -->
|
||||
<IdentityDetailSkeleton v-if="detailInitialLoading" class="mt-5" />
|
||||
<template v-if="detail.data.value">
|
||||
<div class="identity-flow" aria-label="主体身份操作步骤">
|
||||
<ol class="identity-flow-steps">
|
||||
<li
|
||||
v-for="(step, index) in identityFlow"
|
||||
:key="step.label"
|
||||
:class="{ done: step.done, current: index === currentFlowIndex }"
|
||||
>
|
||||
<span class="identity-flow-marker">
|
||||
<Check v-if="step.done" :size="14" />
|
||||
<Circle v-else :size="12" />
|
||||
</span>
|
||||
<span>{{ index + 1 }}. {{ step.label }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
<div class="identity-next-action">
|
||||
<div>
|
||||
<strong>{{ nextAction.title }}</strong>
|
||||
<p>{{ nextAction.description }}</p>
|
||||
</div>
|
||||
<NButton
|
||||
v-if="
|
||||
nextAction.action !== 'identity' &&
|
||||
(nextAction.action !== 'forms' || subjectImagesAccess.enabled)
|
||||
"
|
||||
type="primary"
|
||||
:disabled="
|
||||
operation.pending ||
|
||||
(nextAction.action === 'candidate' &&
|
||||
(subject.module === 'character'
|
||||
? !canGenerateCandidate
|
||||
: !canGenerateImage))
|
||||
"
|
||||
@click="runNextAction"
|
||||
>{{ nextAction.label }}</NButton
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="dirty" class="mt-3 text-xs text-muted">请先保存身份修改,再使用 AI 或生成图片。</p>
|
||||
<IdentityEditor
|
||||
:key="`${selectedId}:${editorRevision}`"
|
||||
:identity="identity"
|
||||
:module="subject.module"
|
||||
:disabled="detailBlocked"
|
||||
@save="save"
|
||||
@dirty="dirty = $event"
|
||||
>
|
||||
<!-- 以下是唯一的单主体 AI 文本生成入口,覆盖已有文本时沿用确认弹窗 -->
|
||||
<template #generate>
|
||||
<ConfirmAction
|
||||
v-if="identity?.description?.trim() || identity?.generationPrompt?.trim()"
|
||||
label="AI 生成主体身份"
|
||||
description="AI 将重新生成当前主体的身份描述和核心提示词,并覆盖已保存的文本;已有图片不会自动更新。"
|
||||
:disabled="!canGenerateText"
|
||||
primary
|
||||
@confirm="generate"
|
||||
/>
|
||||
<NButton v-else type="primary" :disabled="!canGenerateText" @click="generate">
|
||||
AI 生成主体身份
|
||||
</NButton>
|
||||
</template>
|
||||
</IdentityEditor>
|
||||
<div v-if="anchor" class="identity-anchor mt-5 flex items-center gap-4 pt-5">
|
||||
<AssetImage
|
||||
:src="anchor.imageUrl"
|
||||
:alt="`${subject.name}当前身份母版`"
|
||||
preview
|
||||
class="h-20 w-20 shrink-0"
|
||||
/>
|
||||
<NAlert 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
|
||||
>
|
||||
<section v-if="subject" ref="identityContentRoot" class="identity-subject-content">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<p class="text-sm font-medium">当前身份母版</p>
|
||||
<p class="mt-2 text-xs text-muted">
|
||||
{{
|
||||
subject.module === 'character'
|
||||
? identity?.isLocked
|
||||
? '演员身份已确认并锁定,可用于形态图与镜头首帧。'
|
||||
: '已有演员母版但 Identity 尚未锁定,镜头首帧仍会被阻塞。'
|
||||
: subject.module === 'prop'
|
||||
? '锁定后,后续道具形态图会继承当前母版。'
|
||||
: '后续场景形态图会继承此图的空间结构。'
|
||||
}}
|
||||
</p>
|
||||
<h3 class="font-semibold">
|
||||
{{ subject.name }} <code class="subject-ref ml-2">{{ subject.ref }}</code>
|
||||
</h3>
|
||||
</div>
|
||||
<NButton :disabled="detail.loading.value" @click="detail.refresh" text size="small">
|
||||
刷新身份
|
||||
</NButton>
|
||||
</div>
|
||||
<IdentityGallery
|
||||
id="identity-reference-gallery"
|
||||
:key="selectedId"
|
||||
:images="images"
|
||||
:subject-name="subject.name"
|
||||
:module="subject.module"
|
||||
:identity-locked="!!identity?.isLocked"
|
||||
:disabled="
|
||||
detailBlocked || (subject.module === 'character' && !!castingQuery.error.value)
|
||||
"
|
||||
:pending-operation="pendingImageOperation"
|
||||
@validate="validateImage"
|
||||
@anchor="chooseAnchor"
|
||||
>
|
||||
<!-- 以下是图库标题栏的生成入口模块,与身份保存操作分组 -->
|
||||
<template #actions>
|
||||
<NButton
|
||||
v-if="subject.module === 'scene' || subject.module === 'prop'"
|
||||
:disabled="!canGenerateImage"
|
||||
@click="qualityOpen = true"
|
||||
>生成稳定母版并校验质量</NButton
|
||||
<NAlert v-if="detail.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||||
>{{ detail.error.value }} 查询失败时不允许生成或覆盖。
|
||||
</NAlert>
|
||||
<!-- 以下是切换主体时的局部骨架模块,保留真实主体名称与目录 -->
|
||||
<IdentityDetailSkeleton v-if="detailInitialLoading" class="mt-5" />
|
||||
<template v-if="detail.data.value">
|
||||
<div class="identity-flow" aria-label="主体身份操作步骤">
|
||||
<ol class="identity-flow-steps">
|
||||
<li
|
||||
v-for="(step, index) in identityFlow"
|
||||
:key="step.label"
|
||||
:class="{ done: step.done, current: index === currentFlowIndex }"
|
||||
>
|
||||
<span class="identity-flow-marker">
|
||||
<Check v-if="step.done" :size="14" />
|
||||
<Circle v-else :size="12" />
|
||||
</span>
|
||||
<span>{{ index + 1 }}. {{ step.label }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
<div class="identity-next-action">
|
||||
<div>
|
||||
<strong>{{ nextAction.title }}</strong>
|
||||
<p>{{ nextAction.description }}</p>
|
||||
</div>
|
||||
<NButton
|
||||
v-if="
|
||||
nextAction.action !== 'identity' &&
|
||||
(nextAction.action !== 'forms' || subjectImagesAccess.enabled)
|
||||
"
|
||||
type="primary"
|
||||
:disabled="
|
||||
operation.pending ||
|
||||
(nextAction.action === 'candidate' &&
|
||||
(subject.module === 'character'
|
||||
? !canGenerateCandidate
|
||||
: !canGenerateImage))
|
||||
"
|
||||
@click="runNextAction"
|
||||
>{{ nextAction.label }}</NButton
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="dirty" class="mt-3 text-xs text-muted">
|
||||
请先保存身份修改,再使用 AI 或生成图片。
|
||||
</p>
|
||||
<IdentityEditor
|
||||
:key="`${selectedId}:${editorRevision}`"
|
||||
:identity="identity"
|
||||
:module="subject.module"
|
||||
:disabled="detailBlocked"
|
||||
@save="save"
|
||||
@dirty="dirty = $event"
|
||||
>
|
||||
<!-- 以下是唯一的单主体 AI 文本生成入口,覆盖已有文本时沿用确认弹窗 -->
|
||||
<template #generate>
|
||||
<ConfirmAction
|
||||
v-if="identity?.description?.trim() || identity?.generationPrompt?.trim()"
|
||||
label="AI 生成主体身份"
|
||||
description="AI 将重新生成当前主体的身份描述和核心提示词,并覆盖已保存的文本;已有图片不会自动更新。"
|
||||
:disabled="!canGenerateText"
|
||||
primary
|
||||
@confirm="generate"
|
||||
/>
|
||||
<NButton v-else type="primary" :disabled="!canGenerateText" @click="generate">
|
||||
AI 生成主体身份
|
||||
</NButton>
|
||||
</template>
|
||||
</IdentityEditor>
|
||||
<IdentityGallery
|
||||
id="identity-reference-gallery"
|
||||
ref="identityGallery"
|
||||
:key="selectedId"
|
||||
:images="images"
|
||||
:subject-name="subject.name"
|
||||
:module="subject.module"
|
||||
:identity-locked="!!identity?.isLocked"
|
||||
:disabled="
|
||||
detailBlocked || (subject.module === 'character' && !!castingQuery.error.value)
|
||||
"
|
||||
:pending-operation="pendingImageOperation"
|
||||
:retry-disabled-reason="imageRetryDisabledReason"
|
||||
@validate="validateImage"
|
||||
@anchor="chooseAnchor"
|
||||
@regenerate="retryIdentityImage"
|
||||
>
|
||||
<!-- 以下是母版卡片底部的生成入口模块,候选在独立弹窗中管理 -->
|
||||
<template #actions>
|
||||
<NButton
|
||||
v-if="subject.module === 'scene' || subject.module === 'prop'"
|
||||
:disabled="!canGenerateImage"
|
||||
@click="qualityOpen = true"
|
||||
>生成稳定母版并校验质量</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="subject.module === 'character'"
|
||||
:disabled="!canGenerateCandidate"
|
||||
@click="castingOpen = true"
|
||||
>{{ anchor ? '再生成一张候选' : 'AI 生成角色候选图' }}</NButton
|
||||
>
|
||||
<NButton :disabled="!canGenerateImage" @click="imageOpen = true">
|
||||
{{
|
||||
subject.module === 'character'
|
||||
? '生成辅助参考图'
|
||||
: anchor
|
||||
? '再生成一张候选'
|
||||
: '生成母版候选'
|
||||
}}
|
||||
</NButton>
|
||||
</template>
|
||||
</IdentityGallery>
|
||||
</template>
|
||||
<!-- 以下是当前主体形态与可用跳转入口,各行沿用统一上下间距 -->
|
||||
<div v-if="!detailInitialLoading" class="identity-subject-forms">
|
||||
<h4 class="text-xs font-medium">此主体的形态</h4>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<NTag v-for="form in subject.forms" :key="form.id" size="small" :bordered="false"
|
||||
>{{ form.name }}{{ form.isDefault ? ' · 默认' : '' }}</NTag
|
||||
>
|
||||
<NButton :disabled="!canGenerateImage" @click="imageOpen = true">
|
||||
{{ subject.module === 'character' ? '生成辅助参考图' : '生成母版候选' }}
|
||||
</NButton>
|
||||
</template>
|
||||
</IdentityGallery>
|
||||
</template>
|
||||
<!-- 以下是当前主体形态与可用跳转入口,各行沿用统一上下间距 -->
|
||||
<div v-if="!detailInitialLoading" class="identity-subject-forms">
|
||||
<h4 class="text-xs font-medium">此主体的形态</h4>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<NTag v-for="form in subject.forms" :key="form.id" size="small" :bordered="false"
|
||||
>{{ form.name }}{{ form.isDefault ? ' · 默认' : '' }}</NTag
|
||||
</div>
|
||||
<p v-if="!subject.forms.length" class="text-xs text-muted">
|
||||
此角色尚无正式形态,但可以先完成 Identity 与选角。
|
||||
</p>
|
||||
<RouterLink
|
||||
v-if="subjectImagesAccess.enabled"
|
||||
:to="{
|
||||
path: `/projects/${projectId}/subject-images`,
|
||||
query: { subjectRef: subject.ref }
|
||||
}"
|
||||
class="text-button justify-self-start"
|
||||
>查看此主体形态图片 →</RouterLink
|
||||
>
|
||||
</div>
|
||||
<p v-if="!subject.forms.length" class="text-xs text-muted">
|
||||
此角色尚无正式形态,但可以先完成 Identity 与选角。
|
||||
</p>
|
||||
<RouterLink
|
||||
v-if="subjectImagesAccess.enabled"
|
||||
:to="{
|
||||
path: `/projects/${projectId}/subject-images`,
|
||||
query: { subjectRef: subject.ref }
|
||||
}"
|
||||
class="text-button justify-self-start"
|
||||
>查看此主体形态图片 →</RouterLink
|
||||
>
|
||||
</div>
|
||||
</section>
|
||||
</NScrollbar>
|
||||
</section>
|
||||
</NScrollbar>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
<EmptyState
|
||||
@@ -920,6 +980,7 @@ function runNextAction() {
|
||||
:subject-id="subject.id"
|
||||
:subject-name="subject.name"
|
||||
:module="subject.module"
|
||||
:initial-view-type="retryImageView"
|
||||
:images="images"
|
||||
:catalog="generationModelsQuery.data.value"
|
||||
:profile="profileQuery.data.value.profile"
|
||||
@@ -942,15 +1003,13 @@ function runNextAction() {
|
||||
<style>
|
||||
/* 本组件专属布局与 Naive 内部结构覆盖。 */
|
||||
@reference "../../styles/styles.css";
|
||||
.identity-workspace {
|
||||
@apply grid grid-cols-[240px_minmax(0,_1fr)] items-start gap-3;
|
||||
}
|
||||
/* 主体目录根节点只用于定位,保留桌面纵向和手机横向的自然布局。 */
|
||||
.identity-directory-items {
|
||||
display: contents;
|
||||
}
|
||||
/* 目录由可用工作区高度约束,标题与搜索之外的空间供列表独立滚动。 */
|
||||
.identity-subject-list {
|
||||
@apply max-h-[560px] overflow-hidden;
|
||||
@apply min-h-0 flex-1 overflow-hidden;
|
||||
}
|
||||
.casting-stats {
|
||||
@apply grid grid-cols-[repeat(5,_minmax(0,_1fr))] gap-2.5;
|
||||
@@ -965,12 +1024,6 @@ function runNextAction() {
|
||||
@apply mt-[5px] font-mono text-[13px];
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.identity-workspace {
|
||||
@apply grid-cols-[minmax(0,_1fr)];
|
||||
}
|
||||
.identity-subject-list {
|
||||
@apply max-h-[220px];
|
||||
}
|
||||
.casting-stats {
|
||||
@apply grid-cols-[repeat(2,_minmax(0,_1fr))];
|
||||
}
|
||||
@@ -1064,37 +1117,6 @@ function runNextAction() {
|
||||
.identity-tools-intro {
|
||||
@apply mb-6;
|
||||
}
|
||||
.identity-workspace {
|
||||
@apply flex-1 min-h-0 items-stretch overflow-hidden;
|
||||
}
|
||||
.identity-workspace {
|
||||
@apply grid-cols-[clamp(240px,_22%,_280px)_minmax(0,_1fr)];
|
||||
}
|
||||
.identity-workspace > div {
|
||||
@apply min-h-0 overflow-hidden overscroll-contain;
|
||||
}
|
||||
.identity-detail,
|
||||
.identity-detail > .n-scrollbar-container,
|
||||
.identity-detail .n-scrollbar-content,
|
||||
.identity-detail .panel {
|
||||
@apply w-full min-w-0 max-w-full;
|
||||
}
|
||||
.identity-detail .n-scrollbar-content {
|
||||
@apply wrap-anywhere;
|
||||
}
|
||||
.identity-detail .panel {
|
||||
@apply box-border;
|
||||
}
|
||||
/* AssetImage 的通用 width:100% 不得撑满母版摘要行,否则会把说明文字挤到最右侧。 */
|
||||
.identity-anchor > .asset-image {
|
||||
@apply h-20 w-20 shrink-0 aspect-square;
|
||||
}
|
||||
.identity-anchor > div {
|
||||
@apply min-w-0;
|
||||
}
|
||||
.identity-subject-list {
|
||||
@apply max-h-none min-h-0 flex-1;
|
||||
}
|
||||
.directory-filters {
|
||||
@apply grid gap-3 p-3 shrink-0;
|
||||
}
|
||||
@@ -1104,15 +1126,10 @@ function runNextAction() {
|
||||
.identity-subject-list-content {
|
||||
@apply gap-0.5 pt-0 px-0 pb-2;
|
||||
}
|
||||
/* 目录条目沿用分镜公共底色与选中反馈,仅调整缩略图所需间距。 */
|
||||
.n-button.identity-subject-item {
|
||||
@apply min-h-[86px] py-2.5 px-3.5;
|
||||
}
|
||||
.n-button.identity-subject-item:not(.selected) {
|
||||
@apply bg-(--app-surface);
|
||||
}
|
||||
.n-button.identity-subject-item:not(.selected):hover {
|
||||
@apply bg-(--app-subtle);
|
||||
}
|
||||
.identity-subject-item .directory-item-body {
|
||||
@apply gap-[3px];
|
||||
}
|
||||
@@ -1156,27 +1173,12 @@ function runNextAction() {
|
||||
flex: none;
|
||||
overflow: visible;
|
||||
}
|
||||
.identity-workspace-page .identity-workspace {
|
||||
height: auto;
|
||||
flex: none;
|
||||
overflow: visible;
|
||||
grid-template-rows: auto auto;
|
||||
}
|
||||
.identity-workspace-page .identity-workspace > .identity-detail,
|
||||
.identity-workspace-page .identity-detail > .n-scrollbar-container {
|
||||
height: auto;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
.identity-next-action {
|
||||
@apply items-start flex-col;
|
||||
}
|
||||
.identity-next-action > .n-button {
|
||||
@apply w-full;
|
||||
}
|
||||
.identity-workspace {
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[auto_minmax(0,_1fr)] gap-3;
|
||||
}
|
||||
.identity-directory {
|
||||
@apply h-auto;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user