feat(short-drama-agent-front): 接入图片持续授权与视频费用审计
This commit is contained in:
1 parent
3915566994
commit
1e9ef33d1d
39 files changed
+3442
-51
No files matched your search
@@ -51,10 +51,15 @@ const directionSummary = computed(() =>
|
||||
.join(' · ')
|
||||
: ''
|
||||
)
|
||||
/** 本次目录与模型参数仅用于首帧。 */
|
||||
const generationCatalog = ref<GenerationModelCatalog | null>(null)
|
||||
/** 模型读取错误。 */
|
||||
const generationCatalogError = ref('')
|
||||
/** 实际项目及镜头配置解析后的模型。 */
|
||||
const imageProvider = ref('')
|
||||
/** 本次明确参数。 */
|
||||
const imageGenerationOptions = ref<GenerationOptions>({})
|
||||
/** 项目画幅。 */
|
||||
const projectAspectRatio = ref<CreativeProfileAspectRatio>('9:16')
|
||||
/** 预览和生成复用当前请求字段,生成时再附加版本及候选标记。 */
|
||||
const generationInput = computed(() => ({
|
||||
@@ -65,6 +70,8 @@ const generationInput = computed(() => ({
|
||||
const {
|
||||
preview,
|
||||
acknowledged,
|
||||
requiresCostConfirmation,
|
||||
chargeNotice,
|
||||
loading,
|
||||
submitting,
|
||||
error,
|
||||
@@ -75,6 +82,12 @@ const {
|
||||
submit: submitPreview
|
||||
} = useImageGenerationPreview({
|
||||
open,
|
||||
chargeContext: () => ({
|
||||
projectId: props.projectId,
|
||||
scope: 'keyframe',
|
||||
targetId: props.shotId,
|
||||
exactPreview: true
|
||||
}),
|
||||
recoveryTarget: () => (props.shotId ? 'keyframe:' + props.shotId : ''),
|
||||
previousCandidateIds: () => props.previousCandidateIds,
|
||||
target: () => JSON.stringify([props.shotId, props.direction, props.visualState]),
|
||||
@@ -106,16 +119,26 @@ watch(
|
||||
generationCatalogError.value = ''
|
||||
imageProvider.value = ''
|
||||
try {
|
||||
const [catalog, profile] = await Promise.all([
|
||||
const [catalog, profile, resolved] = await Promise.all([
|
||||
generationConfigApi.catalog(controller.signal),
|
||||
generationConfigApi.profile(projectId, controller.signal)
|
||||
generationConfigApi.profile(projectId, controller.signal),
|
||||
generationConfigApi.resolve(
|
||||
projectId,
|
||||
'image',
|
||||
{
|
||||
target: { targetType: 'shot', targetId: props.shotId }
|
||||
},
|
||||
controller.signal
|
||||
)
|
||||
])
|
||||
if (controller.signal.aborted) return
|
||||
if (!resolved.provider || !resolved.model || !resolved.options)
|
||||
throw new Error('当前镜头模型配置不完整,请重新读取。')
|
||||
generationCatalog.value = catalog
|
||||
projectAspectRatio.value = profile?.aspectRatio ?? '9:16'
|
||||
imageProvider.value = profile?.imageProvider || catalog.defaults.imageProvider
|
||||
imageProvider.value = resolved.provider
|
||||
const selected = catalog.images.find(item => item.provider === imageProvider.value)
|
||||
imageGenerationOptions.value = { ...selected?.defaults, ...profile?.imageOptions }
|
||||
imageGenerationOptions.value = { ...selected?.defaults, ...resolved.options }
|
||||
} catch (cause) {
|
||||
if (!controller.signal.aborted) generationCatalogError.value = errorMessage(cause)
|
||||
}
|
||||
@@ -209,7 +232,9 @@ watch(
|
||||
/>
|
||||
<!-- 以下是正式画幅、尺寸及连续性诊断 -->
|
||||
<KeyframePreviewChecks v-if="preview" :preview="preview" class="mt-3" />
|
||||
<p v-if="chargeNotice" class="text-sm text-muted" role="status">{{ chargeNotice }}</p>
|
||||
<NCheckbox
|
||||
v-if="requiresCostConfirmation"
|
||||
id="confirm-keyframe-cost"
|
||||
v-model:checked="acknowledged"
|
||||
:disabled="!preview || preview.specConsistencySummary?.blocking || submitting || !!recoveryNotice"
|
||||
|
||||
Reference in new issue
Block a user