feat: show saved video prompt inline on production page
This commit is contained in:
1 parent
41df65ab26
commit
6d569e828e
1 file changed
+29
-1
@@ -69,6 +69,11 @@ const query = usePolling(
|
||||
},
|
||||
false
|
||||
)
|
||||
/** 单独读取已保存的提示词,查询失败不影响首帧和视频资产展示。 */
|
||||
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 keyframes = computed(() => query.data.value?.keyframes ?? [])
|
||||
const videos = computed(() => query.data.value?.videos ?? [])
|
||||
const videoQualityStatus = computed(() => query.data.value?.qualityStatus ?? null)
|
||||
@@ -153,7 +158,7 @@ function safeVideoUrl(value: string | null): string | null {
|
||||
|
||||
/** 重新读取单镜头资产,并通知父页刷新项目就绪状态。 */
|
||||
async function refreshAll() {
|
||||
await query.refresh()
|
||||
await Promise.all([query.refresh(), promptQuery.refresh()])
|
||||
emit('changed')
|
||||
}
|
||||
|
||||
@@ -315,6 +320,29 @@ async function inspectSpecs() {
|
||||
{{ issueLabel(issue.code) }}:{{ issue.reason }}
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="savedPrompt?.videoPrompt" class="surface-inset mt-4 p-4" aria-label="本镜视频提示词">
|
||||
<p class="text-xs font-medium">本镜视频提示词</p>
|
||||
<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>
|
||||
<p class="mt-2 whitespace-pre-wrap break-words text-xs leading-6 text-muted">
|
||||
{{ savedPrompt.negativePrompt }}
|
||||
</p>
|
||||
</template>
|
||||
<p v-if="promptReadiness?.stalePrompt" class="mt-3 text-xs text-danger">
|
||||
此提示词已过期,请重新生成后再制作视频。
|
||||
</p>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
</NAlert>
|
||||
<div class="production-stage-actions">
|
||||
<ConfirmAction
|
||||
:label="promptReadiness?.status === 'skipped' ? '重新生成本镜提示词' : '生成本镜提示词'"
|
||||
|
||||
Reference in new issue
Block a user