feat: 同步动作与首帧编辑能力并统一工作区反馈

接入动作时间轴、密度审计、人工视线目标和后台首帧编辑;独立读取已保存提示词,并在首帧晋升前重新核对持久化质量状态。
统一 NMessage 结果反馈、局部 loading 和业务说明间距,保留真实长任务进度与部分失败语义。
验证:pnpm check(49 个文件、393 项测试)、pnpm build;当前环境无法完成 localhost 浏览器验收及真实后端联调。
This commit is contained in:
GouJ committed 2026-10-12 20:05:03 +08:00
1 parent 83482a70c5
commit 7a60db3ced
76 files changed
+2485 -457

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
<script setup lang="ts">
import { Info, CircleAlert, CheckCircle2 } from '@lucide/vue'
/** 可恢复状态和业务说明使用紧凑文字,临时操作结果由消息层处理。 */
withDefaults(
defineProps<{
/** 说明对应的业务级别。 */
type?: 'info' | 'warning' | 'error' | 'success'
/** 保留调用方对图标可见性的控制。 */
showIcon?: boolean
/** 需要始终可见的业务状态名称。 */
title?: string
}>(),
{ type: 'info', showIcon: true }
)
</script>
<template>
<div class="context-notice" :class="`context-notice-${type}`">
<component
v-if="showIcon"
:is="type === 'success' ? CheckCircle2 : type === 'warning' || type === 'error' ? CircleAlert : Info"
:size="14"
aria-hidden="true"
/>
<div class="min-w-0 flex-1">
<strong v-if="title" class="mb-1 block text-xs font-medium">{{ title }}</strong
><slot />
</div>
</div>
</template>
<style>
@reference "../../styles/styles.css";
.context-notice {
@apply flex items-start gap-2 text-xs leading-6 wrap-anywhere;
}
.context-notice > svg {
@apply shrink-0 mt-1 text-muted;
}
.context-notice-error > svg {
@apply text-danger;
}
.context-notice > div > p:first-child {
@apply mt-0;
}
</style>
+28
View File
@@ -0,0 +1,28 @@
<script setup lang="ts">
import { watch } from 'vue'
import { showActionFeedback, useActionMessage } from './useActionMessage'
/** 临时操作反馈只进入全局消息层,不在页面占用正文空间。 */
const props = withDefaults(
defineProps<{
/** 最新操作结果;清空后可再次提示相同内容。 */
message: string
/** 按实际结果选择消息级别。 */
type?: 'success' | 'error' | 'warning' | 'info'
}>(),
{ type: 'error' }
)
/** 与应用其它操作共用 NMessage。 */
const feedback = useActionMessage()
watch(
() => [props.message, props.type] as const,
([content, type]) => {
showActionFeedback(feedback, content, type)
},
{ immediate: true }
)
</script>
<template>
<span hidden aria-hidden="true"><!-- 临时反馈不生成常驻提示框。 --></span>
</template>
+4 -2
View File
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from './ContextNotice.vue'
import FieldLabel from './FieldLabel.vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
/** 只读诊断模块的展示参数。 */
interface Props {
@@ -54,7 +56,7 @@ const emit = defineEmits<{ refresh: [] }>()
</div>
<!-- 以下是读取状态、错误与实际诊断结果模块 -->
<div v-if="open || collapsible === false" :class="{ 'mt-3': showHeader }">
<NAlert v-if="error" type="error" :show-icon="false" role="alert">{{ error }}</NAlert>
<ContextNotice v-if="error" type="error" :show-icon="false" role="alert">{{ error }}</ContextNotice>
<p v-if="loading" class="text-muted" role="status">正在加载…</p>
<slot v-else />
</div>
+9 -3
View File
@@ -1,10 +1,15 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NTag } from 'naive-ui'
import { LoaderCircle } from '@lucide/vue'
import { statusLabels } from '../../lib/format'
import type { ProjectStatus } from '../../features/projects/types'
/** 状态使用 Naive 标签,同时保留文本,避免仅依赖颜色区分。 */
const props = defineProps<{ status: string; label?: string }>()
/** 仅真实执行状态显示旋转图标,锁定或待确认状态不冒充加载。 */
const running = computed(() =>
['running', 'generating', 'pending', 'queued', 'processing', 'submitted'].includes(props.status)
)
const type = computed(() =>
['failed', 'blocked', 'cancelled'].includes(props.status)
? 'error'
@@ -16,7 +21,8 @@ const type = computed(() =>
)
</script>
<template>
<NTag :type="type" size="small" :bordered="false" :data-status="status">{{
label || statusLabels[status as ProjectStatus] || status
}}</NTag>
<NTag :type="type" size="small" :bordered="false" :data-status="status" :aria-busy="running"
><template v-if="running" #icon><LoaderCircle :size="12" class="animate-spin" /></template
>{{ label || statusLabels[status as ProjectStatus] || status }}</NTag
>
</template>
+22 -7
View File
@@ -1,13 +1,25 @@
<script setup lang="ts">
import { NButton } from 'naive-ui'
import AppDialog from './AppDialog.vue'
import { Settings2 } from '@lucide/vue'
import { LoaderCircle, Settings2 } from '@lucide/vue'
/** 批量设置与回执属于临时操作,统一使用大尺寸弹窗;完整制作流程继续保留独立页面。 */
withDefaults(defineProps<{ title: string; label?: string; hasReceipt?: boolean; triggerless?: boolean }>(), {
label: '操作与回执',
triggerless: false
})
withDefaults(
defineProps<{
title: string
label?: string
hasReceipt?: boolean
triggerless?: boolean
/** 当前工作区存在运行中的请求或持久化任务。 */
pending?: boolean
/** 在操作入口原位置展示真实任务名称。 */
pendingLabel?: string
}>(),
{
label: '操作与回执',
triggerless: false
}
)
const open = defineModel<boolean>('open', { default: false })
</script>
@@ -20,10 +32,13 @@ const open = defineModel<boolean>('open', { default: false })
:title="label"
aria-haspopup="dialog"
:aria-expanded="open"
:aria-busy="!!pending"
@click="open = true"
>
<template #icon><Settings2 :size="15" /></template>
<span class="workspace-tools-label">{{ label }}</span
<template #icon
><LoaderCircle v-if="pending" :size="15" class="animate-spin" /><Settings2 v-else :size="15"
/></template>
<span class="workspace-tools-label">{{ pending ? pendingLabel || '任务执行中' : label }}</span
><span v-if="hasReceipt" class="workspace-tools-receipt text-xs text-muted"> · 有回执</span>
</NButton>
<AppDialog v-model:open="open" :title="title" description="" wide>
+26 -2
View File
@@ -1,13 +1,37 @@
import { inject, type InjectionKey } from 'vue'
import { hasInjectionContext, inject, type InjectionKey } from 'vue'
import type { MessageApi } from 'naive-ui'
/** 页面操作结果共用的 Naive Message 实例。 */
export const actionMessageKey: InjectionKey<MessageApi> = Symbol('action-message')
/** 多个查询同时失败时,同一消息层不重复显示相同错误。 */
const recentMessages = new WeakMap<MessageApi, Map<string, number>>()
/**
* 展示短反馈,对同一时间的重复查询错误去重。
* @param message 应用消息接口
* @param content 当前真实反馈
* @param type 反馈级别
*/
export function showActionFeedback(
message: MessageApi | null,
content: string,
type: 'success' | 'error' | 'warning' | 'info'
) {
if (!message || !content.trim()) return
const history = recentMessages.get(message) ?? new Map<string, number>()
const now = Date.now()
const key = `${type}:${content}`
if (now - (history.get(key) ?? -Infinity) < 5000) return
for (const [value, time] of history) if (now - time > 5000) history.delete(value)
history.set(key, now)
recentMessages.set(message, history)
message[type](content, { duration: type === 'error' || type === 'warning' ? 7000 : 3000, closable: true })
}
/**
* 读取应用提供的轻量反馈接口,独立使用组件时允许不提供消息层。
* @returns 当前应用消息接口,没有消息层时返回 null
*/
export function useActionMessage() {
return inject(actionMessageKey, null)
return hasInjectionContext() ? inject(actionMessageKey, null) : null
}
+21
View File
@@ -0,0 +1,21 @@
import { watch, type MaybeRefOrGetter, toValue } from 'vue'
import { showActionFeedback, useActionMessage } from '../components/ui/useActionMessage'
/**
* 对新查询失败统一提示;相同轮询错误不反复弹出,成功读取后解除去重。
* @param source 当前查询错误或局部操作反馈
* @param type 消息级别
* @returns 与当前组件生命周期绑定的观察器
*/
export function useFeedbackMessage(
source: MaybeRefOrGetter<string>,
type: 'error' | 'warning' | 'success' | 'info' = 'error'
) {
const message = useActionMessage()
return watch(
() => toValue(source),
content => {
showActionFeedback(message, content, type)
}
)
}
+3
View File
@@ -1,3 +1,4 @@
import { useFeedbackMessage } from './useFeedbackMessage'
import { onScopeDispose, ref, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'
import { errorMessage } from '../lib/http'
@@ -10,6 +11,8 @@ export function usePolling<T>(
const data = ref<T | null>(null) as Ref<T | null>
const loading = ref(false)
const error = ref('')
/** 查询失败统一进入消息层,保留错误状态用于禁用写操作。 */
useFeedbackMessage(error)
const updatedAt = ref('')
let generation = 0
let controller: AbortController | undefined
+3
View File
@@ -1,3 +1,4 @@
import { useFeedbackMessage } from './useFeedbackMessage'
import { onScopeDispose, ref, watch, type Ref } from 'vue'
import { errorMessage } from '../lib/http'
@@ -6,6 +7,8 @@ export function useQuery<T>(key: Ref<string>, loader: (key: string, signal: Abor
const data = ref<T | null>(null) as Ref<T | null>
const loading = ref(false)
const error = ref('')
/** 查询失败统一进入消息层,保留错误状态用于禁用写操作。 */
useFeedbackMessage(error)
const updatedAt = ref('')
let generation = 0
let controller: AbortController | undefined
+28 -9
View File
@@ -1,10 +1,12 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import AppForm from '../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
import { integerRule, fieldRule } from '../../lib/form-rules'
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import WorkspaceExportButton from '../../components/ui/WorkspaceExportButton.vue'
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NTab, NTable, NTabs } from 'naive-ui'
import { NScrollbar, NButton, NCheckbox, NInputNumber, NProgress, NTab, NTable, NTabs } from 'naive-ui'
import { computed, h, onScopeDispose, ref, watch } from 'vue'
import { useActionMessage } from '../../components/ui/useActionMessage'
import { Layers, LoaderCircle, ArrowRight, Settings2 } from '@lucide/vue'
@@ -13,7 +15,7 @@ import { useProjectContext } from '../projects/context'
import { breakdownApi } from './api'
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview } from './types'
import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../workflows/selectors'
import { getOperation, runOperation } from '../workflows/operations'
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
import ConfirmAction from '../workflows/ConfirmAction.vue'
import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue'
import { useWorkflowExecution } from '../workflows/execution'
@@ -242,7 +244,13 @@ const rules = {
<RouterLink v-if="stageComplete" :to="`/projects/${projectId}/visual-style`" class="text-button"
>继续视觉风格 →</RouterLink
>
<WorkspaceTools v-model:open="toolsOpen" title="拆解设置与恢复" label="拆解设置与恢复">
<WorkspaceTools
:pending="operation.pending"
:pending-label="operation.label"
v-model:open="toolsOpen"
title="拆解设置与恢复"
label="拆解设置与恢复"
>
<section class="panel workspace-panel breakdown-settings-panel">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
@@ -330,11 +338,15 @@ const rules = {
<strong>{{ preview.estimatedTaskCount }}</strong> 个抽取任务
</p>
<ConfirmAction
:loading="
isOperationRunning(operation, '正在拆解剧本') ||
backgroundExecution.active.value
"
:label="records.length ? '重新拆解' : '开始拆解'"
:description="
records.length
? '这会重新运行整个 Breakdown,可能替换已保存的主体与分镜。只想恢复失败阶段时,请使用下方对应恢复操作。'
: '将按当前预览配置启动完整的 Breakdown 工作流。抽取结束后仍需完成主体整理、分镜生成与入库。'
? '这会重新运行完整剧本拆解,可能替换已保存的主体与分镜。只想恢复失败阶段时,请使用下方对应恢复操作。'
: '将按当前预览配置启动完整的 剧本拆解流程。抽取结束后仍需完成主体整理、分镜生成与入库。'
"
:acknowledgement="records.length > 0"
primary
@@ -407,15 +419,19 @@ const rules = {
"
class="mt-3"
></NProgress>
<NAlert
<ContextNotice
v-if="execution?.errorMessage"
role="alert"
type="error"
:show-icon="false"
class="mt-4"
>{{ execution.errorMessage }}</NAlert
>{{ execution.errorMessage }}</ContextNotice
>
<NAlert v-if="validation && !validation.valid" type="error" :show-icon="false" class="mt-4"
<ContextNotice
v-if="validation && !validation.valid"
type="error"
:show-icon="false"
class="mt-4"
><p class="font-medium">分镜校验未通过</p>
<ul class="mt-2 list-inside list-disc space-y-1">
<li v-for="(issue, index) in validation.issues" :key="index">
@@ -424,7 +440,7 @@ const rules = {
><span v-if="issue.shotNo"> / Shot {{ issue.shotNo }}</span
>:{{ issue.message }}
</li>
</ul></NAlert
</ul></ContextNotice
>
<div v-if="showRecovery" class="recovery-strip mt-4">
<div>
@@ -436,6 +452,7 @@ const rules = {
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:loading="isOperationRunning(operation, '正在重试失败抽取')"
label="重试失败抽取"
description="只重试 character / scene / prop 抽取任务中的失败项。不能用于镜头阶段失败。"
acknowledgement
@@ -447,6 +464,7 @@ const rules = {
"
@confirm="run('retry')"
/><ConfirmAction
:loading="isOperationRunning(operation, '正在补齐镜头')"
label="补齐缺失镜头"
description="复用已完成剧集的镜头,仅生成尚未完成的 Episode Shot,再进行校验与入库。"
acknowledgement
@@ -458,6 +476,7 @@ const rules = {
"
@confirm="run('resume-shots')"
/><ConfirmAction
:loading="isOperationRunning(operation, '正在修复分镜绑定')"
label="修复分镜绑定"
description="复用已有镜头,修复 SubjectRef 与视觉 Form 绑定,再校验并保存。"
acknowledgement
@@ -1,5 +1,7 @@
<script setup lang="ts">
import { NAlert, NSelect, NTag } from 'naive-ui'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NSelect, NTag } from 'naive-ui'
import { computed, ref } from 'vue'
import { Clock3 } from '@lucide/vue'
import { EmptyState } from '../../../components/ui'
@@ -58,9 +60,9 @@ const purposeLabels: Record<string, string> = {
{{ plan.emotionalArc }}
</p>
</div>
<NAlert v-if="!episode" type="info" :show-icon="false" class="mb-5">
<ContextNotice v-if="!episode" type="info" :show-icon="false" class="mb-5">
本集已完成节拍规划,镜头尚未生成。请等待进度更新,或在确认中断后使用“补齐缺失镜头”。
</NAlert>
</ContextNotice>
<section v-for="beat in plan.beats" :key="beat.beatNo" class="beat-section">
<div class="beat-heading">
<span class="beat-number">{{ String(beat.beatNo).padStart(2, '0') }}</span>
@@ -8,7 +8,7 @@ import { EmptyState } from '../../components/ui'
import { useProjectContext } from '../projects/context'
import { projectsApi } from '../projects/api'
import { workflowCheckpoints } from '../workflows/selectors'
import { getOperation, runOperation } from '../workflows/operations'
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
import ConfirmAction from '../workflows/ConfirmAction.vue'
import { downloadText } from '../../lib/format'
import EpisodeReader from './EpisodeReader.vue'
@@ -118,12 +118,14 @@ function exportScript() {
</p>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:loading="isOperationRunning(operation, '恢复分集剧本生成') || backgroundExecution.active.value"
label="恢复生成"
description="用于剧集尚未写完的情况。系统会从已保存的角色、世界观和剧集进度继续生成。"
acknowledgement
:disabled="!canGenerate || operation.pending || backgroundExecution.active.value || !!error"
@confirm="resume('resume-generation')"
/><ConfirmAction
:loading="isOperationRunning(operation, '恢复剧本改写') || backgroundExecution.active.value"
label="恢复改写"
description="用于剧集已齐全但审核未通过的情况。系统会从已保存的改写进度继续审核和调整。"
acknowledgement
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NAlert, NButton, NFormItem, NSelect, NSpin } from 'naive-ui'
import { NButton, NFormItem, NSelect, NSpin } from 'naive-ui'
import { errorMessage } from '../../../lib/http'
import { generationConfigApi } from '../api'
import type {
@@ -251,21 +253,21 @@ onScopeDispose(() => {
<section class="production-tool-section creative-profile-settings workspace-panel">
<h3 v-if="!hideActions" class="text-sm font-semibold">项目画布与生成模型</h3>
<NSpin :show="loading">
<NAlert v-if="disabled" type="info" :show-icon="false" class="mb-3"
>项目正在执行制作任务,完成后可以修改配置。</NAlert
<ContextNotice v-if="disabled" type="info" :show-icon="false" class="mb-3"
>项目正在执行制作任务,完成后可以修改配置。</ContextNotice
>
<NAlert v-if="error" type="error" :show-icon="false" class="mb-3">{{ error }}</NAlert>
<NAlert v-if="validationIssues.length" type="warning" :show-icon="false" class="mb-3">
<ContextNotice v-if="error" type="error" :show-icon="false" class="mb-3">{{ error }}</ContextNotice>
<ContextNotice v-if="validationIssues.length" type="warning" :show-icon="false" class="mb-3">
<p v-for="issue in validationIssues" :key="issue">{{ issue }}</p>
</NAlert>
<NAlert v-if="notice" type="success" :show-icon="false" class="mb-3">{{ notice }}</NAlert>
<NAlert
</ContextNotice>
<ContextNotice v-if="notice" type="success" :show-icon="false" class="mb-3">{{ notice }}</ContextNotice>
<ContextNotice
v-if="!loading && (!enabledImages.length || !enabledVideos.length)"
type="warning"
:show-icon="false"
>
当前没有可用的完整图片和视频模型,暂时无法保存项目生成配置。
</NAlert>
</ContextNotice>
<div v-if="profile" class="creative-profile-grid">
<NFormItem label="作品宽高比">
<NSelect
+40 -33
View File
@@ -1,20 +1,14 @@
<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, sizeRules } from '../../lib/form-rules'
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import WorkspaceTools from '../../components/ui/WorkspaceTools.vue'
import {
NScrollbar,
NAlert,
NButton,
NCheckbox,
NInputNumber,
NProgress,
NSelect,
NCollapse,
NCollapseItem
} from 'naive-ui'
import { NScrollbar, NButton, NCheckbox, NInputNumber, NProgress, NSelect, NCollapse, NCollapseItem } from 'naive-ui'
import { computed, inject, ref, watch } from 'vue'
import { ArrowLeft, CheckCircle2, CircleAlert, Film, Image, MessageSquareText } from '@lucide/vue'
import { EmptyState, StatusBadge } from '../../components/ui'
@@ -300,6 +294,8 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
</NButton>
<WorkspaceTools
:pending="operation.pending"
:pending-label="operation.label"
v-model:open="toolsOpen"
title="项目生产总览与批量操作"
label="批量生产"
@@ -361,38 +357,38 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
<section class="workspace-overview-panel production-tool-section workspace-panel">
<div class="overview-content workspace-section-stack">
<h3 class="text-sm font-semibold">项目生产总览与批量操作</h3>
<NAlert v-if="videoRunning" role="status" type="info" :show-icon="false">
<ContextNotice v-if="videoRunning" role="status" type="info" :show-icon="false">
当前有
{{ videoRunning }}
个视频任务等待或生成中。系统会持续更新任务状态,同一镜头不会重复提交。
</NAlert>
<NAlert v-if="identityBlocked" type="info" :show-icon="false">
</ContextNotice>
<ContextNotice v-if="identityBlocked" type="info" :show-icon="false">
当前有
{{ identityBlocked }}
项角色身份尚未准备完成。请先确认角色母版并完成身份锁定,再生成镜头首帧。
<RouterLink :to="`/projects/${id}/subject-identity`" class="text-button ml-2"
>前往主体身份 →</RouterLink
></NAlert
></ContextNotice
>
<NAlert v-if="invalidGenerationSpecs" type="warning" :show-icon="false">
<ContextNotice v-if="invalidGenerationSpecs" type="warning" :show-icon="false">
当前有
{{ invalidGenerationSpecs }}
个镜头的设计信息还不完整。请先补齐镜头设计和即时视觉状态。
<RouterLink :to="`/projects/${id}/storyboard`" class="text-button ml-2">
前往分镜设计 →
</RouterLink>
</NAlert>
<NAlert v-if="staleKeyframes" role="status" type="info" :show-icon="false">
</ContextNotice>
<ContextNotice v-if="staleKeyframes" role="status" type="info" :show-icon="false">
当前有
{{ staleKeyframes }}
个主首帧已过期。它们使用的主体参考资产已经变化,视频阶段会被阻止;可在下方逐镜重新生成,或使用“补齐
/ 更新主首帧”批量处理。
</NAlert>
<NAlert v-if="staleVideos" role="status" type="info" :show-icon="false">
</ContextNotice>
<ContextNotice v-if="staleVideos" role="status" type="info" :show-icon="false">
当前有
{{ staleVideos }}
个主视频已过期。它们使用的主首帧或主体参考图已经变化;非覆盖模式批量生成时会只重建这些过期主视频。
</NAlert>
</ContextNotice>
<ProductionReceipt v-if="session.receipt" :receipt="session.receipt" />
<WorkflowExecutionPanel
v-if="promptExecution.executionId.value"
@@ -490,6 +486,16 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
{{ query.data.value?.keyframes.identityUnlocked ?? 0 }}
</p>
<ConfirmAction
:loading="
stage.key === 'prompts'
? promptExecution.active.value ||
isOperationRunning(operation, '项目视频提示词')
: stage.key === 'keyframes'
? keyframeExecution.active.value ||
isOperationRunning(operation, '首帧')
: videoExecution.active.value ||
isOperationRunning(operation, '视频')
"
:label="stage.action"
:disabled="
blocked ||
@@ -586,14 +592,14 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
<strong>{{ inputPlan?.omniReferenceCount ?? 0 }}</strong>
</div>
</div>
<NAlert
<ContextNotice
v-if="query.data.value?.videoInputPlansError"
type="warning"
:show-icon="false"
class="text-xs"
>
输入规划暂不可用,仍可按“全部推荐模式”提交;刷新后可重试规划。
</NAlert>
</ContextNotice>
<NFormItem path="videoInputMode" label="输入规划范围">
<NSelect
v-model:value="videoInputMode"
@@ -645,6 +651,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
</p>
</div>
<ConfirmAction
:loading="isOperationRunning(operation, '重试失败视频任务')"
label="重试失败视频"
:disabled="
blocked || !batchValid || !query.data.value.videoStatus.failed
@@ -706,13 +713,13 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
@dismiss="keyframeQualityExecution.dismiss"
/>
<!-- 以下是重生成后正文缺省的真实数据说明模块 -->
<NAlert v-if="episodeSourceUnavailable" type="info" :show-icon="false">
<ContextNotice v-if="episodeSourceUnavailable" type="info" :show-icon="false">
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
</NAlert>
</ContextNotice>
<NScrollbar v-if="query.error.value" class="workspace-feedback"
><NAlert role="alert" type="error" :show-icon="false"
><ContextNotice role="alert" type="error" :show-icon="false"
>{{ query.error.value
}}<span v-if="query.data.value"> 当前保留上次读取的数据,生产操作已暂停。</span></NAlert
}}<span v-if="query.data.value"> 当前保留上次读取的数据,生产操作已暂停。</span></ContextNotice
></NScrollbar
>
<!-- 以下是需要处理的项目状态摘要模块,数量为零的项目不占空间 -->
@@ -785,8 +792,8 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
<article class="production-detail min-w-0">
<NScrollbar v-if="shot" class="panel-scroll" content-class="shot-detail-content p-5 lg:p-7">
<header class="mb-5 pb-5">
<NAlert v-if="linkedShotMissing" type="warning" :show-icon="false" class="mb-4"
>链接中的镜头已不存在或不属于该剧集,请在左侧重新选择。</NAlert
<ContextNotice v-if="linkedShotMissing" type="warning" :show-icon="false" class="mb-4"
>链接中的镜头已不存在或不属于该剧集,请在左侧重新选择。</ContextNotice
>
<!-- 以下是镜头编号与最近视频任务状态模块,分别对齐左右边缘 -->
<div class="flex flex-wrap items-center justify-between gap-3">
@@ -815,7 +822,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
</div>
</div>
<p v-if="shot.description" class="mt-3 text-sm leading-7">{{ shot.description }}</p>
<NAlert
<ContextNotice
v-if="videoStatusItem?.status === 'failed'"
type="error"
:show-icon="false"
@@ -826,7 +833,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
此失败不支持普通重试,请先处理失败原因。
</p>
<p v-else-if="videoStatusItem.retryable === true" class="mt-2">此任务可以重试。</p>
</NAlert>
</ContextNotice>
<NCollapse v-if="selectedKeyframeStale" class="mt-3">
<NCollapseItem title="首帧需要更新 · 查看相关素材" name="stale-keyframe">
<StaleKeyframeNotice
@@ -841,7 +848,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
/>
</NCollapseItem>
</NCollapse>
<NAlert
<ContextNotice
v-if="videoItem?.primaryVideoStale"
role="status"
type="info"
@@ -849,7 +856,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
class="mt-4 text-xs"
>
主视频已过期:当前主首帧或主体参考图与生成该视频时不一致。旧视频仍保留,但需要重新生成后才能作为当前有效成片。
</NAlert>
</ContextNotice>
</header>
<ShotProductionAssets
ref="shotAssetsRef"
@@ -1,5 +1,9 @@
<script setup lang="ts">
import { NAlert, NButton, NCheckbox, NCollapse, NCollapseItem, NInputNumber, NSelect } from 'naive-ui'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInputNumber, NSelect } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import ConfirmAction from '../../workflows/ConfirmAction.vue'
import { downloadText, formatDate } from '../../../lib/format'
@@ -71,8 +75,8 @@ const confirmationDescription = computed(
<template>
<NCollapse v-model:expanded-names="expanded" class="production-tool-section"
><NCollapseItem name="advanced" title="高级:串联生产(全项目)">
<NAlert type="warning" :show-icon="false"
>依次补齐形态提示词、参考图、首帧质量校验与修复、视频提示词,再提交视频任务。视觉风格、身份母版、导演设计和即时状态仍需提前准备。</NAlert
<ContextNotice type="warning" :show-icon="false"
>依次补齐形态提示词、参考图、首帧质量校验与修复、视频提示词,再提交视频任务。视觉风格、身份母版、导演设计和即时状态仍需提前准备。</ContextNotice
>
<p class="mt-3 text-xs leading-6 text-muted">
范围固定为全项目并跳过已有有效结果。默认开启测试安全模式:允许 LLM、Vision、主体图、少量首帧和 Video
@@ -118,10 +122,12 @@ const confirmationDescription = computed(
>视频候选镜头上限<NInputNumber v-model:value="videoLimit" :min="1" :step="1" :precision="0"
/></label>
</div>
<NAlert v-if="scopeError" type="error" :show-icon="false" class="mt-3">{{ scopeError }}</NAlert>
<NAlert v-if="!safeMode && !stopAfter" type="warning" :show-icon="false" class="mt-3">
<ContextNotice v-if="scopeError" type="error" :show-icon="false" class="mt-3">{{
scopeError
}}</ContextNotice>
<ContextNotice v-if="!safeMode && !stopAfter" type="warning" :show-icon="false" class="mt-3">
已关闭测试安全模式。启动后会进入视频任务提交阶段并产生较高视频生成费用。
</NAlert>
</ContextNotice>
</div>
<!-- 以下是无消耗预检与费用确认模块。 -->
<div class="mt-4 flex flex-wrap items-center gap-3">
@@ -151,13 +157,13 @@ const confirmationDescription = computed(
<summary>失败任务结果详情</summary>
<pre class="mt-2 whitespace-pre-wrap break-all">{{ JSON.stringify(failedResult, null, 2) }}</pre>
</details>
<NAlert v-if="error" type="error" class="mt-3" :show-icon="false">{{ error }}</NAlert>
<NAlert
<FeedbackMessage v-if="error" :message="error" />
<ContextNotice
v-if="operation.label === '高级串联生产' && operation.error"
type="error"
class="mt-3"
:show-icon="false"
>{{ operation.error }}</NAlert
>{{ operation.error }}</ContextNotice
>
<div v-if="check" class="surface-inset mt-3 p-4">
<p class="text-xs text-muted">{{ formatDate(check.checkedAt) }} · 检查 {{ check.shotCount }} 镜</p>
@@ -221,13 +227,13 @@ const confirmationDescription = computed(
{{ receipt.videoGenerationResult.failed }}</template
><template v-else>未执行或未返回</template>
</p>
<NAlert
<ContextNotice
v-if="receipt.stopReason || receipt.errors.length"
type="warning"
:show-icon="false"
class="mt-3"
><p>{{ receipt.stopReason }}</p>
<p v-for="(item, index) in receipt.errors" :key="index" class="mt-2">{{ item }}</p></NAlert
<p v-for="(item, index) in receipt.errors" :key="index" class="mt-2">{{ item }}</p></ContextNotice
>
</section>
</NCollapseItem></NCollapse
@@ -1,6 +1,8 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { onScopeDispose, ref, watch } from 'vue'
import { NAlert, NButton, NCollapse, NCollapseItem, NProgress, NSpin } from 'naive-ui'
import { NButton, NCollapse, NCollapseItem, NProgress, NSpin } from 'naive-ui'
import { mediaAssetUrl } from '../../../lib/assets'
import { errorMessage } from '../../../lib/http'
import { productionApi } from '../api'
@@ -69,7 +71,7 @@ onScopeDispose(() => controller?.abort())
</p>
<NButton size="small" :disabled="loading" @click="refresh">刷新就绪状态</NButton>
</div>
<NAlert v-if="error" type="error" :show-icon="false" class="mt-3">{{ error }}</NAlert>
<FeedbackMessage v-if="error" :message="error" />
<p v-if="readiness" class="mt-3 text-xs">
已就绪 {{ readiness.ready }}/{{ readiness.total }} 集 · 阻塞 {{ readiness.blocked }} 集
</p>
@@ -1,10 +1,12 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { productionMessage } from '../production-messages'
import { computed } from 'vue'
import { useQuery } from '../../../composables/useQuery'
import { qualityApi } from '../quality-api'
import { NAlert, NButton, NTag } from 'naive-ui'
import { NButton, NTag } from 'naive-ui'
import { AssetImage, AssetOpenLink, StatusBadge } from '../../../components/ui'
import { formatDate } from '../../../lib/format'
import { productionStatusLabel } from '../model'
@@ -19,10 +21,12 @@ const props = defineProps<{
shotNo: number
stale: boolean
blocked: boolean
/** 只在当前源图编辑任务运行期间显示局部加载。 */
editing?: boolean
validationPassed: boolean | null
confirming: boolean
}>()
const emit = defineEmits<{ quality: []; select: []; confirm: []; cancel: []; history: [] }>()
const emit = defineEmits<{ quality: []; edit: []; select: []; confirm: []; cancel: []; history: [] }>()
/** 质量状态以数据库为准;会话内检查仅在历史状态未知时兜底。 */
const reviewKey = computed(() =>
props.item.status === 'completed' ? JSON.stringify([props.shotId, props.item.id, props.reviewRevision ?? 0]) : ''
@@ -96,6 +100,15 @@ const canSelect = computed(
<NButton text size="small" @click="emit('quality')">
{{ validationPassed === null ? '质量检查' : '重新检查' }}
</NButton>
<NButton
v-if="item.source !== 'provider_variant'"
text
size="small"
:disabled="blocked"
:loading="editing"
@click="emit('edit')"
>编辑此首帧</NButton
>
<NButton v-if="item.status === 'completed'" text size="small" @click="emit('history')"
>查看首帧校验历史</NButton
>
@@ -103,13 +116,13 @@ const canSelect = computed(
设为主首帧
</NButton>
</div>
<NAlert v-if="confirming" type="info" :show-icon="false" class="mt-2 text-xs">
<p>该候选已通过本次质量检查。确认让后续视频使用此首帧?</p>
<ContextNotice v-if="confirming" type="info" :show-icon="false" class="mt-2 text-xs">
<p>该候选已满足当前质量要求。确认让后续视频使用此首帧?</p>
<div class="mt-2 flex gap-3">
<NButton type="primary" @click="emit('confirm')">确认切换</NButton>
<NButton text size="small" @click="emit('cancel')">取消</NButton>
</div>
</NAlert>
</ContextNotice>
</div>
</article>
</template>
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NAlert, NButton, NCheckbox, NCollapse, NCollapseItem, NTag } from 'naive-ui'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NTag } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import { generationConfigApi } from '../../generation-config/api'
import type {
@@ -119,9 +123,9 @@ async function loadPreview() {
validate-on-change
@submit="submit"
>
<NAlert v-if="replacePrimary" type="info" :show-icon="false" class="mt-5 text-xs">
<ContextNotice v-if="replacePrimary" type="info" :show-icon="false" class="mt-5 text-xs">
当前主首帧使用的主体参考资产已经变化。新图成功后应设为主首帧,旧图会继续保留为历史候选。
</NAlert>
</ContextNotice>
<section v-if="generationCatalog" class="dialog-section mt-5" aria-label="本次首帧生成模型设置">
<p class="text-xs font-medium">
<FieldLabel
@@ -141,14 +145,14 @@ async function loadPreview() {
@update:options="imageGenerationOptions = $event"
/>
</section>
<NAlert v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-5 text-xs">
<ContextNotice v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-5 text-xs">
生成模型目录读取失败:{{ generationCatalogError }}
</NAlert>
</ContextNotice>
<div class="mt-5 flex flex-wrap items-center gap-3">
<NButton :loading="previewPending" @click="loadPreview">预览实际生成输入</NButton>
<span class="text-xs text-muted">只读取参考图规划与最终 Prompt,不调用图片模型。</span>
</div>
<NAlert v-if="previewError" type="error" :show-icon="false" class="mt-3">{{ previewError }}</NAlert>
<FeedbackMessage v-if="previewError" :message="previewError" />
<div v-if="preview" class="panel mt-3 p-4 text-xs leading-6">
<div class="flex flex-wrap items-center gap-2">
<strong>{{ preview.provider }} / {{ preview.model }}</strong>
@@ -0,0 +1,361 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import { NButton, NCheckbox, NInput, NSelect } from 'naive-ui'
import { AppDialog, AssetImage } from '../../../components/ui'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { useQuery } from '../../../composables/useQuery'
import { useFeedbackMessage } from '../../../composables/useFeedbackMessage'
import { errorMessage } from '../../../lib/http'
import { getOperation, runOperation } from '../../workflows/operations'
import { useWorkflowExecution } from '../../workflows/execution'
import { generationConfigApi } from '../../generation-config/api'
import type { GenerationOptions } from '../../generation-config/types'
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
import { spatialApi } from '../../storyboard/spatial-api'
import {
keyframeEditApi,
type KeyframeEditInput,
type KeyframeEditPreview,
type RelativeGazeGeometry
} from '../keyframe-edit-api'
import { productionApi } from '../api'
import type { ShotKeyframe } from '../types'
/** 编辑明确指定的源图;关闭弹窗后后台任务继续由页面观察。 */
const props = defineProps<{ projectId: string; shotId: string; source: ShotKeyframe | null; disabled: boolean }>()
const open = defineModel<boolean>('open', { default: false })
const emit = defineEmits<{ started: [executionId: string] }>()
const execution = useWorkflowExecution(
computed(() => props.projectId),
'keyframe-quality'
)
/** 草稿与来源、模型和参数共同构成预览身份,变化时撤销旧确认。 */
const instruction = ref('')
const editMode = ref<KeyframeEditInput['editMode']>('subject_only')
const allowBackground = ref(false)
const confirmed = ref(false)
const provider = ref('')
const options = ref<GenerationOptions>({})
const geometry = ref<RelativeGazeGeometry[]>([])
const preview = ref<KeyframeEditPreview | null>(null)
const previewError = ref('')
const previewLoading = ref(false)
useFeedbackMessage(previewError)
/** 只有打开当前有效源图时才读取配置和已有绑定。 */
const sourceKey = computed(() =>
open.value && props.source ? JSON.stringify([props.projectId, props.shotId, props.source.id]) : ''
)
const modelQuery = useQuery(sourceKey, async (key, signal) => {
if (!key) return null
const [projectId, shotId] = JSON.parse(key) as [string, string, string]
const [catalog, profile, bindings] = await Promise.all([
generationConfigApi.catalog(signal),
generationConfigApi.profile(projectId, signal),
spatialApi.bindings(shotId, signal)
])
return { catalog, profile, bindings }
})
watch(sourceKey, () => {
instruction.value = ''
editMode.value = 'subject_only'
allowBackground.value = false
confirmed.value = false
geometry.value = []
geometryBinding.value = null
preview.value = null
previewError.value = ''
previewLoading.value = false
})
watch(
() => modelQuery.data.value,
data => {
if (!data) return
provider.value = data.profile?.imageProvider || data.catalog.defaults.imageProvider
const selected = data.catalog.images.find(item => item.provider === provider.value)
options.value = { ...selected?.defaults, ...data.profile?.imageOptions }
}
)
/** 已保存人工目标作为几何选择来源;不自动填写高低方向。 */
const bindingOptions = computed(() =>
(modelQuery.data.value?.bindings ?? [])
.filter(item => item.visibility === 'in_frame')
.map((item, index) => ({ label: `${item.subjectRef} → ${item.targetDescription}`, value: index }))
)
const geometryBinding = ref<number | null>(null)
/**
* 添加一个已保存目标的人工几何观察。
* @returns 未选择明确绑定时不创建记录
*/
function addGeometry() {
if (geometryBinding.value === null) return
const binding = (modelQuery.data.value?.bindings ?? []).filter(item => item.visibility === 'in_frame')[
geometryBinding.value
]
if (
!binding ||
geometry.value.some(
item => item.subjectRef === binding.subjectRef && item.targetDescription === binding.targetDescription
)
)
return
geometry.value.push({
subjectRef: binding.subjectRef,
targetDescription: binding.targetDescription,
horizontal: 'unknown',
vertical: 'unknown',
source: 'manual'
})
}
/** 预览与提交都使用当前人工配置,不拼接 Provider 指令。 */
const input = computed<KeyframeEditInput>(() => ({
editInstruction: instruction.value.trim(),
editMode: editMode.value,
...(editMode.value === 'composition_assisted'
? { allowBackgroundDeemphasis: allowBackground.value, relativeGazeGeometry: geometry.value }
: {}),
provider: provider.value || undefined,
generationOptions: options.value
}))
const inputKey = computed(() => JSON.stringify([sourceKey.value, input.value]))
watch(inputKey, () => {
preview.value = null
previewError.value = ''
confirmed.value = false
previewLoading.value = false
})
const requestLoading = computed(() => {
const operation = getOperation(props.projectId)
return operation.pending && operation.label === `编辑镜头 ${props.shotId} 首帧`
})
const valid = computed(
() =>
!!instruction.value.trim() &&
!!modelQuery.data.value &&
!modelQuery.error.value &&
(editMode.value !== 'composition_assisted' || allowBackground.value)
)
/** 只读编辑预览,切换源图或参数后忽略旧结果。 */
async function inspect() {
if (!valid.value || previewLoading.value || !props.source) return
const version = inputKey.value
const shotId = props.shotId
const sourceId = props.source.id
previewLoading.value = true
previewError.value = ''
try {
const result = await keyframeEditApi.preview(shotId, sourceId, input.value)
if (version !== inputKey.value || !open.value) return
if (result.shotId !== shotId || result.sourceKeyframeId !== sourceId)
throw new Error('编辑预览与当前源图不匹配。')
preview.value = result
} catch (cause) {
if (version === inputKey.value && open.value) previewError.value = errorMessage(cause)
} finally {
if (version === inputKey.value) previewLoading.value = false
}
}
/** 重新核对源图并提交一次,后台句柄按原项目保存。 */
async function submit() {
if (props.disabled || !valid.value || !preview.value || !confirmed.value || !props.source || requestLoading.value)
return
const projectId = props.projectId
const shotId = props.shotId
const source = { ...props.source }
const body: KeyframeEditInput = JSON.parse(JSON.stringify(input.value))
const version = inputKey.value
const ok = await runOperation(
projectId,
`编辑镜头 ${shotId} 首帧`,
async () => {
const records = await productionApi.listKeyframes(shotId)
const current = records.find(item => item.id === source.id && item.shotId === shotId)
if (
!current ||
current.status !== 'completed' ||
!current.imageUrl ||
current.source === 'provider_variant' ||
current.isPrimary !== source.isPrimary
)
throw new Error('编辑源图或主首帧状态已变化,请刷新后重新预览并确认。')
if (version !== inputKey.value || !open.value) throw new Error('编辑配置已变化,请重新预览。')
const started = await keyframeEditApi.start(shotId, source.id, body)
if (started.projectId !== projectId || started.shotId !== shotId || started.sourceKeyframeId !== source.id)
throw new Error('后台编辑任务归属不匹配,请刷新状态,勿重复提交。')
await execution.track(started.executionId, projectId)
if (props.projectId === projectId) emit('started', started.executionId)
},
{ content: '首帧编辑已在后台开始,结果会显示在当前镜头。', type: 'info' }
)
if (ok && version === inputKey.value) open.value = false
}
</script>
<template>
<AppDialog v-model:open="open" title="编辑首帧候选" :busy="requestLoading" wide>
<div v-if="source" class="keyframe-edit-layout">
<div>
<AssetImage :src="source.imageUrl" alt="本次首帧编辑源图" preview />
<p class="mt-2 text-xs text-muted">
{{
source.isPrimary
? '编辑主首帧:后台会自动校验,通过后尝试晋升新图。'
: '编辑历史候选:仅生成新候选,之后需另行质量检查。'
}}
</p>
</div>
<div class="space-y-4 min-w-0">
<label class="block text-xs"
>修改要求<NInput
v-model:value="instruction"
type="textarea"
class="mt-2"
:autosize="{ minRows: 4, maxRows: 8 }"
placeholder="描述需要修改的姿态、视线或局部细节"
:disabled="requestLoading"
/></label>
<label class="block text-xs"
>编辑范围<NSelect
v-model:value="editMode"
class="mt-2"
:options="[
{ label: '主体局部调整', value: 'subject_only' },
{ label: '构图协同调整', value: 'composition_assisted' }
]"
:disabled="requestLoading"
/></label>
<NCheckbox
v-if="editMode === 'composition_assisted'"
v-model:checked="allowBackground"
:disabled="requestLoading"
>我确认允许弱化非关键背景干扰,保留固定目标及已确认主体。</NCheckbox
>
<GenerationModelControls
v-if="modelQuery.data.value"
type="image"
:catalog="modelQuery.data.value.catalog"
:provider="provider"
:options="options"
:aspect-ratio="modelQuery.data.value.profile?.aspectRatio ?? '9:16'"
:disabled="requestLoading"
@update:provider="provider = $event"
@update:options="options = $event"
/>
<p v-if="modelQuery.loading.value" class="text-xs text-muted" role="status">正在读取生成配置…</p>
<IssueHint :messages="modelQuery.error.value ? [modelQuery.error.value] : []" type="error" />
<div v-if="editMode === 'composition_assisted' && bindingOptions.length" class="space-y-3">
<h4 class="text-xs font-medium">相对视线位置(人工确认,可选)</h4>
<div class="flex flex-wrap gap-2">
<NSelect
v-model:value="geometryBinding"
:options="bindingOptions"
placeholder="选择已确认目标"
class="min-w-0 flex-1"
:disabled="requestLoading"
/><NButton :disabled="geometryBinding === null || requestLoading" @click="addGeometry"
>添加观察</NButton
>
</div>
<section v-for="(item, index) in geometry" :key="index" class="space-y-3 bg-(--app-subtle) p-3">
<div class="flex items-center justify-between gap-3 text-xs">
<span>{{ item.subjectRef }} → {{ item.targetDescription }}</span
><NButton text size="small" :disabled="requestLoading" @click="geometry.splice(index, 1)"
>移除</NButton
>
</div>
<div class="keyframe-geometry-grid">
<label
>目标相对双眼水平方向<NSelect
v-model:value="item.horizontal"
:options="[
{ label: '左侧', value: 'left' },
{ label: '右侧', value: 'right' },
{ label: '居中', value: 'center' },
{ label: '未确认', value: 'unknown' }
]"
:disabled="requestLoading"
/></label>
<label
>目标相对双眼高低<NSelect
v-model:value="item.vertical"
:options="[
{ label: '上方', value: 'above' },
{ label: '下方', value: 'below' },
{ label: '同高', value: 'level' },
{ label: '未确认', value: 'unknown' }
]"
:disabled="requestLoading"
/></label>
<label
>注视部位<NSelect
v-model:value="item.targetFocusRegion"
clearable
:options="[
{ label: '中上部', value: 'upper' },
{ label: '中心', value: 'center' },
{ label: '下部', value: 'lower' },
{ label: '整体', value: 'whole' }
]"
:disabled="requestLoading"
/></label>
<label
>姿态协同<NSelect
v-model:value="item.gazeAlignmentStrategy"
clearable
:options="[
{ label: '双眼微调', value: 'eyes_only' },
{ label: '头颈协同', value: 'head_assisted' },
{ label: '上半身协同', value: 'upper_body_assisted' }
]"
:disabled="requestLoading"
/></label>
</div>
</section>
</div>
</div>
</div>
<div class="mt-5 flex flex-wrap items-center gap-3">
<NButton :disabled="!valid || requestLoading" :loading="previewLoading" @click="inspect"
>预览编辑输入</NButton
><span class="text-xs text-muted">只编译编辑指令,不调用图片模型。</span>
</div>
<IssueHint :messages="previewError ? [previewError] : []" type="error" />
<section v-if="preview" class="mt-4 space-y-3 bg-(--app-subtle) p-4 text-xs leading-6">
<p>
{{ preview.provider }} / {{ preview.model }} · 源图 {{ preview.sourceImageSlots }} 张 · 已选参考
{{ preview.selected.length }} 张 · 省略 {{ preview.omitted.length }} 张
</p>
<p class="whitespace-pre-wrap break-words">{{ preview.editInstruction }}</p>
</section>
<NCheckbox v-model:checked="confirmed" class="mt-5" :disabled="!preview || requestLoading"
>我已核对预览并确认本次生图费用;主首帧编辑还会自动调用视觉校验。</NCheckbox
>
<template #footer
><NButton :disabled="requestLoading" @click="open = false">取消</NButton
><NButton
type="primary"
:disabled="disabled || !valid || !preview || !confirmed"
:loading="requestLoading"
@click="submit"
>确认编辑</NButton
></template
>
</AppDialog>
</template>
<style>
@reference "../../../styles/styles.css";
.keyframe-edit-layout {
@apply grid grid-cols-[minmax(180px,280px)_minmax(0,1fr)] gap-5;
}
.keyframe-geometry-grid {
@apply grid grid-cols-[repeat(auto-fit,minmax(min(100%,180px),1fr))] gap-3;
}
.keyframe-geometry-grid > label {
@apply grid gap-2 text-xs;
}
@media (max-width: 760px) {
.keyframe-edit-layout {
@apply grid-cols-1;
}
}
</style>
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, ref } from 'vue'
import { NButton, NInput, NAlert } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { errorMessage } from '../../../lib/http'
import ReadonlyInspection from '../../../components/ui/ReadonlyInspection.vue'
import { useQuery } from '../../../composables/useQuery'
@@ -169,13 +173,13 @@ const records = computed(() =>
placeholder="填写审核理由(必填)"
:disabled="submitting"
/>
<NAlert :type="reviewAction === 'accepted' ? 'warning' : 'info'" :show-icon="false">
<ContextNotice :type="reviewAction === 'accepted' ? 'warning' : 'info'" :show-icon="false">
{{
reviewAction === 'accepted'
? '确认接受后将替换当前主首帧;AI 原始失败记录仍会保留。'
: '拒绝后保留图片及原始质量记录。'
}}
</NAlert>
</ContextNotice>
<div class="flex gap-3">
<NButton
type="primary"
@@ -188,8 +192,10 @@ const records = computed(() =>
</div>
</div>
</section>
<NAlert v-if="submitError" type="error" :show-icon="false" class="mt-3">{{ submitError }}</NAlert>
<NAlert v-if="submitSuccess" type="success" :show-icon="false" class="mt-3">{{ submitSuccess }}</NAlert>
<FeedbackMessage v-if="submitError" :message="submitError" />
<ContextNotice v-if="submitSuccess" type="success" :show-icon="false" class="mt-3">{{
submitSuccess
}}</ContextNotice>
<p v-if="reviewQuery.error.value" class="text-danger">{{ reviewQuery.error.value }}</p>
<p v-if="!records.length" class="text-muted">暂无校验记录。</p>
<!-- 以下是实际校验结论、问题与调用错误模块 -->
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { onScopeDispose, ref, watch } from 'vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
import { qualityApi } from '../quality-api'
import type { ImageProviderCapability, ShotProviderCapability } from '../quality.types'
import { errorMessage } from '../../../lib/http'
@@ -55,7 +59,7 @@ async function inspect() {
<template>
<section class="mt-4 text-xs">
<NButton size="small" :loading="loading" :disabled="loading" @click="inspect">查看模型限制</NButton>
<NAlert v-if="error" type="error" :show-icon="false" class="mt-3">{{ error }}</NAlert>
<FeedbackMessage v-if="error" :message="error" />
<template v-if="providers">
<p v-if="!providers.some(item => item.active)" class="mt-2 text-danger">
没有匹配的启用图片模型,请检查后端配置。
@@ -71,12 +75,12 @@ async function inspect() {
}}
</p>
</template>
<NAlert v-if="capability" :type="capability.valid ? 'info' : 'error'" :show-icon="false" class="mt-3">{{
<ContextNotice v-if="capability" :type="capability.valid ? 'info' : 'error'" :show-icon="false" class="mt-3">{{
capability.valid
? capability.message ||
`当前镜头共有 ${capability.referenceCount} 张业务参考图,后端已判定本次规划符合 ${capability.provider} 能力。`
: capability.message || '当前镜头不满足模型能力限制。'
}}</NAlert>
}}</ContextNotice>
<p v-if="capability?.valid && capability.plannedReferenceCount !== undefined" class="mt-2 text-muted">
本次计划输入 {{ capability.plannedReferenceCount }} 张 · 转为文字约束
{{ capability.omittedReferenceCount ?? 0 }} 张
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NCollapse, NCollapseItem, NScrollbar } from 'naive-ui'
import { NCollapse, NCollapseItem, NScrollbar } from 'naive-ui'
import type { ProductionPlan, ProjectProductionStatus } from '../types'
/** 展示当前制作计划与真实资产状态,不在页面重复推断业务规则。 */
@@ -92,11 +94,11 @@ const problems = computed(() => [
<p class="mt-2 text-xs text-muted">
计划会根据当前素材自动更新。已有有效结果会直接复用;重新生成的过期主体图会自动设为当前主图,手动生成的候选仍可在形态图片页自行确认。
</p>
<NAlert v-if="plan.hasManualBlockers" type="warning" :show-icon="false" class="mt-3">
<ContextNotice v-if="plan.hasManualBlockers" type="warning" :show-icon="false" class="mt-3">
各阶段合计
{{ plan.manualBlocked }}
项需人工处理(同一镜头可能重复计数)。可先生成就绪的主体参考图;成功结果会保留,遇到阻塞时后续阶段可能暂停。
</NAlert>
</ContextNotice>
<NCollapse v-if="problems.length" class="mt-3" :default-expanded-names="['issues']">
<NCollapseItem name="issues" title="查看还需要准备的内容">
<ul class="space-y-3 text-xs">
@@ -1,5 +1,7 @@
<script setup lang="ts">
import { NAlert, NButton } from 'naive-ui'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NButton } from 'naive-ui'
import { Download } from '@lucide/vue'
import { downloadText } from '../../../lib/format'
import type { ProductionReceipt } from '../types'
@@ -44,7 +46,7 @@ function exportReceipt() {
{{ receipt.result.skipped }} · 已重新提交 {{ receipt.result.retried }} · 提交失败
{{ receipt.result.failed }}
</p>
<NAlert
<ContextNotice
v-if="receipt.kind === 'videos' && receipt.result.created"
role="status"
type="info"
@@ -52,10 +54,10 @@ function exportReceipt() {
class="mt-3"
>
严格质量候选已经创建,但尚未代表成片完成。后台会继续查询视频模型、执行视觉校验,并在失败时有限修复;只有校验通过的候选才会晋升主视频。
</NAlert>
<NAlert v-if="receipt.result.failed" role="alert" type="error" :show-icon="false" class="mt-3">
</ContextNotice>
<ContextNotice v-if="receipt.result.failed" role="alert" type="error" :show-icon="false" class="mt-3">
本次存在部分失败,成功提交或生成的结果不会回滚。请查看逐镜错误后再重试。
</NAlert>
</ContextNotice>
<ul v-if="receipt.result.failures.length" class="mt-3 space-y-2 text-xs text-danger">
<li v-for="failure in receipt.result.failures" :key="failure.shotId">
<code>{{ failure.shotId }}</code
@@ -1,6 +1,8 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NAlert, NButton, NInput } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { productionApi } from '../api'
import { errorMessage } from '../../../lib/http'
import type { ProviderInputSpec } from '../types'
@@ -61,7 +63,7 @@ async function inspect() {
/>
<NButton :disabled="!targetProvider || loading" :loading="loading" @click="inspect">检查实际输入</NButton>
</div>
<NAlert v-if="error" type="error" :show-icon="false" class="mt-3">{{ error }}</NAlert>
<FeedbackMessage v-if="error" :message="error" />
<div v-if="result" class="mt-3 space-y-2 break-all text-xs">
<p>目标模型:{{ result.targetProvider }}</p>
<p>业务主首帧:{{ result.businessKeyframe.id }}</p>
@@ -1,19 +1,13 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
import { integerRule, sizeRules } from '../../../lib/form-rules'
import { computed, ref, watch } from 'vue'
import {
NAlert,
NButton,
NCheckbox,
NCollapse,
NCollapseItem,
NInput,
NInputNumber,
NRadioButton,
NRadioGroup
} from 'naive-ui'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NInputNumber, NRadioButton, NRadioGroup } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { allowedTextLines, validQualityInput } from '../quality'
import type { QualityAction, QualityInput, QualityTarget } from '../quality.types'
@@ -243,8 +237,8 @@ const optionsExpanded = ref<string[]>(['options'])
target?.kind === 'video' ? '生成修复候选' : '校验并修复'
}}</NRadioButton>
</NRadioGroup>
<NAlert v-if="target?.kind === 'video'" type="info" :show-icon="false" class="mt-4"
>视频校验会按镜头启用抽样帧、运动及道具专项检查,不含音频和口型。普通候选只校验;修复候选复检通过后会自动设为主视频。</NAlert
<ContextNotice v-if="target?.kind === 'video'" type="info" :show-icon="false" class="mt-4"
>视频校验会按镜头启用抽样帧、运动及道具专项检查,不含音频和口型。普通候选只校验;修复候选复检通过后会自动设为主视频。</ContextNotice
>
<div v-if="generating" class="quality-fields mt-4">
<NFormItem path="attempts" :label="videoRepair ? '修复链次数上限' : '每镜最多修复'"
@@ -274,8 +268,8 @@ const optionsExpanded = ref<string[]>(['options'])
<p v-if="videoRepair" class="mt-3 text-xs text-muted">
本次仅创建一个修复视频,不自动等待或复检。完成后请打开新候选的质量检查;修复约束沿用上次失败校验,不使用额外参数。
</p>
<NAlert v-if="!repairAvailable" type="warning" :show-icon="false" class="mt-3"
>请先执行视觉校验,只有未通过的视频可以创建修复候选。</NAlert
<ContextNotice v-if="!repairAvailable" type="warning" :show-icon="false" class="mt-3"
>请先执行视觉校验,只有未通过的视频可以创建修复候选。</ContextNotice
>
<NCollapse
v-if="!videoRepair"
@@ -326,10 +320,10 @@ const optionsExpanded = ref<string[]>(['options'])
:aspect-ratio="modelQuery.data.value.profile.aspectRatio"
:disabled="pending"
/>
<NAlert v-if="modelQuery.error.value" type="error" :show-icon="false">{{
<ContextNotice v-if="modelQuery.error.value" type="error" :show-icon="false">{{
modelQuery.error.value
}}</NAlert>
<NAlert
}}</ContextNotice>
<ContextNotice
v-if="target?.kind === 'batch' && !modelReady && !modelQuery.error.value"
type="warning"
:show-icon="false"
@@ -339,14 +333,14 @@ const optionsExpanded = ref<string[]>(['options'])
? '正在读取项目模型配置,请稍候。'
: '请先保存有效的项目图片模型配置,再选择本次模型。'
}}
</NAlert>
</ContextNotice>
<ModelCapabilities
:shot-id="target?.shotId"
:provider="target?.kind === 'batch' ? provider : undefined"
/>
</NCollapseItem>
</NCollapse>
<NAlert type="warning" :show-icon="false" class="mt-4">
<ContextNotice type="warning" :show-icon="false" class="mt-4">
<template v-if="videoRepair"
>本次最多提交 1
个视频生成任务,可能产生费用;生成完成不会切换主视频,需再次付费复检通过后才会晋升。</template
@@ -365,12 +359,10 @@ const optionsExpanded = ref<string[]>(['options'])
? '如果当前是修复候选,校验通过将替换当前主视频。'
: '仅校验,不修改主资产。'
}}</template>
</NAlert>
</ContextNotice>
</AppForm>
<p v-if="pending" role="status" class="mt-3 text-xs text-muted">{{ operation.label }}进行中,请勿重复提交。</p>
<NAlert v-if="session.error" role="alert" type="error" :show-icon="false" class="mt-4">{{
session.error
}}</NAlert>
<FeedbackMessage v-if="session.error" :message="session.error" />
<!-- 以下是持久化任务进度与原目标最终回执模块 -->
<WorkflowExecutionPanel
v-if="execution.executionId.value"
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NButton, NCollapse, NCollapseItem } from 'naive-ui'
import { NButton, NCollapse, NCollapseItem } from 'naive-ui'
import { downloadText } from '../../../lib/format'
import type { QualityReceipt } from '../quality.types'
@@ -111,7 +113,7 @@ function exportResult() {
</p>
<p v-else class="mt-2 text-xs text-muted">只校验,不重生成或切换主首帧。</p>
</template>
<NAlert
<ContextNotice
v-for="(issue, index) in issues"
:key="index"
:type="issue.severity === 'error' ? 'error' : 'warning'"
@@ -119,7 +121,7 @@ function exportResult() {
class="mt-3"
>
{{ issue.frameLabel ? `${issue.frameLabel} · ` : '' }}{{ issue.description }}
</NAlert>
</ContextNotice>
<NCollapse class="mt-4" :default-expanded-names="['details']">
<NCollapseItem name="details" title="主体检查与执行详情">
<template v-if="receipt.kind === 'keyframe' || receipt.kind === 'video'">
@@ -1,8 +1,12 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { useActionMessage } from '../../../components/ui/useActionMessage'
import ProviderInputInspector from './ProviderInputInspector.vue'
import { NAlert, NButton, NCollapse, NCollapseItem, NSelect, NTag } from 'naive-ui'
import { NButton, NCollapse, NCollapseItem, NSelect, NTag } from 'naive-ui'
import { computed, onScopeDispose, ref, watch } from 'vue'
import { ImagePlus, RefreshCw } from '@lucide/vue'
import { AssetImage } from '../../../components/ui'
@@ -26,7 +30,12 @@ import type {
VideoGenerationSpec,
VideoReadinessItem
} from '../types'
import MotionPlanPanel from '../../storyboard/components/MotionPlanPanel.vue'
import SpatialBindingsPanel from '../../storyboard/components/SpatialBindingsPanel.vue'
import KeyframeDialog from './KeyframeDialog.vue'
import KeyframeEditDialog from './KeyframeEditDialog.vue'
import type { ShotKeyframe } from '../types'
import { getOperation, isOperationRunning } from '../../workflows/operations'
import KeyframeCard from './KeyframeCard.vue'
import VideoCard from './VideoCard.vue'
import ProductionStageStatus from './ProductionStageStatus.vue'
@@ -48,6 +57,25 @@ import GenerationModelControls from '../../generation-config/components/Generati
/** 当前页面操作反馈使用消息提示,不长期占据正文。 */
const actionMessage = useActionMessage()
/** 动作与视线按需打开,避免进入生产页便编译全部镜头。 */
const motionOpen = ref(false)
/** 编辑源图保持正式资产身份,不能把视频输入变体当作业务源图。 */
const editOpen = ref(false)
const editSource = ref<ShotKeyframe | null>(null)
/**
* 编辑具体主图或历史候选,切镜时废弃原源图。
* @param source 当前镜头已完成首帧
*/
function openEdit(source: ShotKeyframe) {
if (assetBlocked.value || source.status !== 'completed' || source.source === 'provider_variant') return
editSource.value = source
editOpen.value = true
}
/** 单镜头动作按钮反映本镜头操作,不把整个项目锁显示为所有按钮加载。 */
const promptLoading = computed(() => {
const op = getOperation(props.projectId)
return op.pending && op.label === `生成镜头 ${props.shot.shotNo} 视频提示词`
})
/** 离开镜头后忽略迟到的手动读取反馈。 */
let disposed = false
onScopeDispose(() => {
@@ -76,6 +104,15 @@ const props = defineProps<{
/** 通知父页面刷新及观察已启动的质量任务。 */
const emit = defineEmits<{ changed: []; qualityStarted: [executionId: string] }>()
const key = computed(() => props.shot.shotId)
watch(
() => props.shot.shotId,
() => {
editOpen.value = false
editSource.value = null
motionOpen.value = false
}
)
/** 仅当前镜头存在后台首帧或视频任务时临时轮询,终态后自动停止。 */
let query!: ReturnType<
typeof usePolling<{
@@ -381,13 +418,16 @@ async function setPrimaryKeyframe() {
if (
assetBlocked.value ||
!keyframeId ||
keyframePassed(keyframeId) !== true ||
keyframes.value.find(item => item.id === keyframeId)?.source === 'provider_variant'
)
return
const shotId = props.shot.shotId
confirmingKeyframe.value = ''
await runOperation(props.projectId, `设置镜头 ${props.shot.shotNo} 主首帧`, async () => {
// 晋升前重新读取持久化质量结论,刷新页面后也认可真实历史通过。
const review = await qualityApi.keyframeQualityReview(shotId, keyframeId)
if (!['passed', 'manual_accepted'].includes(review.effectiveQualityStatus))
throw new Error('此候选尚未通过当前质量要求,请先完成质量检查或有效人工复核。')
const result = await productionApi.setPrimaryKeyframe(shotId, keyframeId)
if (!result || result.id !== keyframeId || !result.isPrimary || result.status !== 'completed')
throw new Error('接口未确认主首帧切换。')
@@ -477,9 +517,9 @@ defineExpose({ inspectSpecs, inspecting })
<template>
<section class="production-assets">
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
>{{ query.error.value }} 当前保留上次成功读取的资产,操作已暂停。
</NAlert>
</ContextNotice>
<div class="production-stage">
<div class="production-stage-heading">
@@ -494,7 +534,10 @@ defineExpose({ inspectSpecs, inspecting })
/>
</div>
<div v-if="savedPrompt?.videoPrompt" class="surface-inset mt-4 p-4" aria-label="本镜视频提示词">
<p class="text-xs font-medium">本镜视频提示词</p>
<div class="flex flex-wrap items-center justify-between gap-3">
<p class="text-xs font-medium">本镜视频提示词</p>
<NButton text size="small" @click="motionOpen = true">查看动作与视线</NButton>
</div>
<p class="mt-3 whitespace-pre-wrap break-words text-sm leading-6">{{ savedPrompt.videoPrompt }}</p>
<template v-if="savedPrompt.negativePrompt">
<p class="mt-4 text-xs font-medium">负向提示词</p>
@@ -510,13 +553,20 @@ defineExpose({ inspectSpecs, inspecting })
正在读取视频提示词…
</p>
<p v-else-if="!promptQuery.error.value" class="mt-4 text-xs text-muted">尚未生成本镜视频提示词。</p>
<NAlert v-if="promptQuery.error.value" role="alert" type="warning" :show-icon="false" class="mt-4 text-xs">
<ContextNotice
v-if="promptQuery.error.value"
role="alert"
type="warning"
:show-icon="false"
class="mt-4 text-xs"
>
提示词读取失败:{{ promptQuery.error.value }}
<NButton text size="small" @click="promptQuery.refresh">重试</NButton>
</NAlert>
</ContextNotice>
<div class="production-stage-actions">
<ConfirmAction
:label="promptReadiness?.status === 'skipped' ? '重新生成本镜提示词' : '生成本镜提示词'"
:loading="promptLoading"
:disabled="!canGeneratePrompt"
acknowledgement
:description="
@@ -548,27 +598,37 @@ defineExpose({ inspectSpecs, inspecting })
:shot-id="shot.shotId"
:review-revision="reviewRevision"
:item="currentKeyframe"
:editing="
editSource?.id === currentKeyframe.id &&
isOperationRunning(getOperation(projectId), `编辑镜头 ${shot.shotId} 首帧`)
"
:shot-no="shot.shotNo"
:stale="keyframeStale"
:blocked="assetBlocked"
:validation-passed="keyframePassed(currentKeyframe.id)"
:confirming="false"
@quality="openQuality('keyframe', currentKeyframe.id)"
@edit="openEdit(currentKeyframe)"
@history="openKeyframeHistory(currentKeyframe.id)"
/>
</div>
<p v-else class="mt-4 text-xs text-muted">尚无已确认主首帧。请生成候选,完成质量检查后再设为主首帧。</p>
<NAlert
<ContextNotice
v-if="currentKeyframe && keyframePassed(currentKeyframe.id) === false"
type="error"
:show-icon="false"
class="mt-3 text-xs"
>
当前主首帧在本次质量检查中未通过,已阻止继续生成视频。请从候选中选择质量通过的图片。
</NAlert>
<NAlert v-if="query.data.value?.qualityStatusError" type="warning" :show-icon="false" class="mt-3 text-xs">
</ContextNotice>
<ContextNotice
v-if="query.data.value?.qualityStatusError"
type="warning"
:show-icon="false"
class="mt-3 text-xs"
>
视频质量链状态暂时无法读取;视频资产仍可查看。请稍后刷新。
</NAlert>
</ContextNotice>
<div class="production-stage-actions">
<NButton :disabled="!episodeNo || !canGenerateKeyframe" @click="openShotKeyframeQuality"
>本镜首帧质量重跑</NButton
@@ -580,7 +640,10 @@ defineExpose({ inspectSpecs, inspecting })
<NTag v-if="activeKeyframeCount" size="small" type="warning" :bordered="false" role="status">
首帧任务进行中({{ activeKeyframeCount }})
</NTag>
<NButton :disabled="!canGenerateKeyframe" @click="keyframeOpen = true"
<NButton
:loading="isOperationRunning(getOperation(projectId), `生成镜头 ${shot.shotNo} 首帧`)"
:disabled="!canGenerateKeyframe"
@click="keyframeOpen = true"
><ImagePlus :size="14" />{{
keyframeStale ? '生成替代候选' : currentKeyframe ? '再生成一张候选' : '生成首帧候选'
}}</NButton
@@ -752,9 +815,9 @@ defineExpose({ inspectSpecs, inspecting })
</div>
</div>
</section>
<NAlert v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-4 text-xs">
<ContextNotice v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-4 text-xs">
生成模型目录读取失败:{{ generationCatalogError }}
</NAlert>
</ContextNotice>
<div class="production-stage-actions">
<ConfirmAction
:label="
@@ -779,7 +842,7 @@ defineExpose({ inspectSpecs, inspecting })
</div>
<AppDialog v-model:open="specsOpen" title="生成设置与模型限制" description="查看不收费。" wide>
<NAlert v-if="specError" role="alert" type="error" :show-icon="false" class="mt-4">{{ specError }}</NAlert>
<FeedbackMessage v-if="specError" :message="specError" />
<p v-if="inspecting" role="status" class="mt-4 text-xs text-muted">正在读取生成规格…</p>
<ModelCapabilities :shot-id="shot.shotId" />
<ProviderInputInspector :shot-id="shot.shotId" />
@@ -811,6 +874,26 @@ defineExpose({ inspectSpecs, inspecting })
></NCollapse
>
</AppDialog>
<AppDialog v-model:open="motionOpen" title="镜头动作与视线" wide>
<div v-if="motionOpen" class="space-y-6">
<MotionPlanPanel :key="shot.shotId" :shot-id="shot.shotId" :revision="savedPrompt?.updatedAt" />
<SpatialBindingsPanel
:key="shot.shotId"
:project-id="projectId"
:shot-id="shot.shotId"
:disabled="assetBlocked"
@changed="refreshAll"
/>
</div>
</AppDialog>
<KeyframeEditDialog
v-model:open="editOpen"
:project-id="projectId"
:shot-id="shot.shotId"
:source="editSource"
:disabled="assetBlocked"
@started="emit('qualityStarted', $event)"
/>
<QualityDialog
v-model:open="qualityOpen"
:project-id="projectId"
@@ -822,7 +905,7 @@ defineExpose({ inspectSpecs, inspecting })
<AppDialog
v-model:open="candidatesOpen"
title="首帧候选管理"
description="先完成质量检查;只有本会话校验通过的候选才能设为主首帧。"
description="读取已保存质量结论;通过质量检查或完成有效人工复核的候选可以设为主首帧。"
:width="keyframeCandidatesWidth"
>
<!-- 候选图片和对应的人工复核入口按相同候选 ID 分组。 -->
@@ -832,12 +915,17 @@ defineExpose({ inspectSpecs, inspecting })
:shot-id="shot.shotId"
:review-revision="reviewRevision"
:item="item"
:editing="
editSource?.id === item.id &&
isOperationRunning(getOperation(projectId), `编辑镜头 ${shot.shotId} 首帧`)
"
:shot-no="shot.shotNo"
:stale="false"
:blocked="assetBlocked"
:validation-passed="keyframePassed(item.id)"
:confirming="confirmingKeyframe === item.id"
@quality="openQuality('keyframe', item.id)"
@edit="openEdit(item)"
@history="openKeyframeHistory(item.id)"
@select="confirmingKeyframe = item.id"
@confirm="setPrimaryKeyframe"
@@ -1,7 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { productionIssueText } from '../production-messages'
import { computed } from 'vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
import { referenceLocation, referenceTargets } from '../asset-links'
import { useShotReferences } from '../useShotReferences'
import type { ProductionIssue } from '../types'
@@ -22,7 +24,7 @@ const precise = computed(() =>
)
</script>
<template>
<NAlert
<ContextNotice
role="alert"
type="warning"
:show-icon="false"
@@ -57,5 +59,5 @@ const precise = computed(() =>
<div v-if="references.error.value" class="mt-2 text-danger">
{{ references.error.value }} <NButton text size="small" @click="references.refresh">重试定位</NButton>
</div>
</NAlert>
</ContextNotice>
</template>
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NButton, NTag } from 'naive-ui'
import { NButton, NTag } from 'naive-ui'
import { AssetOpenLink, StatusBadge } from '../../../components/ui'
import { mediaAssetUrl } from '../../../lib/assets'
import { formatDate } from '../../../lib/format'
@@ -78,9 +82,7 @@ const canSelect = computed(
<p v-if="previousValidation !== null" class="mt-2 text-[11px] text-muted">
{{ previousValidation ? '此前画面检查通过' : '此前画面检查未通过' }}
</p>
<NAlert v-if="item.error" role="alert" type="error" :show-icon="false" class="mt-3">{{
item.error
}}</NAlert>
<FeedbackMessage v-if="item.error" :message="item.error" />
<p class="mt-3 break-all text-[10px] text-muted">
{{ item.provider }} · {{ item.model }} · {{ formatDate(item.createdAt) }}
</p>
@@ -94,7 +96,7 @@ const canSelect = computed(
</NButton>
</div>
<!-- 以下是候选切换确认模块,不更改已有费用确认与质量检查流程 -->
<NAlert v-if="confirming" type="info" :show-icon="false" class="mt-3 text-xs">
<ContextNotice v-if="confirming" type="info" :show-icon="false" class="mt-3 text-xs">
<p>确认把此候选设为当前镜头主视频?旧成片仍会保留。</p>
<div class="mt-2 flex gap-3">
<NButton :disabled="blocked || !canSelect" type="primary" @click="emit('confirm')"
@@ -102,7 +104,7 @@ const canSelect = computed(
>
<NButton text size="small" @click="emit('cancel')">取消</NButton>
</div>
</NAlert>
</ContextNotice>
</div>
</article>
</template>
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NTag } from 'naive-ui'
import { NTag } from 'naive-ui'
import { useQuery } from '../../../composables/useQuery'
import { formatDate } from '../../../lib/format'
import { videoDiagnosticsApi } from '../diagnostics-api'
@@ -67,10 +69,12 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
<template>
<!-- 以下是弹窗中的视频已有检查记录模块,无需再次点击查看 -->
<section class="workspace-panel text-xs leading-6" aria-label="当前视频质量记录">
<NAlert v-if="stale" type="warning" :show-icon="false" class="mb-3">
<ContextNotice v-if="stale" type="warning" :show-icon="false" class="mb-3">
此视频需要更新:首帧或参考图已变化。此前画面检查结果仅供参考,请重新生成视频。
</NAlert>
<NAlert v-if="query.error.value" type="error" :show-icon="false" role="alert">{{ query.error.value }}</NAlert>
</ContextNotice>
<ContextNotice v-if="query.error.value" type="error" :show-icon="false" role="alert">{{
query.error.value
}}</ContextNotice>
<p v-if="query.loading.value" class="text-muted" role="status">正在读取质量记录…</p>
<template v-else-if="detail">
<p v-if="currentRecord" class="font-semibold">
@@ -121,7 +125,7 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
</li>
</ul>
</article>
<NAlert
<ContextNotice
v-if="analysis"
class="mt-3"
:type="analysis.requiresManualReview ? 'warning' : 'info'"
@@ -132,7 +136,7 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
<p v-if="analysis.recommendedRollback.length" class="mt-1">
建议检查:{{ analysis.recommendedRollback.map(rollbackLabel).join('、') }}
</p>
</NAlert>
</ContextNotice>
<article v-for="issue in analysis?.persistentIssues ?? []" :key="issue.type" class="mt-3">
<strong>{{ issue.type }} · 出现 {{ issue.occurrences }} 次</strong>
<p>{{ issue.suspectedCause }}</p>
@@ -0,0 +1,67 @@
import { request } from '../../lib/http'
import type { GenerationOptions } from '../generation-config/types'
import type { WorkflowExecutionStart } from '../workflows/execution.types'
/** 人工确认的相对眼位;只提交用户选择,不能从画面区域猜测。 */
export interface RelativeGazeGeometry {
subjectRef: string
targetDescription: string
horizontal: 'left' | 'right' | 'center' | 'unknown'
vertical: 'above' | 'below' | 'level' | 'unknown'
targetFocusRegion?: 'upper' | 'center' | 'lower' | 'whole'
gazeAlignmentStrategy?: 'eyes_only' | 'head_assisted' | 'upper_body_assisted'
source: 'manual'
}
/** 本次首帧编辑参数,不修改项目默认配置。 */
export interface KeyframeEditInput {
editInstruction: string
editMode: 'subject_only' | 'composition_assisted'
allowBackgroundDeemphasis?: boolean
relativeGazeGeometry?: RelativeGazeGeometry[]
provider?: string
generationOptions?: GenerationOptions
}
/** 后端编译的真实编辑输入。 */
export interface KeyframeEditPreview {
shotId: string
sourceKeyframeId: string
provider: string
model: string
editInstruction: string
editMode: KeyframeEditInput['editMode']
sourceImageSlots: number
maxInputImages: number | null
selected: Array<{ subjectRef: string; role: string; imageId: string }>
omitted: Array<{ subjectRef: string; role: string; imageId: string }>
}
/** 预览和后台编辑使用完全相同的业务参数。 */
export const keyframeEditApi = {
/**
* 只读编译实际编辑指令和参考图名额。
* @param shotId 正式镜头 ID
* @param sourceId 当前镜头有效源图 ID
* @param input 本次人工确认的编辑参数
* @param signal 查询取消信号
* @returns 实际模型输入
*/
preview: (shotId: string, sourceId: string, input: KeyframeEditInput, signal?: AbortSignal) =>
request<KeyframeEditPreview>(
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(sourceId)}/edit/preview`,
{ method: 'POST', body: input, signal, timeoutMs: 0 }
),
/**
* 启动持久化编辑任务,结果由后台真实终态确认。
* @param shotId 正式镜头 ID
* @param sourceId 已核对的编辑源图 ID
* @param input 已预览并确认费用的参数
* @returns 后台首帧质量任务观察句柄
*/
start: (shotId: string, sourceId: string, input: KeyframeEditInput) =>
request<WorkflowExecutionStart & { projectId: string; shotId: string; sourceKeyframeId: string }>(
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(sourceId)}/edit`,
{ method: 'POST', body: input, timeoutMs: 0 }
)
}
+1 -1
View File
@@ -36,7 +36,7 @@ export interface VisualValidation {
issues: QualityIssue[]
}
/** 首帧校验回执;当前后端没有独立读取校验历史的 GET。 */
/** 首帧校验回执;历史记录通过独立 validations GET 读取。 */
export interface KeyframeValidation extends VisualValidation {
shotId: string
keyframeId: string
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, reactive, ref } from 'vue'
import { NAlert, NButton, NFormItem, NInput, NPopconfirm, NSelect, NTag, NTooltip } from 'naive-ui'
import { NButton, NFormItem, NInput, NPopconfirm, NSelect, NTag, NTooltip } from 'naive-ui'
import { Search, Trash2, Upload } from '@lucide/vue'
import { AppDialog, AssetImage, EmptyState } from '../../components/ui'
import AppForm from '../../components/ui/AppForm.vue'
@@ -236,14 +240,14 @@ async function removeAsset() {
</div>
</template>
<NAlert v-if="fileError" type="error" :show-icon="false" class="mb-4">{{ fileError }}</NAlert>
<NAlert v-if="query.error.value" type="error" :show-icon="false" class="mb-4">
<FeedbackMessage v-if="fileError" :message="fileError" />
<ContextNotice v-if="query.error.value" type="error" :show-icon="false" class="mb-4">
{{ query.error.value }}<NButton text class="ml-3" @click="query.refresh">重新连接</NButton>
</NAlert>
<NAlert v-if="projectsQuery.error.value" type="warning" :show-icon="false" class="mb-4">
</ContextNotice>
<ContextNotice v-if="projectsQuery.error.value" type="warning" :show-icon="false" class="mb-4">
剧本列表读取失败,暂时不能上传新图片。
<NButton text class="ml-3" @click="projectsQuery.refresh">重新读取</NButton>
</NAlert>
</ContextNotice>
<div class="asset-library-filters">
<NInput
@@ -324,7 +328,7 @@ async function removeAsset() {
description="选择所属剧本并确认名称和分类,提交后仍停留在当前资产库。"
:busy="busy"
>
<NAlert v-if="actionError" type="error" :show-icon="false" class="mt-5">{{ actionError }}</NAlert>
<FeedbackMessage v-if="actionError" :message="actionError" />
<AppForm :model="uploadForm" :rules="formRules" :disabled="busy" class="mt-5" @submit="uploadAsset">
<p class="mb-4 text-sm">{{ selectedFile?.name }} · {{ formatBytes(selectedFile?.size ?? 0) }}</p>
<NFormItem path="projectId" label="所属剧本">
@@ -348,7 +352,7 @@ async function removeAsset() {
:busy="busy"
wide
>
<NAlert v-if="actionError" type="error" :show-icon="false" class="mt-5">{{ actionError }}</NAlert>
<FeedbackMessage v-if="actionError" :message="actionError" />
<AppForm :model="editForm" :rules="formRules" :disabled="busy" class="mt-5" @submit="updateAsset">
<div v-if="selectedAsset" class="asset-management-layout">
<AssetImage
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, reactive, ref } from 'vue'
import { NAlert, NButton, NFormItem, NInput, NPopconfirm, NSelect, NTag } from 'naive-ui'
import { NButton, NFormItem, NInput, NPopconfirm, NSelect, NTag } from 'naive-ui'
import { Pencil, Search, Trash2, Upload } from '@lucide/vue'
import { AppDialog, AssetImage, EmptyState } from '../../components/ui'
import AppForm from '../../components/ui/AppForm.vue'
@@ -191,10 +195,10 @@ async function removeAsset(asset: ProjectAsset) {
</div>
</template>
<NAlert v-if="fileError" type="error" :show-icon="false" class="mb-3">{{ fileError }}</NAlert>
<NAlert v-if="query.error.value" type="error" :show-icon="false" class="mb-3">
<FeedbackMessage v-if="fileError" :message="fileError" />
<ContextNotice v-if="query.error.value" type="error" :show-icon="false" class="mb-3">
{{ query.error.value }} 当前保留上次成功读取的素材,写操作已暂停。
</NAlert>
</ContextNotice>
<div class="asset-filter-bar">
<NInput
+8 -28
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, h, inject, onScopeDispose, provide, ref, watch, watchEffect } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { NScrollbar, NAlert, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
import type { MessageReactive } from 'naive-ui'
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
import { EmptyState } from '../../components/ui'
import { projectContextKey, useProjectData } from './context'
import { getOperation } from '../workflows/operations'
@@ -155,34 +156,11 @@ const operationGuide = computed<OperationGuide | null>(() => {
/** 操作结果只在当前项目收到新响应后通知,不在进入工作区时重放旧提示。 */
const actionMessage = useActionMessage()
/** 当前请求的加载消息,完成或离开工作区后销毁。 */
let pendingMessage: MessageReactive | null = null
/** 新操作用短消息反馈,页面切换不重放后台任务提示。 */
watch(
() => [id.value, currentSection.value, operation.value.pending, operation.value.label] as const,
([projectId, section, pending, label], [previousId, previousSection, previousPending, previousLabel]) => {
pendingMessage?.destroy()
pendingMessage = null
if (projectId !== previousId || section !== previousSection || !pending) return
if (previousPending && label === previousLabel) return
pendingMessage =
actionMessage?.loading(`${label || '后台任务执行中'},请稍候…`, {
duration: section === 'subject-identity' ? 0 : 4000,
closable: true
}) ?? null
}
)
/** 关闭页面时清理未完成请求的加载消息。 */
onScopeDispose(() => pendingMessage?.destroy())
/** 只通知仍在当前项目的真实新结果,不把任务提交当作素材生成完成。 */
watch(
() => [id.value, operation.value.error, operation.value.notice] as const,
([projectId, error, notice], [previousProject, previousError, previousNotice]) => {
if (projectId !== previousProject) return
if ((error && error !== previousError) || (notice && notice !== previousNotice)) {
pendingMessage?.destroy()
pendingMessage = null
}
if (error && error !== previousError) {
const guide = operationGuide.value
const content =
@@ -220,7 +198,9 @@ watch(
actionMessage?.success('身份文本已生成并保存。', { duration: 3000, closable: true })
else if (operation.value.label === '保存主体身份')
actionMessage?.success('主体身份已保存。', { duration: 3000, closable: true })
else if (/生成|提交/.test(operation.value.label))
else if (/刷新|读取|查询|预览/.test(operation.value.label)) {
// 成功的只读刷新由当前位置恢复内容反馈,不额外弹成功消息。
} else if (/生成|提交/.test(operation.value.label))
actionMessage?.info('任务已提交,完成后会显示结果。', { duration: 4000 })
else actionMessage?.success('操作已完成。', { duration: 3000 })
// 身份页已消费的反馈立即清除,切换主体或其它工作区都不会遗留旧横幅。
@@ -284,11 +264,11 @@ onScopeDispose(() => {
</NPageHeader>
</header>
<NScrollbar v-if="context.error.value" class="project-notices" content-class="project-notices-content">
<NAlert v-if="context.error.value" type="error" :show-icon="false"
<ContextNotice v-if="context.error.value" type="error" :show-icon="false"
>{{ context.error.value }}<span v-if="context.project.value"> 当前保留上次成功读取的数据。</span>
<NButton text class="ml-3" :loading="context.loading.value" @click="context.refresh"
>重试读取</NButton
></NAlert
></ContextNotice
>
</NScrollbar>
<!-- 以下是当前项目图片与视频配置弹窗模块 -->
+4 -3
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, h, nextTick, ref, watch } from 'vue'
import { RouterLink, useRouter } from 'vue-router'
import {
NAlert,
NButton,
NDataTable,
NInput,
@@ -176,8 +177,8 @@ function clearFilters() {
</div>
</div>
</template>
<NAlert v-if="query.error.value" type="error" :show-icon="false"
>{{ query.error.value }}<NButton text class="ml-3" @click="query.refresh">重新连接</NButton></NAlert
<ContextNotice v-if="query.error.value" type="error" :show-icon="false"
>{{ query.error.value }}<NButton text class="ml-3" @click="query.refresh">重新连接</NButton></ContextNotice
>
<EditProjectDialog v-model:open="editOpen" :project="managedProject" @changed="query.refresh" />
<DeleteProjectDialog v-model:open="deleteOpen" :project="managedProject" @deleted="query.refresh" />
@@ -1,8 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
import { requiredTextRule, integerRule } from '../../../lib/form-rules'
import { NAlert, NButton, NInput, NInputNumber } from 'naive-ui'
import { NButton, NInput, NInputNumber } from 'naive-ui'
import { reactive, ref } from 'vue'
import { ArrowRight, LoaderCircle, Plus } from '@lucide/vue'
import { AppDialog } from '../../../components/ui'
@@ -118,7 +120,7 @@ const rules = {
<p class="text-xs leading-5 text-muted">
建议先用 1 集验证生成效果。生成会实际调用后端模型,产生相应费用。
</p>
<NAlert v-if="error" role="alert" type="error" :show-icon="false" class=" ">{{ error }}</NAlert>
<FeedbackMessage v-if="error" :message="error" />
</AppForm>
<template #footer>
<NButton :disabled="busy" @click="open = false">取消</NButton>
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, reactive, ref, watch } from 'vue'
import { NAlert, NButton, NInput } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { errorMessage } from '../../../lib/http'
import { projectsApi } from '../api'
@@ -52,17 +56,19 @@ async function remove() {
</script>
<template>
<AppDialog v-model:open="open" :title="`永久删除 · ${expected}`" description="删除后无法恢复。">
<NAlert type="error" :show-icon="false" class="mt-4">
<ContextNotice type="error" :show-icon="false" class="mt-4">
会永久删除剧本、主体、身份、形态、分镜、首帧、视频、工作流记录,以及本地 Storage
中属于该项目的图片、视频和上传素材。
</NAlert>
<NAlert v-if="readinessPending" type="info" :show-icon="false" class="mt-3">正在检查项目后台任务…</NAlert>
<NAlert v-else-if="readiness && !readiness.canDelete" type="warning" :show-icon="false" class="mt-3">
</ContextNotice>
<ContextNotice v-if="readinessPending" type="info" :show-icon="false" class="mt-3"
>正在检查项目后台任务…</ContextNotice
>
<ContextNotice v-else-if="readiness && !readiness.canDelete" type="warning" :show-icon="false" class="mt-3">
当前有
{{ readiness.totalActiveTasks }}
个后台任务正在执行,暂不能删除。请等待图片、首帧、视频或工作流任务结束后再试。
</NAlert>
<NAlert v-if="state.error" type="error" :show-icon="false" class="mt-3">{{ state.error }}</NAlert>
</ContextNotice>
<FeedbackMessage v-if="state.error" :message="state.error" />
<p class="mt-5 text-xs">
请输入 <strong>{{ expected }}</strong> 确认删除:
</p>
@@ -1,12 +1,14 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { computed, reactive, watch } from 'vue'
import { NAlert, NButton, NInput } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { errorMessage } from '../../../lib/http'
import { projectsApi } from '../api'
import type { Project } from '../types'
/** 编辑项目基础信息;不会触发已有剧本或 Production 资产重生成。 */
/** 编辑项目基础信息;不会触发已有剧本或制作资产重生成。 */
const props = defineProps<{ project: Project | null }>()
const open = defineModel<boolean>('open', { default: false })
const emit = defineEmits<{ changed: [] }>()
@@ -61,9 +63,9 @@ async function save() {
<AppDialog
v-model:open="open"
:title="`编辑项目 · ${project?.title || project?.topic || ''}`"
description="仅更新项目基础信息,不自动重生成剧本或 Production 资产。"
description="仅更新项目基础信息,不自动重生成剧本或制作资产。"
>
<NAlert v-if="state.error" type="error" :show-icon="false" class="mt-4">{{ state.error }}</NAlert>
<FeedbackMessage v-if="state.error" :message="state.error" />
<section class="dialog-form-stack">
<label class="block text-xs">项目名称<NInput v-model:value="form.title" class="mt-2" /></label>
<label class="block text-xs"
+81 -20
View File
@@ -1,11 +1,15 @@
<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'
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import ActionMenu from '../../components/ui/ActionMenu.vue'
import WorkspaceTools from '../../components/ui/WorkspaceTools.vue'
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NSelect, NTab, NTabs } from 'naive-ui'
import { NScrollbar, NButton, NCheckbox, NInputNumber, NProgress, NSelect, NTab, NTabs } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import { ArrowLeft } from '@lucide/vue'
import { EmptyState } from '../../components/ui'
@@ -13,6 +17,11 @@ import { downloadText } from '../../lib/format'
import ConfirmAction from '../workflows/ConfirmAction.vue'
import GenerationReceipt from './components/GenerationReceipt.vue'
import ShotDesign from './components/ShotDesign.vue'
import MotionPlanPanel from './components/MotionPlanPanel.vue'
import MotionAuditPanel from './components/MotionAuditPanel.vue'
import SpatialBindingsPanel from './components/SpatialBindingsPanel.vue'
import type { MotionPlanAudit } from './motion.types'
import { useActionMessage } from '../../components/ui/useActionMessage'
import ShotTools from './components/ShotTools.vue'
import BeatShotDirectory from './components/BeatShotDirectory.vue'
import SubjectCoverageAudit from './components/SubjectCoverageAudit.vue'
@@ -22,6 +31,22 @@ import { useStoryboard } from './useStoryboard'
import { storyboardApi, type StoryboardDurationAudit } from './api'
const detailTab = ref('design')
/** 动作审计只能定位当前项目正式列表中的镜头。 */
const feedback = useActionMessage()
/**
* 按后端正式镜头坐标定位动作预警。
* @param item 后端返回的真实镜头及剧集
*/
function locateMotion(item: MotionPlanAudit['items'][number]) {
if (!episodeOptions.value.some(episode => episode.episodeNo === item.episodeNo)) {
feedback?.warning('审计中的剧集已不在当前项目列表,请刷新分镜。')
return
}
selectedEpisode.value = item.episodeNo
selectedShot.value = item.shotId
detailTab.value = 'motion'
toolsOpen.value = false
}
/** 分镜工作区按单集查看正式数据,生成配置与镜头检查分开。 */
const {
@@ -167,10 +192,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
<template>
<WorkspacePage split compact mobile-scroll class="storyboard-workspace-page compact-shot-workspace">
<template #notice>
<NAlert v-if="episodeSourceUnavailable" type="info" :show-icon="false">
<ContextNotice v-if="episodeSourceUnavailable" type="info" :show-icon="false">
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
</NAlert>
<NAlert v-if="currentEpisodeDurationIssues.length" type="warning" :show-icon="false">
</ContextNotice>
<ContextNotice v-if="currentEpisodeDurationIssues.length" type="warning" :show-icon="false">
<div class="text-sm font-medium">
本集有 {{ currentEpisodeDurationIssues.length }} 条分镜时长建议(不阻断生成)
</div>
@@ -178,7 +203,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
Beat {{ issue.beatNo }}<span v-if="issue.shotNo"> · Shot {{ issue.shotNo }}</span
>:{{ issue.message }}
</div>
</NAlert>
</ContextNotice>
<span v-if="durationAuditError" class="text-xs text-muted">{{ durationAuditError }}</span>
</template>
<template #header
@@ -213,6 +238,8 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</div>
<WorkspaceTools
:pending="operation.pending"
:pending-label="operation.label"
v-model:open="toolsOpen"
title="分镜生成配置与回执"
label="生成与恢复"
@@ -290,9 +317,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
<div class="overview-content workspace-section-stack">
<!-- 以下是零费用主体引用覆盖检查模块 -->
<SubjectCoverageAudit :project-id="id" @locate="locateCoverageIssue" />
<NAlert v-if="auditLocationError" type="warning" :show-icon="false">{{
<MotionAuditPanel :project-id="id" @locate="locateMotion" />
<ContextNotice v-if="auditLocationError" type="warning" :show-icon="false">{{
auditLocationError
}}</NAlert>
}}</ContextNotice>
<h3 class="mb-3 text-sm font-semibold">生成与恢复</h3>
<div class="generation-row">
<div>
@@ -302,15 +330,21 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
<p class="mt-2 text-xs leading-6 text-muted">
只重新拆解当前选择的第
{{ episodeNo }}
集,其它剧集不受影响。新镜头会替换旧镜头,并清空本集已有的导演设计、即时状态、首帧与视频结果。
集,其他剧集不受影响。新镜头会替换旧镜头,并清空本集已有的导演设计、即时状态、首帧与视频结果。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:loading="
isOperationRunning(operation, `生成第 ${episodeNo} 集镜头`) ||
(!!executions[0]?.observer.active.value &&
executions[0]?.observer.query.data.value?.metadata?.episodeNo ===
episodeNo)
"
:label="`重生成第 ${episodeNo} 集镜头`"
:disabled="!allowed['shots-current']"
acknowledgement
:description="`将删除并重建第 ${episodeNo} 集的正式镜头。该集已有导演设计、即时状态、首帧、提示词和视频结果会随旧镜头一并失效,且无法撤销;其它剧集保持不变。`"
:description="`将删除并重建第 ${episodeNo} 集的正式镜头。该集已有导演设计、即时状态、首帧、提示词和视频结果会随旧镜头一并失效,且无法撤销;其他剧集保持不变。`"
@confirm="run('shots-current')"
/>
</div>
@@ -329,6 +363,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:loading="
isOperationRunning(operation, '生成项目导演设计') ||
!!executions[1]?.observer.active.value
"
:label="force ? '重生成全部导演设计' : '补齐项目导演设计'"
:disabled="!allowed['direction-all']"
acknowledgement
@@ -352,6 +390,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:loading="
isOperationRunning(operation, '生成项目即时状态') ||
!!executions[2]?.observer.active.value
"
:label="force ? '重生成全部即时状态' : '补齐项目即时状态'"
:disabled="!allowed['visual-all']"
acknowledgement
@@ -377,6 +419,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
>。
</p>
<ConfirmAction
:loading="
isOperationRunning(operation, '生成项目视频提示词') ||
!!executions[3]?.observer.active.value
"
:label="force ? '重生成全部视频提示词' : '补齐项目视频提示词'"
:disabled="!allowed.prompts"
acknowledgement
@@ -420,7 +466,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
"
class="workspace-feedback"
>
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
>{{ query.error.value }} 当前保留上次成功读取的数据,暂停生成操作。<NButton
@click="query.refresh"
text
@@ -428,34 +474,34 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
class="ml-3"
>
重试查询
</NButton></NAlert
><NAlert
</NButton></ContextNotice
><ContextNotice
v-if="data && data.directions.shotCount && !productionReady"
type="warning"
:show-icon="false"
class="mt-4"
>
<strong>Production 前置设计未完成。</strong>
<strong>镜头生产前置设计未完成。</strong>
当前导演设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},即时视觉状态
{{ data.visualStates.visualStateCount }}/{{
data.visualStates.shotCount
}}。请先补齐后再进入镜头生产,避免 后续镜头制作无法开始。 </NAlert
><NAlert
}}。请先补齐后再进入镜头生产,避免 后续镜头制作受阻。 </ContextNotice
><ContextNotice
v-if="!prerequisites.directionEpisode || !prerequisites.visualEpisode"
type="info"
:show-icon="false"
class="mt-4"
>
最新 Breakdown
缺少本集生成所需的镜头、主体或形态数据。已保存设计仍可查看;请先在拆解页完成或恢复相应阶段。 </NAlert
><NAlert
最新剧本拆解
缺少本集生成所需的镜头、主体或形态数据。已保存设计仍可查看;请先在拆解页完成或恢复相应阶段。 </ContextNotice
><ContextNotice
v-else-if="data && !directionComplete && data.directions.shotCount"
type="info"
:show-icon="false"
class="mt-4"
>
本集导演设计尚未补齐,请先完成第 01 步,再生成本集即时状态。
</NAlert>
</ContextNotice>
</NScrollbar>
<div v-if="!data && query.loading.value" class="panel p-8 text-sm text-muted" role="status">
正在读取正式分镜数据……
@@ -503,8 +549,23 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</header>
<div>
<NTabs v-model:value="detailTab" type="line" size="small" aria-label="镜头详情"
><NTab name="design">设计与状态</NTab><NTab name="tools">参考图与生成规格</NTab></NTabs
><NTab name="design">设计与状态</NTab><NTab name="tools">参考图与提示词</NTab
><NTab name="motion">动作与视线</NTab></NTabs
>
<div v-if="detailTab === 'motion'" class="pt-5 space-y-6">
<MotionPlanPanel
:key="shot.shotId"
:shot-id="shot.shotId"
:revision="session.prompts[shot.shotId]?.updatedAt"
/>
<SpatialBindingsPanel
:key="shot.shotId"
:project-id="id"
:shot-id="shot.shotId"
:disabled="blocked"
@changed="query.refresh"
/>
</div>
<div v-if="detailTab === 'design'" class="pt-6"><ShotDesign :shot="shot" /></div>
<div v-if="detailTab === 'tools'" class="pt-6">
<ShotTools
@@ -1,5 +1,7 @@
<script setup lang="ts">
import { NScrollbar, NAlert, NButton, NTable } from 'naive-ui'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NScrollbar, NButton, NTable } from 'naive-ui'
import { computed } from 'vue'
import { Download } from '@lucide/vue'
import { downloadText } from '../../../lib/format'
@@ -25,9 +27,9 @@ function exportReceipt() {
<h3 class="text-sm font-semibold">{{ receipt.title }} · 本次回执</h3>
<NButton @click="exportReceipt" text size="small"><Download :size="13" />导出诊断</NButton>
</div>
<NAlert v-if="failed" role="alert" type="error" :show-icon="false" class="mt-3">
<ContextNotice v-if="failed" role="alert" type="error" :show-icon="false" class="mt-3">
本次存在失败、校验未通过或未保存项。关闭“批量覆盖已有结果”后再补齐,可跳过已完整保存项。
</NAlert>
</ContextNotice>
<template v-if="receipt.kind === 'shots'">
<p class="my-4 text-xs text-muted">
第 {{ receipt.result.episodeNo }} 集 · {{ receipt.result.storyboardShotSummary.beatCount }} 个 Beat ·
@@ -35,9 +37,14 @@ function exportReceipt() {
{{ receipt.result.storyboardShotSummary.totalDurationSeconds }} 秒 · 形态绑定覆盖率
{{ Math.round(receipt.result.storyboardShotSummary.bindingCoverage * 100) }}%
</p>
<NAlert v-if="receipt.result.storyboardShotValidation.valid" type="success" :show-icon="false" class="mt-3">
<ContextNotice
v-if="receipt.result.storyboardShotValidation.valid"
type="success"
:show-icon="false"
class="mt-3"
>
本集新镜头已保存。该集下游结果已随旧镜头清除,请依次重新生成导演设计、即时状态、首帧、提示词和视频。
</NAlert>
</ContextNotice>
<ul v-else class="mt-3 space-y-2 text-xs text-danger">
<li v-for="(issue, index) in receipt.result.storyboardShotValidation.issues" :key="index">
Beat {{ issue.beatNo ?? '—' }} / Shot {{ issue.shotNo ?? '—' }}:{{ issue.message }}
@@ -0,0 +1,95 @@
<script setup lang="ts">
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NButton, NTag } from 'naive-ui'
import { motionApi } from '../motion-api'
import type { MotionPlanAudit } from '../motion.types'
import { errorMessage } from '../../../lib/http'
import { useFeedbackMessage } from '../../../composables/useFeedbackMessage'
import IssueHint from '../../../components/ui/IssueHint.vue'
/** 项目审计按需读取,避免遍历全部镜头逐个请求。 */
const props = defineProps<{ projectId: string }>()
const emit = defineEmits<{ locate: [item: MotionPlanAudit['items'][number]] }>()
const result = ref<MotionPlanAudit | null>(null)
const loading = ref(false)
const error = ref('')
useFeedbackMessage(error)
/** 项目切换或卸载时取消迟到结果。 */
let controller: AbortController | undefined
watch(
() => props.projectId,
() => {
controller?.abort()
result.value = null
error.value = ''
loading.value = false
}
)
onScopeDispose(() => controller?.abort())
/** 只显示存在预警或缺少计划的镜头,完整数目保留在摘要。 */
const attentionItems = computed(
() =>
result.value?.items.filter(
item => !item.motionPlanAvailable || item.issues.length || item.actionDensityIssues.length
) ?? []
)
/** 读取真实审计结果,不触发生成或修复。 */
async function inspect() {
if (loading.value || !props.projectId) return
const projectId = props.projectId
controller = new AbortController()
const signal = controller.signal
loading.value = true
error.value = ''
try {
const data = await motionApi.audit(projectId, signal)
if (signal.aborted || projectId !== props.projectId) return
if (data.projectId !== projectId) throw new Error('动作审计与当前项目不匹配。')
result.value = data
} catch (cause) {
if (!signal.aborted && projectId === props.projectId) error.value = errorMessage(cause)
} finally {
if (!signal.aborted && projectId === props.projectId) loading.value = false
}
}
</script>
<template>
<section aria-label="项目动作时间轴审计">
<div class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-semibold">动作时长与密度检查</h3>
<NButton :loading="loading" @click="inspect">{{ result ? '重新检查' : '检查已保存动作' }}</NButton>
</div>
<p class="mt-2 text-xs leading-6 text-muted">只检查已保存时间轴;预警供人工复核,不阻止生产。</p>
<IssueHint :messages="error ? [error] : []" type="error" />
<template v-if="result">
<div class="mt-3 flex flex-wrap gap-x-4 gap-y-2 text-xs">
<span>已审计 {{ result.auditedCount }} / {{ result.shotCount }} 镜</span
><span>缺少计划 {{ result.missingMotionPlanCount }}</span
><span>时间轴预警 {{ result.warningCount }}</span
><span>动作密度预警 {{ result.actionDensityWarningCount }}</span>
</div>
<div class="mt-3 grid gap-3">
<div
v-for="item in attentionItems"
:key="item.shotId"
class="flex flex-wrap items-center justify-between gap-3 bg-(--app-subtle) p-3"
>
<div class="flex flex-wrap items-center gap-3 text-xs">
<strong>第 {{ item.episodeNo }} 集 · 段落 {{ item.beatNo }} · 镜头 {{ item.shotNo }}</strong
><NTag size="small" :bordered="false">{{
item.motionPlanAvailable
? `${item.issues.length + item.actionDensityIssues.length} 项预警`
: '尚无动作计划'
}}</NTag
><IssueHint
:messages="[...item.issues, ...item.actionDensityIssues].map(issue => issue.message)"
inline
/>
</div>
<NButton text size="small" @click="emit('locate', item)">查看镜头</NButton>
</div>
</div>
</template>
</section>
</template>
@@ -0,0 +1,133 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NButton, NTag, NSpin } from 'naive-ui'
import { useQuery } from '../../../composables/useQuery'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { motionApi } from '../motion-api'
/** 单镜头动作计划嵌入当前位置,切换镜头时取消旧读取。 */
const props = defineProps<{ shotId: string; revision?: string }>()
/** 生成提示词后修改 revision,重新读取后端保存的动作时间轴。 */
const key = computed(() => JSON.stringify([props.shotId, props.revision ?? '']))
const query = useQuery(key, async (value, signal) => {
const [shotId] = JSON.parse(value) as [string, string]
const result = await motionApi.preview(shotId, signal)
if (result.shotId !== shotId) throw new Error('动作时间轴与当前镜头不匹配,请重新读取。')
return result
})
/** 当前规则审计的预警及建议在需要时查看,不误报为质量阻塞。 */
const warnings = computed(() => [
...(query.data.value?.issues ?? []).map(item => item.message),
...(query.data.value?.actionDensityIssues ?? []).map(item => item.message),
...(query.data.value?.actionReviewSuggestions ?? []).flatMap(item =>
item.suggestions.map(text => `阶段 ${item.beatIndex + 1}:${text}`)
)
])
/** 只保留历史记录中的真实文本,缺失历史不能显示为已审计通过。 */
const savedWarnings = computed(() =>
(query.data.value?.savedActionDensityIssues ?? []).flatMap(value => {
if (!value || typeof value !== 'object' || !('message' in value) || typeof value.message !== 'string') return []
return [value.message]
})
)
</script>
<template>
<section class="motion-plan-panel" aria-label="镜头动作时间轴">
<header class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-semibold">动作时间轴</h3>
<NButton text size="small" :loading="query.loading.value" @click="query.refresh">刷新动作计划</NButton>
</header>
<div
v-if="query.loading.value && !query.data.value"
class="flex items-center gap-2 py-5 text-xs text-muted"
role="status"
>
<NSpin :size="16" />正在读取已保存动作…
</div>
<div v-else-if="query.error.value" class="mt-3">
<IssueHint :messages="[query.error.value]" type="error" inline />
</div>
<template v-if="query.data.value">
<div class="mt-3 flex flex-wrap items-center gap-3 text-xs text-muted">
<span>{{ query.data.value.durationSeconds }} 秒 · {{ query.data.value.beats.length }} 个阶段</span>
<NTag v-if="warnings.length" size="small" type="warning" :bordered="false">需人工复核</NTag>
<IssueHint :messages="warnings" label="查看预警与建议" inline />
</div>
<p v-if="!query.data.value.motionPlanAvailable" class="mt-4 text-xs text-muted">
尚无已保存动作计划,生成视频提示词后可在此查看。
</p>
<ol v-else class="motion-beats mt-4">
<li v-for="(beat, index) in query.data.value.beats" :key="index" class="motion-beat">
<div class="motion-beat-time">
<strong>{{ beat.startSecond }}–{{ beat.endSecond }} 秒</strong><span>阶段 {{ index + 1 }}</span>
</div>
<div class="min-w-0 space-y-2">
<p class="text-sm leading-6 whitespace-pre-wrap">{{ beat.action || '未保存动作描述' }}</p>
<dl class="motion-beat-detail">
<template v-if="beat.cameraMotion"
><dt>运镜</dt>
<dd>{{ beat.cameraMotion }}</dd></template
>
<template v-if="beat.physicalContinuity"
><dt>连续性</dt>
<dd>{{ beat.physicalContinuity }}</dd></template
>
<template v-if="beat.closingState"
><dt>收尾状态</dt>
<dd>{{ beat.closingState }}</dd></template
>
</dl>
</div>
</li>
</ol>
<p v-if="query.data.value.globalMotionConstraints.length" class="mt-4 text-xs leading-6 text-muted">
整体约束:{{ query.data.value.globalMotionConstraints.join(';') }}
</p>
<div
v-if="query.data.value.motionPlanAvailable"
class="mt-4 flex flex-wrap items-center gap-3 text-xs text-muted"
>
<span>{{
query.data.value.savedActionDensityIssues === null
? '未保存生成时审计记录'
: `生成时保存 ${query.data.value.savedActionDensityIssues.length} 项预警`
}}</span>
<IssueHint :messages="savedWarnings" label="查看历史预警" inline />
</div>
</template>
</section>
</template>
<style>
@reference "../../../styles/styles.css";
.motion-beats {
@apply grid gap-3 list-none p-0;
}
.motion-beat {
@apply grid grid-cols-[104px_minmax(0,1fr)] gap-4 p-4 bg-(--app-subtle);
}
.motion-beat-time {
@apply flex flex-col gap-1 text-xs;
}
.motion-beat-time span {
@apply text-muted;
}
.motion-beat-detail {
@apply grid grid-cols-[60px_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs leading-6;
}
.motion-beat-detail dt {
@apply text-muted;
}
.motion-beat-detail dd {
@apply m-0 break-words;
}
@media (max-width: 600px) {
.motion-beat {
@apply grid-cols-1 gap-3 p-3;
}
.motion-beat-time {
@apply flex-row flex-wrap items-center gap-3;
}
}
</style>
@@ -1,15 +1,19 @@
<script setup lang="ts">
import { NScrollbar, NAlert, NButton, NCheckbox } from 'naive-ui'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { NScrollbar, NButton, NCheckbox } from 'naive-ui'
import { computed, onScopeDispose, ref, watch } from 'vue'
import { Download, ExternalLink, RefreshCw } from '@lucide/vue'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { AssetImage } from '../../../components/ui'
import { storyboardApi } from '../api'
import { getStoryboardSession, referenceImageUrl } from '../model'
import type { DesignedShot, ShotReferences } from '../types'
import type { ShotGenerationSpec } from '../generation-spec.types'
import { useQuery } from '../../../composables/useQuery'
import { errorMessage } from '../../../lib/http'
import { downloadText } from '../../../lib/format'
import { runOperation } from '../../workflows/operations'
import { getOperation, runOperation } from '../../workflows/operations'
import ConfirmAction from '../../workflows/ConfirmAction.vue'
/** 镜头级只读资源与显式 Prompt 生成;查询与耗费模型的操作分开。 */
@@ -19,7 +23,21 @@ const spec = ref<ShotGenerationSpec | null>(null)
const errors = ref({ references: '', spec: '' })
const busy = ref({ references: false, spec: false })
const force = ref(false)
const prompt = computed(() => getStoryboardSession(props.projectId).prompts[props.shot.shotId])
/** 进入镜头直接读取已保存正文,不借生成接口发起模型调用。 */
const promptQuery = useQuery(
computed(() => props.shot.shotId),
(shotId, signal) => storyboardApi.videoPrompt(shotId, signal)
)
const prompt = computed(
() =>
getStoryboardSession(props.projectId).prompts[props.shot.shotId] ??
(promptQuery.data.value?.shotId === props.shot.shotId ? promptQuery.data.value : null)
)
/** 当前单镜头生成按钮只反映本次生成请求。 */
const promptLoading = computed(() => {
const operation = getOperation(props.projectId)
return operation.pending && operation.label === `生成镜头 ${props.shot.shotNo} 视频提示词`
})
const locked = computed(() => props.disabled)
const controllers: Partial<Record<'references' | 'spec', AbortController>> = {}
let revision = 0
@@ -72,13 +90,13 @@ async function load(kind: 'references' | 'spec') {
}
}
/** 没有独立 GET Prompt 接口:force=false 会复用已有正文,否则仍会调用模型。 */
/** 显式生成或重生成才调用 POST;已保存正文通过 GET 独立读取。 */
async function generatePrompt() {
if (locked.value) return
const projectId = props.projectId
const shotId = props.shot.shotId
const overwrite = force.value
const ok = await runOperation(projectId, `读取/生成镜头 ${props.shot.shotNo} 提示词`, async () => {
const ok = await runOperation(projectId, `生成镜头 ${props.shot.shotNo} 视频提示词`, async () => {
const session = getStoryboardSession(projectId)
// 请求结果不确定时不要保留可能已被覆盖的旧正文。
delete session.prompts[shotId]
@@ -89,7 +107,6 @@ async function generatePrompt() {
})
if (!ok) {
// 单镜头错误由 runOperation 记录到项目操作状态;这里只处理可恢复的首帧前置问题。
const { getOperation } = await import('../../workflows/operations')
const operation = getOperation(projectId)
if (!/primary keyframe|主首帧/i.test(operation.error)) return
operation.recovery = {
@@ -117,16 +134,14 @@ function exportResult(kind: 'spec' | 'prompt') {
<section>
<div class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-semibold">主体参考图</h3>
<NButton :disabled="busy.references || locked" @click="load('references')"
<NButton :disabled="busy.references || locked" :loading="busy.references" @click="load('references')"
><RefreshCw :size="13" :class="{ 'animate-spin': busy.references }" />刷新参考图</NButton
>
</div>
<p class="mt-2 text-xs leading-6 text-muted">
自动读取镜头当前绑定形态的主参考图,不生成新图。切换镜头会同步刷新,参考图缺失会影响后续生成。
</p>
<NAlert v-if="errors.references" role="alert" type="error" :show-icon="false" class="mt-3">{{
errors.references
}}</NAlert>
<FeedbackMessage v-if="errors.references" :message="errors.references" />
<template v-if="references">
<div class="reference-grid mt-4">
<article v-for="item in references.references" :key="item.shotSubjectId" class="reference-card">
@@ -172,6 +187,7 @@ function exportResult(kind: 'spec' | 'prompt') {
<h3 class="text-sm font-semibold">镜头生成规格</h3>
<NButton
:disabled="locked || busy.spec || !shot.direction || !shot.visualState"
:loading="busy.spec"
@click="load('spec')"
>{{ busy.spec ? '编译中…' : '读取生成规格' }}</NButton
>
@@ -180,9 +196,7 @@ function exportResult(kind: 'spec' | 'prompt') {
后端合并主体稳定身份、具体形态、摄影设计与即时状态,编译为 GenerationSpec,不调用模型。需要本镜头已有
Direction 和 VisualState。
</p>
<NAlert v-if="errors.spec" role="alert" type="error" :show-icon="false" class="mt-3">{{
errors.spec
}}</NAlert>
<FeedbackMessage v-if="errors.spec" :message="errors.spec" />
<template v-if="spec"
><div class="mt-4 flex items-center justify-between">
<span class="text-xs text-muted"
@@ -202,27 +216,32 @@ function exportResult(kind: 'spec' | 'prompt') {
</p>
<div class="mt-4 flex flex-wrap items-center gap-4">
<ConfirmAction
label="读取/生成提示词"
:label="force ? '重新生成提示词' : '生成提示词'"
:loading="promptLoading"
:disabled="locked"
acknowledgement
:description="
force
? '将覆盖此镜头已保存的视频提示词,并调用模型重新生成。'
: '读取此镜头已有提示词;若不存在,将自动生成并保存。生成前会检查所需参考图是否齐全。'
: '调用文本模型生成缺失的视频提示词;已有正文会直接复用。'
"
@confirm="generatePrompt"
/><NCheckbox v-model:checked="force" :disabled="locked" class="flex items-center gap-2 text-xs"
>覆盖此镜头提示词</NCheckbox
>
</div>
<div v-if="prompt" class="mt-5">
<p v-if="promptQuery.loading.value && !prompt" class="mt-4 text-xs text-muted" role="status">
正在读取提示词…
</p>
<IssueHint :messages="promptQuery.error.value ? [promptQuery.error.value] : []" type="error" />
<div v-if="prompt?.videoPrompt" class="mt-5">
<div class="mb-3 flex items-center justify-between">
<span class="text-xs font-medium">本会话已读取的正文</span
<span class="text-xs font-medium">已保存的视频提示词</span
><NButton @click="exportResult('prompt')" text size="small"><Download :size="13" />导出</NButton>
</div>
<p class="whitespace-pre-wrap text-sm leading-7">{{ prompt.videoPrompt }}</p>
<template v-if="prompt.negativePrompt"
><h4 class="mb-2 mt-5 text-xs font-medium text-muted">Negative prompt</h4>
><h4 class="mb-2 mt-5 text-xs font-medium text-muted">Negative prompt(负向提示词)</h4>
<p class="whitespace-pre-wrap text-sm leading-6">{{ prompt.negativePrompt }}</p></template
>
</div>
@@ -0,0 +1,339 @@
<script setup lang="ts">
import { computed, ref, watch, onScopeDispose } from 'vue'
import { NButton, NInput, NSelect, NPopconfirm } from 'naive-ui'
import { useQuery } from '../../../composables/useQuery'
import { useFeedbackMessage } from '../../../composables/useFeedbackMessage'
import { useActionMessage } from '../../../components/ui/useActionMessage'
import IssueHint from '../../../components/ui/IssueHint.vue'
import { runOperation, getOperation } from '../../workflows/operations'
import { storyboardApi } from '../api'
import { spatialApi, type GazeReadability, type SpatialBinding } from '../spatial-api'
import { errorMessage } from '../../../lib/http'
/** 人工目标绑定编辑器;保留所有已确认字段,切镜后隔离草稿与迟到响应。 */
const props = defineProps<{ projectId: string; shotId: string; disabled: boolean }>()
const emit = defineEmits<{ changed: [] }>()
const query = useQuery(
computed(() => props.shotId),
async (shotId, signal) => {
const [bindings, references] = await Promise.all([
spatialApi.bindings(shotId, signal),
storyboardApi.references(shotId, signal)
])
if (references.shotId !== shotId) throw new Error('视线绑定的主体列表与当前镜头不匹配。')
return { bindings, references }
}
)
/**
* 仅复制允许写入的业务字段,不能提交或伪造后端 evidence。
* @param binding 后端已保存或人工编辑的空间绑定
* @returns 可提交到正式接口的业务字段
*/
function writableBinding(binding: SpatialBinding): SpatialBinding {
const {
subjectRef,
relation,
gazeIntent,
targetDescription,
targetSubjectRef,
targetDepth,
targetScreenRegion,
targetUniqueness,
direction,
visibility
} = binding
return {
subjectRef,
relation,
gazeIntent,
targetDescription,
targetSubjectRef,
targetDepth,
targetScreenRegion,
targetUniqueness,
direction,
visibility
}
}
const draft = ref<SpatialBinding[]>([])
const saved = ref('[]')
watch(
() => props.shotId,
() => {
draft.value = []
saved.value = '[]'
}
)
watch(
() => query.data.value,
data => {
if (!data) return
draft.value = data.bindings.map(writableBinding)
saved.value = JSON.stringify(draft.value)
}
)
const dirty = computed(() => JSON.stringify(draft.value) !== saved.value)
const subjects = computed(() => {
const references = query.data.value?.references
const all = [...(references?.references ?? []), ...(references?.missing ?? [])]
return [
...new Map(
all.map(item => [
item.subjectRef,
{ label: `${item.subjectName}(${item.subjectRef})`, value: item.subjectRef }
])
).values()
]
})
const message = useActionMessage()
/** 局部保存的加载状态只显示在本镜头保存按钮。 */
const saving = computed(() => {
const op = getOperation(props.projectId)
return op.pending && op.label === `保存镜头 ${props.shotId} 视线目标`
})
/**
* 使用真实镜头主体创建一条待确认绑定。
* @returns 无可选主体时不创建草稿
*/
function add() {
const subjectRef = subjects.value[0]?.value
if (!subjectRef) return
draft.value.push({
subjectRef,
relation: 'gaze',
gazeIntent: 'target_locked',
targetDescription: '',
direction: 'unknown',
visibility: 'unknown'
})
}
/** 保存完整列表,后端负责最终主体归属检查。 */
async function save() {
if (props.disabled || !dirty.value || query.error.value || !query.data.value) return
const shotId = props.shotId
const projectId = props.projectId
if (
draft.value.some(
item => !subjects.value.some(subject => subject.value === item.subjectRef) || !item.targetDescription.trim()
)
) {
message?.warning('请选择本镜头主体并填写明确的注视目标。')
return
}
const input = draft.value.map(item =>
writableBinding({
...item,
targetDescription: item.targetDescription.trim(),
targetSubjectRef: item.targetSubjectRef || undefined,
targetScreenRegion: item.targetScreenRegion?.trim() || undefined
})
)
const ok = await runOperation(
projectId,
`保存镜头 ${shotId} 视线目标`,
async () => {
await spatialApi.replace(shotId, input)
},
{ content: '视线目标已保存,请重新核对相关提示词和首帧。', type: 'success' }
)
if (ok && props.shotId === shotId && props.projectId === projectId) {
await query.refresh()
gaze.value = null
emit('changed')
}
}
/** 只读审计由用户主动展开,不在缺少设计时反复编译。 */
const gaze = ref<GazeReadability | null>(null)
const gazeLoading = ref(false)
const gazeError = ref('')
useFeedbackMessage(gazeError)
let controller: AbortController | undefined
watch(
() => props.shotId,
() => {
controller?.abort()
gaze.value = null
gazeError.value = ''
gazeLoading.value = false
}
)
onScopeDispose(() => controller?.abort())
/** 查询当前编译约束,不改写摄影或画面状态。 */
async function inspectGaze() {
if (gazeLoading.value || dirty.value) return
const shotId = props.shotId
controller = new AbortController()
const signal = controller.signal
gazeLoading.value = true
gazeError.value = ''
try {
const data = await spatialApi.gaze(shotId, signal)
if (signal.aborted || props.shotId !== shotId) return
if (data.shotId !== shotId) throw new Error('视线检查与当前镜头不匹配。')
gaze.value = data
} catch (cause) {
if (!signal.aborted && props.shotId === shotId) gazeError.value = errorMessage(cause)
} finally {
if (!signal.aborted && props.shotId === shotId) gazeLoading.value = false
}
}
</script>
<template>
<section class="spatial-bindings-panel" aria-label="人工确认视线目标">
<div class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-semibold">视线目标</h3>
<NButton text size="small" :loading="query.loading.value" :disabled="dirty || saving" @click="query.refresh"
>刷新绑定</NButton
>
</div>
<p class="mt-2 text-xs leading-6 text-muted">
明确“朝向目标方向”或“注视具体目标”,保存后重新核对相关提示词和首帧。
</p>
<IssueHint :messages="query.error.value ? [query.error.value] : []" type="error" />
<div class="mt-4 grid gap-4">
<section v-for="(binding, index) in draft" :key="index" class="spatial-binding-row">
<div class="flex items-center justify-between gap-3">
<strong class="text-xs">目标 {{ index + 1 }}</strong
><NButton text size="small" :disabled="disabled" @click="draft.splice(index, 1)">移除</NButton>
</div>
<div class="spatial-binding-fields mt-3">
<label
>注视主体<NSelect v-model:value="binding.subjectRef" :options="subjects" :disabled="disabled"
/></label>
<label
>视线要求<NSelect
v-model:value="binding.gazeIntent"
:options="[
{ label: '朝向目标方向', value: 'directional' },
{ label: '注视具体目标', value: 'target_locked' }
]"
:disabled="disabled"
/></label>
<label class="spatial-binding-wide"
>目标说明<NInput
v-model:value="binding.targetDescription"
placeholder="例如:右侧唯一的枯树树桩"
:disabled="disabled"
/></label>
<label
>目标主体<NSelect
v-model:value="binding.targetSubjectRef"
clearable
:options="subjects"
placeholder="可选:本镜头目标主体"
:disabled="disabled"
/></label>
<label
>画面方向<NSelect
v-model:value="binding.direction"
:options="[
{ label: '左侧', value: 'left' },
{ label: '右侧', value: 'right' },
{ label: '上方', value: 'up' },
{ label: '下方', value: 'down' },
{ label: '未确认', value: 'unknown' }
]"
:disabled="disabled"
/></label>
<label
>目标是否入画<NSelect
v-model:value="binding.visibility"
:options="[
{ label: '画内', value: 'in_frame' },
{ label: '画外', value: 'off_screen' },
{ label: '未确认', value: 'unknown' }
]"
:disabled="disabled"
/></label>
<label
>目标景深<NSelect
v-model:value="binding.targetDepth"
clearable
:options="[
{ label: '前景', value: 'foreground' },
{ label: '中景', value: 'midground' },
{ label: '背景', value: 'background' }
]"
:disabled="disabled"
/></label>
<label
>目标唯一性<NSelect
v-model:value="binding.targetUniqueness"
clearable
:options="[
{ label: '唯一', value: 'unique' },
{ label: '存在歧义', value: 'ambiguous' },
{ label: '未确认', value: 'unknown' }
]"
:disabled="disabled"
/></label>
<label
>具体画面区域<NInput
v-model:value="binding.targetScreenRegion"
placeholder="可选:右下方树桩上部"
:disabled="disabled"
/></label>
</div>
</section>
</div>
<p v-if="query.data.value && !draft.length" class="mt-4 text-xs text-muted">
尚未手工确认目标;当前仍使用已保存设计推导的约束。
</p>
<div class="mt-4 flex flex-wrap items-center gap-3">
<NButton :disabled="disabled || !subjects.length || !!query.error.value" @click="add">添加目标</NButton>
<NPopconfirm
v-if="dirty && !draft.length"
positive-text="确认撤销"
negative-text="取消"
@positive-click="save"
><template #trigger
><NButton type="primary" :disabled="disabled" :loading="saving">撤销全部人工绑定</NButton></template
>撤销后将重新使用已保存设计推导的目标约束。</NPopconfirm
>
<NButton
v-else
type="primary"
:disabled="disabled || !dirty || !!query.error.value"
:loading="saving"
@click="save"
>保存全部绑定</NButton
>
<NButton :loading="gazeLoading" :disabled="dirty" @click="inspectGaze">检查当前视线约束</NButton>
</div>
<IssueHint :messages="gazeError ? [gazeError] : []" type="error" />
<div v-if="gaze" class="mt-4 space-y-3 text-xs leading-6">
<div class="flex flex-wrap items-center gap-3">
<span
>当前约束 {{ gaze.spatialTargetBindings.length }} 项 · 精确注视
{{ gaze.targetLockedCount }} 项</span
><IssueHint
:messages="gaze.specConsistencyIssues.flatMap(item => [item.message, item.suggestion])"
label="查看设计预警"
inline
/>
</div>
<p v-for="(binding, index) in gaze.spatialTargetBindings" :key="index">
{{ binding.subjectRef }} → {{ binding.targetDescription }} ·
{{ binding.gazeIntent === 'directional' ? '朝向目标方向' : '注视具体目标' }} ·
{{ binding.evidence.includes('confirmed_override') ? '人工确认' : '设计推导' }}
</p>
</div>
</section>
</template>
<style>
@reference "../../../styles/styles.css";
.spatial-binding-row {
@apply p-4 bg-(--app-subtle);
}
.spatial-binding-fields {
@apply grid grid-cols-[repeat(auto-fit,minmax(min(100%,200px),1fr))] gap-4;
}
.spatial-binding-fields > label {
@apply grid gap-2 text-xs min-w-0;
}
.spatial-binding-wide {
@apply col-span-full;
}
</style>
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, ref } from 'vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
import ReadonlyInspection from '../../../components/ui/ReadonlyInspection.vue'
import { useQuery } from '../../../composables/useQuery'
import { auditSubjectCoverage } from '../coverage-api'
@@ -37,10 +39,10 @@ const result = computed(() => query.data.value)
@refresh="query.refresh"
>
<template v-if="result">
<NAlert :type="result.valid ? 'success' : 'warning'" :show-icon="false">
<ContextNotice :type="result.valid ? 'success' : 'warning'" :show-icon="false">
{{ result.valid ? '未发现主体引用遗漏' : `发现 ${result.issueCount} 项引用遗漏` }} ·
{{ result.episodeCount }} 集 / {{ result.beatCount }} 个 Beat / {{ result.shotCount }} 镜
</NAlert>
</ContextNotice>
<p class="mt-2 text-muted">
检查主体 {{ result.subjectSummary.total }} · 人物 {{ result.subjectSummary.character }} / 场景
{{ result.subjectSummary.scene }} / 道具 {{ result.subjectSummary.prop }}
+24
View File
@@ -0,0 +1,24 @@
import { request } from '../../lib/http'
import type { MotionPlanAudit, MotionPlanPreview } from './motion.types'
/** 动作时间轴入口只读,不生成提示词,也不改变镜头时长。 */
export const motionApi = {
/**
* 读取单镜头已保存的动作计划和实时复核建议。
* @param shotId 正式镜头 ID
* @param signal 查询取消信号
* @returns 后端实际动作时间轴
*/
preview: (shotId: string, signal?: AbortSignal) =>
request<MotionPlanPreview>(`/storyboard-shots/${encodeURIComponent(shotId)}/motion-plan/preview`, { signal }),
/**
* 按需读取项目动作时长与密度审计。
* @param projectId 正式项目 ID
* @param signal 查询取消信号
* @returns 项目审计和正式镜头坐标
*/
audit: (projectId: string, signal?: AbortSignal) =>
request<MotionPlanAudit>(`/projects/${encodeURIComponent(projectId)}/storyboard/motion-plan-duration-audit`, {
signal
})
}
+66
View File
@@ -0,0 +1,66 @@
/** 后端动作时间轴与密度审计的非阻断预警。 */
export interface MotionIssue {
code: string
severity: 'warning'
message: string
beatIndex?: number
}
/** 已保存动作阶段;时间和动作均来自后端,不在前端补造。 */
export interface MotionBeat {
startSecond: number
endSecond: number
action: string
cameraMotion: string
physicalContinuity: string
subjectRefs: string[]
closingState: string
}
/** 单镜头动作时间轴详情,实时审计与历史生成记录分别保存。 */
export interface MotionPlanPreview {
shotId: string
episodeNo: number
beatNo: number
shotNo: number
durationSeconds: number
motionPlanAvailable: boolean
beats: MotionBeat[]
globalMotionConstraints: string[]
issues: MotionIssue[]
actionDensityIssues: MotionIssue[]
actionReviewSuggestions: Array<{
beatIndex: number
code: string
suggestions: string[]
requiresManualReview: true
}>
savedActionDensityIssues: unknown[] | null
willCallModel: false
willModifyAssets: false
}
/** 项目动作审计按正式镜头 ID 返回,可安全定位至原剧集。 */
export interface MotionPlanAudit {
projectId: string
shotCount: number
auditedCount: number
missingMotionPlanCount: number
warningCount: number
actionDensityWarningCount: number
items: Array<
Pick<
MotionPlanPreview,
| 'shotId'
| 'episodeNo'
| 'beatNo'
| 'shotNo'
| 'durationSeconds'
| 'motionPlanAvailable'
| 'issues'
| 'actionDensityIssues'
>
>
willCallModel: false
willModifyAssets: false
}
+62
View File
@@ -0,0 +1,62 @@
import { request } from '../../lib/http'
/** 人工确认的视线目标;证据字段只由后端创建。 */
export interface SpatialBinding {
subjectRef: string
relation: 'gaze'
gazeIntent?: 'directional' | 'target_locked'
targetDescription: string
targetSubjectRef?: string
targetDepth?: 'foreground' | 'midground' | 'background'
targetScreenRegion?: string
targetUniqueness?: 'unique' | 'ambiguous' | 'unknown'
direction: 'left' | 'right' | 'up' | 'down' | 'unknown'
visibility: 'in_frame' | 'off_screen' | 'unknown'
}
/** 只读视线可读性检查保留编译来源,不代表取得重新构图权限。 */
export interface GazeReadability {
shotId: string
visualFocus: string
spatialTargetBindings: Array<SpatialBinding & { evidence: string[] }>
targetLockedCount: number
confirmedBindingsPresent: boolean
specConsistencyIssues: Array<{ message: string; suggestion: string }>
subjectGaze: Array<{ subjectRef: string; gaze: string; pose: string; transientState: string }>
canAutomaticallyReframe: false
willCallModel: false
willModifyData: false
}
/** 视线目标正式接口,写入只替换人工确认的绑定。 */
export const spatialApi = {
/**
* 读取已确认空间目标。
* @param shotId 正式镜头 ID
* @param signal 查询取消信号
* @returns 人工确认的目标列表
*/
bindings: (shotId: string, signal?: AbortSignal) =>
request<SpatialBinding[]>(`/storyboard-shots/${encodeURIComponent(shotId)}/spatial-target-bindings`, {
signal
}),
/**
* 保存当前镜头的完整人工确认列表;空列表撤销覆盖。
* @param shotId 正式镜头 ID
* @param bindings 已人工核对的完整列表
* @returns 后端保存后的目标列表
*/
replace: (shotId: string, bindings: SpatialBinding[]) =>
request<SpatialBinding[]>(`/storyboard-shots/${encodeURIComponent(shotId)}/spatial-target-bindings`, {
method: 'PUT',
body: { bindings }
}),
/**
* 检查当前已编译目标与设计的一致性。
* @param shotId 正式镜头 ID
* @param signal 查询取消信号
* @returns 只读视线检查结果
*/
gaze: (shotId: string, signal?: AbortSignal) =>
request<GazeReadability>(`/storyboard-shots/${encodeURIComponent(shotId)}/gaze-readability/preview`, { signal })
}
@@ -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()])
}
@@ -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'
@@ -6,10 +10,20 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import ActionMenu from '../../components/ui/ActionMenu.vue'
import DetailDisclosure from '../../components/ui/DetailDisclosure.vue'
import WorkspaceTools from '../../components/ui/WorkspaceTools.vue'
import { NAlert, NButton, NCheckbox, NInput, NInputNumber, NPopover, NScrollbar, NSelect, NTag } from 'naive-ui'
import { NButton, NCheckbox, NInput, NInputNumber, NPopover, NScrollbar, NSelect, NTag } from 'naive-ui'
import { computed, onScopeDispose, ref, watch, type Directive } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { Search, Download, ImagePlus, ArrowLeft, ArrowRight, LayoutGrid, Columns3, Settings2 } from '@lucide/vue'
import {
Search,
Download,
ImagePlus,
ArrowLeft,
ArrowRight,
LayoutGrid,
Columns3,
LoaderCircle,
Settings2
} from '@lucide/vue'
import { AssetImage, EmptyState, StatusBadge } from '../../components/ui'
import { downloadText } from '../../lib/format'
import ConfirmAction from '../workflows/ConfirmAction.vue'
@@ -296,15 +310,16 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
<template>
<WorkspacePage compact mobile-scroll class="gallery-workspace-page">
<template #notice>
<NAlert v-if="stageComplete" type="success" :show-icon="false">
当前制作需要的主体参考图已经准备好,可以继续进行分镜设计。
<RouterLink :to="`/projects/${id}/storyboard`" class="text-button ml-2">继续分镜设计 →</RouterLink>
</NAlert>
<div v-if="stageComplete" class="flex justify-end text-xs">
<RouterLink :to="`/projects/${id}/storyboard`" class="text-button">继续分镜设计 →</RouterLink>
</div>
</template>
<template #default>
<!-- 批量设置使用弹窗,入口跟随图库筛选区。 -->
<WorkspaceTools
triggerless
:pending="operation.pending"
:pending-label="operation.label"
v-model:open="toolsOpen"
title="形态生图配置与回执"
label="批量生图"
@@ -327,6 +342,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
></DetailDisclosure
>
<FormPromptBatch
:generating="isOperationRunning(operation, '批量生成形态正式提示词')"
:forms="forms"
:disabled="blocked"
:pending="operation.pending"
@@ -396,6 +412,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
>已有主图也新增候选图
</NCheckbox>
<ConfirmAction
:loading="isOperationRunning(operation, '批量生成项目形态图片')"
:label="force ? '为全项目新增候选图' : '补齐项目主参考图'"
:disabled="blocked || running || !batchValid || !forms.length"
acknowledgement
@@ -427,7 +444,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
· 待后续处理 {{ session.receipt.result.remaining }}</span
>
</p>
<NAlert
<ContextNotice
v-if="session.receipt.result.failed"
role="alert"
type="error"
@@ -435,7 +452,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
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.subjectFormId">
<code>{{ failure.subjectFormId }}</code
@@ -448,7 +465,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
</section>
</WorkspaceTools>
<!-- 关联说明、筛选和图片共用正文滚动区,避免镜头切换时两块滚动区域高度不同步。 -->
<NAlert
<ContextNotice
v-if="impact.stale.value.length"
type="warning"
:show-icon="false"
@@ -503,10 +520,10 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
</li>
</ul>
</NScrollbar>
</NAlert>
<NAlert v-if="impact.query.error.value" type="warning" :show-icon="false" class="mt-3"
</ContextNotice>
<ContextNotice v-if="impact.query.error.value" type="warning" :show-icon="false" class="mt-3"
>镜头影响检查失败,暂时无法确认有无过期首帧:{{ impact.query.error.value }}
<NButton text size="small" @click="impact.query.refresh">重试检查</NButton></NAlert
<NButton text size="small" @click="impact.query.refresh">重试检查</NButton></ContextNotice
>
<div class="gallery-sticky-controls">
<div class="form-image-filter-region">
@@ -631,7 +648,12 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
:aria-expanded="toolsOpen"
@click="toolsOpen = true"
>
<template #icon><Settings2 :size="16" /></template>
<template #icon
><LoaderCircle
v-if="operation.pending"
:size="16"
class="animate-spin" /><Settings2 v-else :size="16"
/></template>
</NButton>
</template>
{{
@@ -682,7 +704,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
</p>
</div>
</div>
<NAlert
<ContextNotice
v-if="targetFormId"
:type="targetForm ? 'info' : 'warning'"
:show-icon="false"
@@ -698,18 +720,13 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
query.loading.value ? '正在定位素材…' : '指定形态不存在或已被移除,请从本镜头当前关联素材重新选择。'
}}</template>
<NButton text size="small" @click="resetFilters">清除定位</NButton>
</NAlert>
<NAlert v-if="operation.notice" role="status" type="success" :show-icon="false" class="mt-4">
{{ operation.notice }}
</NAlert>
<NAlert v-if="operation.error" role="alert" type="error" :show-icon="false" class="mt-4">
{{ operation.error }}
</NAlert>
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
>{{ query.error.value }}<span v-if="forms.length"> 当前展示上次读取的数据。</span></NAlert
><NAlert v-if="running" role="status" type="info" :show-icon="false" class="mt-4">
</ContextNotice>
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
>{{ query.error.value }}<span v-if="forms.length"> 当前展示上次读取的数据。</span></ContextNotice
><ContextNotice v-if="running" role="status" type="info" :show-icon="false" class="mt-4">
数据库中有形态图片正在后台生成。对应形态会暂停重复提交,其它形态仍可继续生成;项目批量生图需等待当前任务完成。
</NAlert>
</ContextNotice>
<p v-if="!query.data.value && query.loading.value" class="py-10 text-sm text-muted" role="status">
正在读取形态和已有图片…
</p>
@@ -772,7 +789,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
>
<span class="text-[10px] text-muted">{{ form.images.length }} 条记录</span>
</div>
<NAlert
<ContextNotice
v-if="
sourceShot?.primaryKeyframeStale &&
impact.relatedForms.value.has(form.id) &&
@@ -792,7 +809,7 @@ const rules = { concurrency: integerRule('批量并发'), limit: integerRule('
<RouterLink v-if="sourceLocation" :to="sourceLocation" class="text-button mt-2"
>返回该镜头处理 →</RouterLink
>
</NAlert>
</ContextNotice>
<p v-if="form.images[0]?.status === 'failed'" class="mt-2 line-clamp-2 text-xs text-danger">
{{ form.images[0].error }}
</p>
@@ -1,9 +1,11 @@
<script setup lang="ts">
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'
import { computed } from 'vue'
import { NAlert, NButton, NCheckbox, NInputNumber } from 'naive-ui'
import { NButton, NCheckbox, NInputNumber } from 'naive-ui'
import { downloadText } from '../../../lib/format'
import ConfirmAction from '../../workflows/ConfirmAction.vue'
import type { ImageSession, SubjectFormAsset } from '../types'
@@ -13,6 +15,8 @@ const props = defineProps<{
forms: SubjectFormAsset[]
disabled: boolean
pending: boolean
/** 仅形态提示词批量请求显示在当前生成按钮。 */
generating?: boolean
receipt?: ImageSession['promptReceipt']
}>()
const concurrency = defineModel<number>('concurrency', { required: true })
@@ -51,6 +55,7 @@ const rules = { concurrency: integerRule('提示词并发') }
>覆盖已有正式提示词</NCheckbox
>
<ConfirmAction
:loading="generating"
:label="force ? '重生成全部形态提示词' : '补齐形态提示词'"
:disabled="disabled || !valid || !forms.length || (!force && complete === forms.length)"
acknowledgement
@@ -72,8 +77,8 @@ const rules = { concurrency: integerRule('提示词并发') }
总数 {{ receipt.result.total }} · 目标 {{ receipt.result.targetCount }} · 生成
{{ receipt.result.generated }} · 跳过 {{ receipt.result.skipped }} · 失败 {{ receipt.result.failed }}
</p>
<NAlert v-if="receipt.result.failed" type="error" :show-icon="false" class="mt-3"
>部分提示词生成失败,已保存结果保留。可按下方形态 ID 定位并重试。</NAlert
<ContextNotice v-if="receipt.result.failed" type="error" :show-icon="false" class="mt-3"
>部分提示词生成失败,已保存结果保留。可按下方形态 ID 定位并重试。</ContextNotice
>
<ul class="mt-3 space-y-2 text-xs text-danger">
<li v-for="failure in receipt.result.failures" :key="failure.subjectFormId">
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { downloadText } from '../../../lib/format'
import ConfirmAction from '../../workflows/ConfirmAction.vue'
@@ -29,10 +31,10 @@ function exportPrompt() {
title="形态正式提示词"
:description="`${form?.subject.name || ''} · ${form?.name || ''}`"
>
<NAlert type="info" :show-icon="false" class="mt-5 text-xs">
<ContextNotice type="info" :show-icon="false" class="mt-5 text-xs">
结合形态描述与项目视觉风格生成并保存
generationPrompt。只调用文本模型,不生成图片;覆盖不会修改已有图片的实际提示词或主图。
</NAlert>
</ContextNotice>
<section class="dialog-section mt-5">
<h3 class="text-sm font-medium">原始外观素材</h3>
<p class="mt-3 whitespace-pre-wrap break-words text-xs leading-6 text-muted">
@@ -1,7 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
import { NAlert, NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NTag } from 'naive-ui'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NTag } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import { AppDialog } from '../../../components/ui'
import { errorMessage } from '../../../lib/http'
@@ -125,8 +127,8 @@ const rules = {}
class="dialog-form-stack"
@submit="submit"
>
<NAlert type="info" :show-icon="false" class="text-xs"
>使用后端配置的图片模型,可能产生费用。每次新增一张图片,不删除历史结果。</NAlert
<ContextNotice type="info" :show-icon="false" class="text-xs"
>使用后端配置的图片模型,可能产生费用。每次新增一张图片,不删除历史结果。</ContextNotice
>
<p class="text-xs leading-6 text-muted">
基础形态默认复用已确认并锁定的身份母版,无需重复生成。此处会调用图片模型新增独立候选,用于不同形态或需要调整外观的情况;是否替换主图由下方选项决定。
@@ -135,7 +137,7 @@ const rules = {}
<NButton :loading="previewPending" :disabled="!form" @click="loadPreview">预览实际生成输入</NButton>
<span class="text-xs text-muted">只读取后端编译结果,不调用图片模型。</span>
</div>
<NAlert v-if="previewError" type="error" :show-icon="false">{{ previewError }}</NAlert>
<ContextNotice v-if="previewError" type="error" :show-icon="false">{{ previewError }}</ContextNotice>
<div v-if="preview" class="dialog-result-card text-xs leading-6">
<div class="flex flex-wrap items-center gap-2">
<strong>{{ preview.provider }} / {{ preview.model }}</strong>
@@ -1,5 +1,7 @@
<script setup lang="ts">
import { NScrollbar, NAlert, NButton, NTag } from 'naive-ui'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NScrollbar, NButton, NTag } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import { ExternalLink, RefreshCw } from '@lucide/vue'
import { AppDialog, AssetImage, StatusBadge } from '../../../components/ui'
@@ -97,12 +99,10 @@ async function choosePrimary() {
><RefreshCw :size="13" :class="{ 'animate-spin': query.loading.value }" />刷新图片
</NButton>
</div>
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
>{{ query.error.value }} 当前保留上次读取的记录,主图操作已暂停。
</NAlert>
<NAlert v-if="operation.error" role="alert" type="error" :show-icon="false" class="mt-3">{{
operation.error
}}</NAlert>
</ContextNotice>
<div v-if="selected" class="mt-4">
<AssetImage
:key="selected.id"
@@ -170,13 +170,13 @@ async function choosePrimary() {
>打开原图<ExternalLink :size="12"
/></a>
</div>
<NAlert
<ContextNotice
v-if="selected.error"
role="alert"
type="error"
:show-icon="false"
class="mt-3 whitespace-pre-wrap"
>{{ selected.error }}</NAlert
>{{ selected.error }}</ContextNotice
>
<div class="mt-4 flex flex-wrap items-center gap-3">
<NButton v-if="!selected.isPrimary" :disabled="!canSetPrimary" @click="confirming = true">
@@ -189,12 +189,12 @@ async function choosePrimary() {
<p v-if="reusedImageUnavailable" class="mt-3 text-xs text-muted">
此图片复用的身份母版已变更,或当前形态不再满足复用条件,仅保留作历史查看。
</p>
<NAlert v-if="confirming" type="info" :show-icon="false" class="mt-3"
<ContextNotice v-if="confirming" type="info" :show-icon="false" class="mt-3"
><p class="text-xs">确认将这张图用于此形态后续的分镜参考?旧主图仍会保留,此操作不调用模型。</p>
<div class="mt-3 flex gap-3">
<NButton :disabled="!canSetPrimary" @click="choosePrimary" type="primary"> 确认切换主图</NButton
><NButton @click="confirming = false" text size="small">取消</NButton>
</div></NAlert
</div></ContextNotice
>
<p class="mt-3 break-all font-mono text-[10px] text-muted">Image ID · {{ selected.id }}</p>
<p v-if="form && currentIdentityAnchorId(form)" class="mt-2 break-all text-[11px] text-muted">
+25 -13
View File
@@ -2,7 +2,7 @@ import { computed, ref } from 'vue'
import { usePolling } from '../../composables/usePolling'
import { ApiError } from '../../lib/http'
import { useProjectContext } from '../projects/context'
import { getOperation, runOperation } from '../workflows/operations'
import { batchResultNotice, getOperation, runOperation } from '../workflows/operations'
import { workflowCheckpoints } from '../workflows/selectors'
import { useProjectGenerationRevision } from '../generation-config/context'
import { generationConfigApi } from '../generation-config/api'
@@ -128,12 +128,18 @@ export function useSubjectImages() {
}
const target = getImageSession(projectId)
target.promptReceipt = null
await runOperation(projectId, '批量生成形态正式提示词', async () => {
target.promptReceipt = {
title: input.force ? '重生成全部形态提示词' : '补齐形态提示词',
result: await subjectImagesApi.generatePrompts(projectId, input)
}
})
await runOperation(
projectId,
'批量生成形态正式提示词',
async () => {
target.promptReceipt = {
title: input.force ? '重生成全部形态提示词' : '补齐形态提示词',
result: await subjectImagesApi.generatePrompts(projectId, input)
}
return target.promptReceipt.result
},
result => batchResultNotice(result, '形态提示词')
)
await query.refresh()
}
@@ -166,12 +172,18 @@ export function useSubjectImages() {
}
const target = getImageSession(projectId)
target.receipt = null
await runOperation(projectId, '批量生成项目形态图片', async () => {
target.receipt = {
title: input.force ? '为全项目新增候选图' : '补齐项目主参考图',
result: await subjectImagesApi.generateProject(projectId, input)
}
})
await runOperation(
projectId,
'批量生成项目形态图片',
async () => {
target.receipt = {
title: input.force ? '为全项目新增候选图' : '补齐项目主参考图',
result: await subjectImagesApi.generateProject(projectId, input)
}
return target.receipt.result
},
result => batchResultNotice(result, '形态图片')
)
await query.refresh()
}
+12 -7
View File
@@ -1,6 +1,10 @@
<script setup lang="ts">
import { isOperationRunning } from '../workflows/operations'
import ContextNotice from '../../components/ui/ContextNotice.vue'
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import { NAlert, NButton } from 'naive-ui'
import { NButton } from 'naive-ui'
import { LoaderCircle, LockKeyhole, LockKeyholeOpen, Palette, TriangleAlert } from '@lucide/vue'
import { computed, ref } from 'vue'
import { useQuery } from '../../composables/useQuery'
@@ -139,6 +143,7 @@ function removeImage(image: VisualStyleImage) {
</div>
<div class="visual-style-actions toolbar-actions">
<ConfirmAction
:loading="isOperationRunning(operation, 'AI 生成项目视觉风格')"
:label="style ? 'AI 重新生成风格' : 'AI 生成风格'"
:disabled="disabled || !!style?.isLocked || dirty"
acknowledgement
@@ -149,18 +154,17 @@ function removeImage(image: VisualStyleImage) {
</div>
</template>
<template #notice>
<NAlert v-if="nextReady && style" type="success" :show-icon="false">
视觉风格已准备好,可以继续确认人物、场景和道具的主体身份。
<RouterLink :to="`/projects/${projectId}/subject-identity`" class="text-button ml-2"
<div v-if="nextReady && style" class="flex justify-end text-xs">
<RouterLink :to="`/projects/${projectId}/subject-identity`" class="text-button"
>继续主体身份 →</RouterLink
>
</NAlert>
</div>
</template>
<div class="workspace-section-stack">
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false"
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false"
>{{ query.error.value }} 当前内容读取失败;已有内容不会被覆盖。
<NButton text class="ml-3" :loading="query.loading.value" @click="query.refresh">重试读取</NButton>
</NAlert>
</ContextNotice>
<p v-if="dirty" class="mb-4 text-xs text-muted">
有未保存修改,AI 重生成暂不可用。刷新不会覆盖编辑内容;离开页面不会自动保存。
</p>
@@ -177,6 +181,7 @@ function removeImage(image: VisualStyleImage) {
v-if="query.data.value"
:key="editorRevision"
:visual-style="style"
:saving="isOperationRunning(operation, '保存项目视觉风格')"
:disabled="disabled"
@save="save"
@dirty="dirty = $event"
@@ -7,7 +7,11 @@ import { computed, reactive, ref, watch } from 'vue'
import type { SaveVisualStyleInput, VisualStyle } from '../types'
/** 编辑草稿独立于轮询结果,刷新不会覆盖尚未保存的输入。 */
const props = defineProps<{ visualStyle: VisualStyle | null; disabled: boolean }>()
const props = defineProps<{
visualStyle: VisualStyle | null
disabled: boolean
/** 当前表单保存请求。 */ saving?: boolean
}>()
/** 保存校验后的风格配置,并向父页面同步草稿状态。 */
const emit = defineEmits<{ save: [input: SaveVisualStyleInput]; dirty: [value: boolean] }>()
/** 整体风格、分类补充和硬约束保持在同一份编辑草稿中。 */
@@ -143,7 +147,9 @@ const rules = { constraints: stringArrayJsonRule }
锁定后仍可人工编辑并保存。取消勾选并保存后,才能再次使用 AI 重生成。
</p>
<div class="page-form-actions">
<NButton :disabled="disabled" type="primary" attr-type="submit"> 保存视觉风格 </NButton>
<NButton :disabled="disabled" type="primary" attr-type="submit" :loading="saving">
保存视觉风格
</NButton>
</div>
</fieldset>
</AppForm>
@@ -1,6 +1,8 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, ref, watch } from 'vue'
import { NAlert, NButton, NCollapse, NCollapseItem, NInput, NSelect, NTab, NTabs } from 'naive-ui'
import { NButton, NCollapse, NCollapseItem, NInput, NSelect, NTab, NTabs } from 'naive-ui'
import { Download, Search } from '@lucide/vue'
import { AppDialog, EmptyState } from '../../components/ui'
import { usePolling } from '../../composables/usePolling'
@@ -69,20 +71,20 @@ function exportReport() {
description="展示全项目已保存的 checkpoint 指标与完整时间线,不启动或恢复任务。"
wide
>
<NAlert type="info" :show-icon="false" class="mt-4 text-xs"
>后端指标按保存记录累计;耗时之和不等于实际墙钟耗时,“completed”也不代表图片或视频成功。生产任务状态请以资产页面为准。</NAlert
<ContextNotice type="info" :show-icon="false" class="mt-4 text-xs"
>后端指标按保存记录累计;耗时之和不等于实际墙钟耗时,“completed”也不代表图片或视频成功。生产任务状态请以资产页面为准。</ContextNotice
>
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
>{{ query.error.value }},当前保留上次数据。</NAlert
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
>{{ query.error.value }},当前保留上次数据。</ContextNotice
>
<NAlert
<ContextNotice
v-for="error in query.data.value?.errors"
:key="error"
role="alert"
type="error"
:show-icon="false"
class="mt-3"
>{{ error }}</NAlert
>{{ error }}</ContextNotice
>
<div class="mt-4 flex flex-wrap items-center justify-between gap-3">
<div class="flex flex-wrap items-center gap-4 text-sm">
@@ -1,7 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
import { NAlert, NButton, NProgress, NTag } from 'naive-ui'
import { X } from '@lucide/vue'
import { NButton, NProgress, NTag } from 'naive-ui'
import { LoaderCircle, X } from '@lucide/vue'
import { formatDate } from '../../lib/format'
import { executionPercentage, executionStageLabel } from './execution'
import type { WorkflowExecution } from './execution.types'
@@ -39,6 +41,8 @@ const scriptCreation = computed(() => props.execution?.workflowName === 'create-
const videoQuality = computed(() => props.execution?.workflowName === 'video-quality')
/** 首帧质量后台任务使用独立的通过与修复失败统计,不套用普通生图字段。 */
const keyframeQuality = computed(() => props.execution?.workflowName === 'keyframe-quality')
/** 首帧编辑复用质量工作流,最终回执不属于批量质量统计。 */
const keyframeEdit = computed(() => props.execution?.metadata?.action === 'edit-keyframe')
/** 只接受后端完整的质量计数,畸形或缺失结果不显示全成功。 */
const keyframeCounts = computed(() => {
const fields = ['targetCount', 'passed', 'repairFailed', 'failed'] as const
@@ -94,6 +98,7 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<div>
<div class="flex flex-wrap items-center gap-2">
<h3 class="text-sm font-semibold">{{ title }}</h3>
<LoaderCircle v-if="!finished" :size="14" class="animate-spin text-muted" aria-hidden="true" />
<NTag v-if="execution" size="small" :type="statusType" :bordered="false">{{ statusLabel }}</NTag>
</div>
<p v-if="execution" class="mt-2 text-xs text-muted">
@@ -132,17 +137,29 @@ function isInputMode(value: unknown, inputMode: string): boolean {
· 当前镜头 <code>{{ execution.currentResourceId }}</code></template
>
</p>
<NAlert v-if="execution.status === 'running' && showStatusHint" type="info" :show-icon="false" class="mt-3">
<ContextNotice
v-if="execution.status === 'running' && showStatusHint"
type="info"
:show-icon="false"
class="mt-3"
>
{{
videoQuality ? '系统会继续生成、检查并按需修复。' : '系统会继续处理剩余内容并保存已完成结果。'
}}可以离开或刷新页面,返回后会继续显示本次任务进度,请勿重复提交。
</NAlert>
<NAlert
</ContextNotice>
<ContextNotice
v-else-if="execution.status === 'completed' && showStatusHint"
:type="
keyframeQuality && (!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
? 'warning'
: 'success'
keyframeEdit
? result.passed === true
? 'success'
: result.validationSkipped === true
? 'info'
: 'warning'
: keyframeQuality &&
(!keyframeCounts || keyframeCounts.repairFailed + keyframeCounts.failed > 0)
? 'warning'
: 'success'
"
:show-icon="false"
class="mt-3"
@@ -150,8 +167,8 @@ function isInputMode(value: unknown, inputMode: string): boolean {
<p>
{{
scriptCreation
? '剧本创作任务已结束,页面正在重新读取剧本内容。'
: '本轮任务已结束,页面正在重新读取镜头资产状态。'
? '剧本创作任务已结束,可查看最新剧本内容。'
: '本轮任务已结束,可查看最新镜头资产状态。'
}}
</p>
<p v-if="videoQuality" class="mt-2 text-xs">
@@ -163,6 +180,16 @@ function isInputMode(value: unknown, inputMode: string): boolean {
输入规划:首帧模式 {{ inputPlanCounts.firstFrame }} · 全模态参考
{{ inputPlanCounts.omniReference }}
</p>
<p v-else-if="keyframeEdit" class="mt-2 text-xs">
{{
result.validationSkipped === true
? '编辑候选已生成,尚未进行质量校验。'
: result.passed === true
? '编辑结果质量通过。'
: '编辑结果未通过质量校验。'
}}
{{ result.primaryChanged === true ? '已更新主首帧。' : '主首帧未替换。' }}
</p>
<p v-else-if="keyframeQuality" class="mt-2 text-xs">
<template v-if="keyframeCounts"
>目标 {{ keyframeCounts.targetCount }} · 通过 {{ keyframeCounts.passed }} · 修复未通过
@@ -174,8 +201,8 @@ function isInputMode(value: unknown, inputMode: string): boolean {
共 {{ result.total ?? execution.total }} · 生成 {{ result.generated ?? execution.current }} · 跳过
{{ result.skipped ?? 0 }} · 阻塞 {{ result.blocked ?? 0 }} · 失败 {{ result.failed ?? 0 }}
</p>
</NAlert>
<NAlert v-else-if="execution.status === 'failed'" type="error" :show-icon="false" class="mt-3">
</ContextNotice>
<ContextNotice v-else-if="execution.status === 'failed'" type="error" :show-icon="false" class="mt-3">
<p>{{ execution.error || '制作任务执行失败。' }}</p>
<p class="mt-2 text-xs">
{{
@@ -184,15 +211,15 @@ function isInputMode(value: unknown, inputMode: string): boolean {
: '请先刷新相关资产状态,确认已成功的镜头;处理报错原因后,只对仍处于“可执行”的镜头重新提交。'
}}
</p>
</NAlert>
</ContextNotice>
<details class="mt-3 text-[10px] text-muted">
<summary class="cursor-pointer">任务详情</summary>
<p class="mt-2 break-all font-mono">任务编号 · {{ execution.id }}</p>
</details>
</template>
<NAlert v-if="error" type="error" :show-icon="false" class="mt-3">
<ContextNotice v-if="error" type="error" :show-icon="false" class="mt-3">
{{ error }}。任务可能仍在运行,请先重新读取状态;不要直接重复提交。
<NButton text class="ml-3" :loading="loading" @click="emit('refresh')">重试读取</NButton>
</NAlert>
</ContextNotice>
</section>
</template>
+50
View File
@@ -1,6 +1,7 @@
import { computed, onScopeDispose, reactive, ref, watch, type Ref } from 'vue'
import { usePolling } from '../../composables/usePolling'
import { workflowExecutionApi } from './execution-api'
import { useActionMessage } from '../../components/ui/useActionMessage'
const storagePrefix = 'short-drama:workflow-execution'
@@ -17,6 +18,8 @@ interface ExecutionActivity {
}
/** 活动状态按项目和工作流共同隔离。 */
const executionActivity = reactive<Record<string, ExecutionActivity>>({})
/** 同任务可能有页面和弹窗多个观察器,真实终态仅通知一次。 */
const announcedExecutions = new Set<string>()
/**
* 检查项目是否仍有已跟踪且未结束的后台任务。
@@ -46,6 +49,7 @@ export function executionStageLabel(stage: string | null) {
storyboardDirection: '生成导演设计',
storyboardVisualState: '生成即时状态',
keyframe_generation: '生成普通首帧',
editKeyframe: '编辑并检查首帧',
videoPrompt: '生成视频提示词',
breakdownRetry: '重试失败拆解任务',
breakdownResumeShots: '补齐分镜镜头',
@@ -93,6 +97,10 @@ function savedExecutionId(projectId: string, workflowName: string) {
/** 跟踪一个项目最近的持久化任务;刷新页面后从本地句柄恢复,状态仍从后端读取。 */
export function useWorkflowExecution(projectId: Ref<string>, workflowName: string) {
/** 状态反馈与应用其它操作共用消息层。 */
const message = useActionMessage()
/** 仅通知本会话观察到运行或主动启动的任务,不重放旧完成记录。 */
const observedActive = new Set<string>()
/** 卸载后仍保存原项目返回的句柄,但不再更新已销毁的观察器。 */
let disposed = false
onScopeDispose(() => {
@@ -155,6 +163,47 @@ export function useWorkflowExecution(projectId: Ref<string>, workflowName: strin
terminal.value = status === 'completed' || status === 'failed'
}
)
watch(
() => query.data.value,
record => {
if (!record || record.projectId !== projectId.value) return
if (record.status === 'pending' || record.status === 'running') {
observedActive.add(record.id)
return
}
if (!observedActive.has(record.id) || announcedExecutions.has(record.id) || !message) return
announcedExecutions.add(record.id)
if (record.status === 'failed') {
message.error(record.error || '后台任务失败,请查看任务记录。', { duration: 8000, closable: true })
return
}
const result = record.result ?? {}
if (record.metadata?.action === 'edit-keyframe') {
const content =
result.validationSkipped === true
? '首帧编辑候选已生成,请另行完成质量检查。'
: result.passed === true
? result.primaryChanged === true
? '编辑首帧已通过校验并设为主首帧。'
: '编辑首帧已通过校验,请核对主图状态。'
: '编辑首帧未通过校验,候选已保留。'
message[result.validationSkipped === true ? 'info' : result.passed === true ? 'success' : 'warning'](
content,
{ duration: 6000, closable: true }
)
return
}
const failures = ['failed', 'repairFailed', 'exhausted', 'providerFailed', 'submissionFailed'].some(
field => typeof result[field] === 'number' && Number(result[field]) > 0
)
message[failures ? 'warning' : 'info'](
failures
? '本轮任务已结束,部分结果未通过或执行失败,请查看任务记录。'
: '本轮后台任务已结束,请查看最新结果。',
{ duration: 5000, closable: true }
)
}
)
const active = computed(() => {
const activity = executionActivity[storageKey(projectId.value, workflowName)]
return activity?.id === executionId.value
@@ -171,6 +220,7 @@ export function useWorkflowExecution(projectId: Ref<string>, workflowName: strin
async function track(id: string, targetProjectId = projectId.value) {
if (typeof id !== 'string' || !id.trim()) throw new Error('后端未返回有效任务编号,请刷新状态,勿重复提交。')
if (!targetProjectId) return
observedActive.add(id)
if (typeof localStorage !== 'undefined') localStorage.setItem(storageKey(targetProjectId, workflowName), id)
if (executionActivity[storageKey(targetProjectId, workflowName)]?.id !== id)
executionActivity[storageKey(targetProjectId, workflowName)] = {
+29
View File
@@ -63,6 +63,35 @@ export function getOperation(projectId: string): Operation {
return operations[projectId]
}
/**
* 只让当前操作对应的按钮加载,项目内其它按钮继续使用禁用状态。
* @param operation 当前项目操作状态
* @param label 当前按钮实际提交的操作名称或唯一片段
* @returns 当前按钮是否对应运行中的请求
*/
export function isOperationRunning(operation: Operation, label: string) {
return operation.pending && !!label && operation.label.includes(label)
}
/**
* 按后端真实批量统计反馈部分失败,不把 HTTP 200 当作全部成功。
* @param result 后端已返回的批量统计
* @param label 当前批量操作名称
* @returns 适用于 NMessage 的结果级别和摘要
*/
export function batchResultNotice(
result: { generated: number; failed: number; blocked?: number },
label: string
): OperationNotice {
if (![result.generated, result.failed].every(value => Number.isSafeInteger(value) && value >= 0))
return { type: 'info', content: `${label}已返回,请查看详细回执。` }
const blocked = typeof result.blocked === 'number' && result.blocked > 0 ? result.blocked : 0
return {
type: result.failed > 0 || blocked > 0 ? 'warning' : 'success',
content: `${label}本轮处理结束:生成 ${result.generated} 项${result.failed ? `,失败 ${result.failed} 项` : ''}${blocked ? `,阻塞 ${blocked} 项` : ''}。`
}
}
/**
* 只提交一次,并按真实业务回执生成反馈;断网不自动重试。
* @param projectId 当前项目编号
+9 -18
View File
@@ -164,36 +164,27 @@ body {
max-height: min(24dvh, 160px);
overflow: hidden;
}
.workspace-feedback .n-alert + .n-alert {
margin-top: var(--app-content-gap);
/* 常驻业务说明仅使用紧凑文字,不再为旧提示框保留内边距。 */
.workspace-feedback .context-notice + .context-notice {
margin-top: 8px;
}
/* 页面级提示条统一为单行 44px,高度随长文换行自然增加;文字缩进与正文面板一致。 */
:is(.project-notices, .workspace-notice, .workspace-feedback) .n-alert,
.workspace-scroll-content > .n-alert {
padding: 0;
:is(.project-notices, .workspace-notice, .workspace-feedback) .context-notice {
margin-block: 0;
}
:is(.project-notices, .workspace-notice, .workspace-feedback) .n-alert-body,
.workspace-scroll-content > .n-alert .n-alert-body {
padding: 10px 20px;
line-height: 24px;
}
/* 行内下一步入口沿用提示行高,不额外撑高提示条。 */
:is(.project-notices, .workspace-notice, .workspace-feedback) .text-button,
.workspace-scroll-content > .n-alert .text-button {
:is(.project-notices, .workspace-notice, .workspace-feedback) .text-button {
padding-block: 0;
line-height: inherit;
}
/* 正文内的提示与筛选、列表共用模块间距,首项不重复叠加顶部留白。 */
.workspace-scroll-content > .n-alert {
.workspace-scroll-content > .context-notice {
margin-top: var(--app-content-gap);
}
.workspace-scroll-content > .n-alert:first-child {
.workspace-scroll-content > .context-notice:first-child {
margin-top: 0;
}
.overview-content {
padding-bottom: 8px;
}
/* 工作区正文统一使用 20px 模块节奏;面板内边距由公共类控制,业务页不再上下左右各写一套。 */
/* 工作区正文统一使用全局模块间距;面板内边距由公共类控制,业务页不再上下左右各写一套。 */
.workspace-section-stack {
display: flex;
flex-direction: column;