style: 优化单次生成设置布局
This commit is contained in:
1 parent
7691346132
commit
90c67e1aa8
5 files changed
+244
-95
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import ProviderInputInspector from './ProviderInputInspector.vue'
|
||||
import { NAlert, NButton, NCollapse, NCollapseItem, NTag } from 'naive-ui'
|
||||
import { NAlert, NButton, NCollapse, NCollapseItem, NSelect, NTag } from 'naive-ui'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { ExternalLink, ImagePlus, RefreshCw } from '@lucide/vue'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
@@ -38,7 +38,11 @@ import ModelCapabilities from './ModelCapabilities.vue'
|
||||
import type { QualityTarget } from '../quality.types'
|
||||
import { sessionKeyframePassed, sessionVideoValidation } from '../quality'
|
||||
import { generationConfigApi } from '../../generation-config/api'
|
||||
import type { CreativeProfileAspectRatio, GenerationModelCatalog, GenerationOptions } from '../../generation-config/types'
|
||||
import type {
|
||||
CreativeProfileAspectRatio,
|
||||
GenerationModelCatalog,
|
||||
GenerationOptions
|
||||
} from '../../generation-config/types'
|
||||
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
|
||||
|
||||
/** 单镜头生产面板只负责正式资产,不修改上游导演设计与即时状态。 */
|
||||
@@ -86,9 +90,7 @@ const query = usePolling(
|
||||
)
|
||||
/** 单独读取已保存的提示词,查询失败不影响首帧和视频资产展示。 */
|
||||
const promptQuery = usePolling(key, (shotId, signal) => storyboardApi.videoPrompt(shotId, signal), false)
|
||||
const savedPrompt = computed(() =>
|
||||
promptQuery.data.value?.shotId === key.value ? promptQuery.data.value : null
|
||||
)
|
||||
const savedPrompt = computed(() => (promptQuery.data.value?.shotId === key.value ? promptQuery.data.value : null))
|
||||
/** 当前视频生成规格的首帧和主体参考图,独立查询避免影响资产列表。 */
|
||||
const videoInputQuery = usePolling(key, (shotId, signal) => productionApi.videoGenerationSpec(shotId, signal), false)
|
||||
const currentVideoInput = computed(() =>
|
||||
@@ -178,9 +180,7 @@ const canGenerateVideo = computed(
|
||||
(!currentKeyframe.value || keyframePassed(currentKeyframe.value.id) !== false)
|
||||
)
|
||||
const keyframeStale = computed(() => !!props.keyframeReadiness?.primaryKeyframeStale)
|
||||
const keyframeCandidates = computed(() =>
|
||||
keyframes.value.filter(item => item.id !== currentKeyframe.value?.id)
|
||||
)
|
||||
const keyframeCandidates = computed(() => keyframes.value.filter(item => item.id !== currentKeyframe.value?.id))
|
||||
/** 质量历史尚无 GET;只消费当前会话中该候选的真实校验结果。 */
|
||||
function keyframePassed(assetId: string) {
|
||||
return sessionKeyframePassed(props.projectId, props.shot.shotId, assetId)
|
||||
@@ -389,9 +389,7 @@ async function inspectSpecs() {
|
||||
<p v-else-if="promptQuery.loading.value" role="status" class="mt-4 text-xs text-muted">
|
||||
正在读取视频提示词…
|
||||
</p>
|
||||
<p v-else-if="!promptQuery.error.value" class="mt-4 text-xs text-muted">
|
||||
尚未生成本镜视频提示词。
|
||||
</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">
|
||||
提示词读取失败:{{ promptQuery.error.value }}
|
||||
<NButton text size="small" @click="promptQuery.refresh">重试</NButton>
|
||||
@@ -441,9 +439,7 @@ async function inspectSpecs() {
|
||||
@quality="openQuality('keyframe', currentKeyframe.id)"
|
||||
/>
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">
|
||||
尚无已确认主首帧。请生成候选,完成质量检查后再设为主首帧。
|
||||
</p>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无已确认主首帧。请生成候选,完成质量检查后再设为主首帧。</p>
|
||||
<NAlert
|
||||
v-if="currentKeyframe && keyframePassed(currentKeyframe.id) === false"
|
||||
type="error"
|
||||
@@ -516,7 +512,11 @@ async function inspectSpecs() {
|
||||
<div class="min-w-0 p-2 text-center text-xs">
|
||||
<p class="font-medium">视频输入首帧</p>
|
||||
<p class="mt-1 text-[11px] text-muted">
|
||||
{{ currentVideoInput.providerInputKeyframe.source === 'provider_variant' ? '模型专用变体' : '当前主首帧' }}
|
||||
{{
|
||||
currentVideoInput.providerInputKeyframe.source === 'provider_variant'
|
||||
? '模型专用变体'
|
||||
: '当前主首帧'
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
@@ -534,7 +534,9 @@ async function inspectSpecs() {
|
||||
/>
|
||||
</div>
|
||||
<div class="min-w-0 p-2 text-center text-xs">
|
||||
<p class="truncate font-medium" :title="reference.subjectName">{{ reference.subjectName }}</p>
|
||||
<p class="truncate font-medium" :title="reference.subjectName">
|
||||
{{ reference.subjectName }}
|
||||
</p>
|
||||
<p class="mt-1 truncate text-[11px] text-muted" :title="reference.subjectFormName">
|
||||
{{ reference.subjectFormName }}
|
||||
</p>
|
||||
@@ -547,8 +549,14 @@ async function inspectSpecs() {
|
||||
<div v-else class="mt-4 text-xs text-muted">
|
||||
<p>当前生成规格尚未就绪,请检查视频提示词、主首帧与主体参考图。</p>
|
||||
<p v-if="videoInputQuery.error.value" class="mt-2 break-words">{{ videoInputQuery.error.value }}</p>
|
||||
<NButton v-if="videoInputQuery.error.value" text size="small" class="mt-2"
|
||||
@click="videoInputQuery.refresh">重新读取</NButton>
|
||||
<NButton
|
||||
v-if="videoInputQuery.error.value"
|
||||
text
|
||||
size="small"
|
||||
class="mt-2"
|
||||
@click="videoInputQuery.refresh"
|
||||
>重新读取</NButton
|
||||
>
|
||||
</div>
|
||||
</section>
|
||||
<NAlert
|
||||
@@ -648,36 +656,48 @@ async function inspectSpecs() {
|
||||
<p v-if="videos.some(item => !item.isPrimary)" class="mt-3 text-xs text-muted">
|
||||
质量链状态来自后端持久化记录;手动晋升候选仍需在当前页面完成一次视觉校验。自动质量任务通过后会直接更新主视频。
|
||||
</p>
|
||||
<section v-if="generationCatalog" class="surface-inset mt-4 p-4" aria-label="本次视频生成模型设置">
|
||||
<p class="text-xs font-medium">本次生成设置</p>
|
||||
<p class="mt-1 text-xs text-muted">仅覆盖当前镜头本次生成,不修改项目默认模型。</p>
|
||||
<GenerationModelControls
|
||||
class="mt-4"
|
||||
type="video"
|
||||
:catalog="generationCatalog"
|
||||
:provider="videoProvider"
|
||||
:options="videoGenerationOptions"
|
||||
:aspect-ratio="projectAspectRatio"
|
||||
:disabled="assetBlocked"
|
||||
@update:provider="videoProvider = $event"
|
||||
@update:options="videoGenerationOptions = $event"
|
||||
/>
|
||||
<div class="mt-3">
|
||||
<p class="mb-2 text-xs font-medium">输入模式</p>
|
||||
<NSelect
|
||||
:value="videoInputModeOverride"
|
||||
<section
|
||||
v-if="generationCatalog"
|
||||
class="generation-settings-panel surface-inset mt-4"
|
||||
aria-label="本次视频生成模型设置"
|
||||
>
|
||||
<div class="generation-settings-content">
|
||||
<div>
|
||||
<h6 class="text-sm font-medium">本次生成设置</h6>
|
||||
<p class="mt-1 text-[11px] leading-5 text-muted">
|
||||
仅覆盖当前镜头本次生成,不修改项目默认模型。
|
||||
</p>
|
||||
</div>
|
||||
<GenerationModelControls
|
||||
class="mt-5"
|
||||
type="video"
|
||||
:catalog="generationCatalog"
|
||||
:provider="videoProvider"
|
||||
:options="videoGenerationOptions"
|
||||
:aspect-ratio="projectAspectRatio"
|
||||
:disabled="assetBlocked"
|
||||
:options="[
|
||||
{
|
||||
label: `自动(推荐:${videoInputPlan?.inputMode === 'omni_reference' ? '全模态参考' : '首帧模式'})`,
|
||||
value: 'auto'
|
||||
},
|
||||
{ label: '首帧模式', value: 'first_frame' },
|
||||
{ label: '全模态参考', value: 'omni_reference' }
|
||||
]"
|
||||
@update:value="videoInputModeOverride = $event"
|
||||
@update:provider="videoProvider = $event"
|
||||
@update:options="videoGenerationOptions = $event"
|
||||
/>
|
||||
<p class="mt-1 text-xs text-muted">自动模式遵循后端 Planner;手动选择只影响当前镜头本次生成。</p>
|
||||
<div class="generation-input-mode">
|
||||
<p class="generation-input-mode-label">输入模式</p>
|
||||
<NSelect
|
||||
:value="videoInputModeOverride"
|
||||
:disabled="assetBlocked"
|
||||
:options="[
|
||||
{
|
||||
label: `自动(推荐:${videoInputPlan?.inputMode === 'omni_reference' ? '全模态参考' : '首帧模式'})`,
|
||||
value: 'auto'
|
||||
},
|
||||
{ label: '首帧模式', value: 'first_frame' },
|
||||
{ label: '全模态参考', value: 'omni_reference' }
|
||||
]"
|
||||
@update:value="videoInputModeOverride = $event"
|
||||
/>
|
||||
<p class="mt-1.5 text-[11px] leading-5 text-muted">
|
||||
自动模式遵循后端 Planner;手动选择只影响当前镜头本次生成。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<NAlert v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-4 text-xs">
|
||||
@@ -853,11 +873,26 @@ async function inspectSpecs() {
|
||||
.production-video {
|
||||
@apply block w-full aspect-square bg-[#080808] object-contain;
|
||||
}
|
||||
.generation-settings-panel {
|
||||
@apply p-5;
|
||||
}
|
||||
.generation-settings-content {
|
||||
@apply w-full max-w-[1120px];
|
||||
}
|
||||
.generation-input-mode {
|
||||
@apply mt-5 w-full max-w-[550px];
|
||||
}
|
||||
.generation-input-mode-label {
|
||||
@apply mb-[7px] text-xs font-medium leading-5;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.keyframe-grid,
|
||||
.video-input-grid,
|
||||
.video-grid {
|
||||
@apply grid-cols-[repeat(2,_minmax(0,_1fr))];
|
||||
}
|
||||
.generation-settings-panel {
|
||||
@apply p-4;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user