feat(short-drama-agent-front): 完善镜头定位与项目配置

This commit is contained in:
GJ committed 2026-10-08 19:45:26 +08:00
1 parent 470b52e26d
commit 5b134207b8
66 files changed
+2042 -984

No files matched your search

@@ -1,7 +1,7 @@
<script setup lang="ts">
import ProviderInputInspector from './ProviderInputInspector.vue'
import { NAlert, NButton, NCollapse, NCollapseItem, NSelect, NTag } from 'naive-ui'
import { computed, onMounted, ref, watch } from 'vue'
import { computed, ref, watch } from 'vue'
import { ExternalLink, ImagePlus, RefreshCw } from '@lucide/vue'
import { AssetImage, StatusBadge } from '../../../components/ui'
import { usePolling } from '../../../composables/usePolling'
@@ -39,6 +39,7 @@ import { AppDialog } from '../../../components/ui'
import ModelCapabilities from './ModelCapabilities.vue'
import type { QualityTarget } from '../quality.types'
import { sessionKeyframePassed, sessionVideoValidation } from '../quality'
import { useProjectGenerationRevision } from '../../generation-config/context'
import { generationConfigApi } from '../../generation-config/api'
import type {
CreativeProfileAspectRatio,
@@ -156,25 +157,35 @@ const videoGenerationOptions = ref<GenerationOptions>({})
const videoInputModeOverride = ref<'auto' | 'first_frame' | 'omni_reference'>('auto')
const projectAspectRatio = ref<CreativeProfileAspectRatio>('9:16')
/** 单镜手动生成默认继承项目配置,用户修改只作用于本次请求。 */
onMounted(async () => {
try {
const [catalog, profile] = await Promise.all([
generationConfigApi.catalog(),
generationConfigApi.profile(props.projectId)
])
generationCatalog.value = catalog
projectAspectRatio.value = profile?.aspectRatio ?? '9:16'
videoProvider.value = profile?.videoProvider || catalog.defaults.videoProvider
const selected = catalog.videos.find(item => item.provider === videoProvider.value)
videoGenerationOptions.value = {
...selected?.defaults,
...profile?.videoOptions
/** 项目配置成功保存后同步当前单镜头默认参数。 */
const generationRevision = useProjectGenerationRevision()
/** 单镜手动生成默认继承项目配置,用户修改只作用于本次请求;取消旧项目响应。 */
watch(
[() => props.projectId, generationRevision],
async ([projectId], _previous, onCleanup) => {
const controller = new AbortController()
onCleanup(() => controller.abort())
generationCatalogError.value = ''
try {
const [catalog, profile] = await Promise.all([
generationConfigApi.catalog(controller.signal),
generationConfigApi.profile(projectId, controller.signal)
])
if (controller.signal.aborted) return
generationCatalog.value = catalog
projectAspectRatio.value = profile?.aspectRatio ?? '9:16'
videoProvider.value = profile?.videoProvider || catalog.defaults.videoProvider
const selected = catalog.videos.find(item => item.provider === videoProvider.value)
videoGenerationOptions.value = {
...selected?.defaults,
...profile?.videoOptions
}
} catch (cause) {
if (!controller.signal.aborted) generationCatalogError.value = errorMessage(cause)
}
} catch (cause) {
generationCatalogError.value = errorMessage(cause)
}
})
},
{ immediate: true }
)
/** 从实际候选打开质量面板,保留单镜头主操作。 */
function openQuality(kind: 'keyframe' | 'video', assetId: string) {
@@ -385,15 +396,6 @@ async function inspectSpecs() {
:items="[{ key: 'specs', label: '检查生成规格与模型限制', disabled: inspecting }]"
@select="inspectSpecs"
/>
<NButton
:disabled="query.loading.value"
@click="refreshAll"
quaternary
class="icon-button"
aria-label="刷新资产"
title="刷新资产"
><RefreshCw :size="16" :class="{ 'animate-spin': query.loading.value }" />
</NButton>
</div>
</div>
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"