feat(short-drama-agent-front): 完善分镜审核与制作准备流程

This commit is contained in:
GJ committed 2026-10-19 21:59:22 +08:00
1 parent c4b43b9725
commit 1da56e0d46
72 files changed
+2801 -528

No files matched your search

@@ -4,7 +4,8 @@ import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHead
import { computed, onScopeDispose, ref, watch } from 'vue'
import { NButton, NFormItem, NSelect, NSpin } from 'naive-ui'
import { errorMessage } from '../../../lib/http'
import { ApiError, errorMessage } from '../../../lib/http'
import { showActionFeedback, useActionMessage } from '../../../components/ui/useActionMessage'
import { generationConfigApi } from '../api'
import type {
CreativeProfileAspectRatio,
@@ -33,15 +34,15 @@ const props = withDefaults(
const emit = defineEmits<{ saved: [profile: CreativeProfileInput]; busy: [saving: boolean] }>()
/** 成功保存后通知当前项目生成表单更新默认值。 */
const revision = useProjectGenerationRevision()
/** 保存结果复用全局消息层,读取失败仍保留可核对的正文状态。 */
const feedback = useActionMessage()
/** 配置和模型目录读取状态。 */
const loading = ref(false)
/** 配置保存状态。 */
const saving = ref(false)
/** 读取或保存错误。 */
/** 配置读取失败的可恢复状态,不用于保存反馈。 */
const error = ref('')
/** 真实保存结果提示。 */
const notice = ref('')
/** 后端支持的图片与视频模型目录。 */
const catalog = ref<GenerationModelCatalog | null>(null)
/** 当前项目的独立编辑草稿。 */
@@ -181,7 +182,6 @@ async function load() {
catalog.value = null
loading.value = true
error.value = ''
notice.value = ''
try {
const [nextCatalog, saved] = await Promise.all([
generationConfigApi.catalog(signal),
@@ -205,17 +205,17 @@ async function save() {
const input = creativeProfileDraft(profile.value)
saving.value = true
error.value = ''
notice.value = ''
try {
const saved = await generationConfigApi.saveProfile(projectId, input)
if (disposed || props.projectId !== projectId) return
if (saved.projectId !== projectId) throw new Error('保存结果与当前项目不匹配,请重新读取配置。')
profile.value = creativeProfileDraft(saved)
notice.value = '项目生成配置已保存,后续首帧和视频生成会继承此配置。'
showActionFeedback(feedback, '项目生成配置已保存,后续制作将使用此配置。', 'success')
revision.value++
emit('saved', profile.value)
} catch (cause) {
if (!disposed && props.projectId === projectId) error.value = errorMessage(cause)
if (!disposed && props.projectId === projectId)
showActionFeedback(feedback, errorMessage(cause), cause instanceof ApiError && cause.status === 409 ? 'warning' : 'error')
} finally {
saving.value = false
}
@@ -261,7 +261,6 @@ onScopeDispose(() => {
<ContextNotice v-if="validationIssues.length" type="warning" :show-icon="false" class="mb-3">
<p v-for="issue in validationIssues" :key="issue">{{ issue }}</p>
</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"