feat(short-drama-agent-front): 接入摄影审核与首帧制作

This commit is contained in:
GJ committed 2026-11-06 17:10:52 +08:00
1 parent 3503926d62
commit 751106985e
32 files changed
+1970 -153

No files matched your search

@@ -11,6 +11,7 @@ import { integerRule, sizeRules } from '../../../lib/form-rules'
import { computed, ref, watch } from 'vue'
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NInputNumber, NRadioButton, NRadioGroup } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { useKeyframeVision } from '../keyframe-vision'
import { allowedTextLines, validQualityInput } from '../quality'
import type { QualityAction, QualityInput, QualityTarget } from '../quality.types'
import { useQuality } from '../useQuality'
@@ -51,6 +52,13 @@ const { key, session, operation, execution, blocked, run } = useQuality(
},
id => emit('started', id)
)
/** 打开首帧质量弹窗时读取正式审核状态。 */
const visionKey = computed(() =>
open.value && props.target?.kind === 'keyframe' ? JSON.stringify([props.target.shotId, props.target.assetId]) : ''
)
const vision = useKeyframeVision(visionKey)
/** 有原参数时继续;没有原参数时保留只读核查。 */
const visionBlocked = computed(() => !!visionKey.value && vision.blocked.value)
/** 质量弹窗重新读取所选候选自身的权限,不以会话历史代替后端事实。 */
const videoKey = computed(() =>
open.value && props.target?.kind === 'video' ? JSON.stringify([props.target.shotId, props.target.assetId]) : ''
@@ -135,7 +143,7 @@ const input = computed<QualityInput>(() => ({
maxRepairAttempts: action.value === 'validate' ? 0 : (attempts.value ?? -1),
force: force.value,
episodeNo: props.target?.kind === 'batch' ? props.target.episodeNo : 1,
allowedTexts: allowedTextLines(texts.value),
allowedTexts: vision.resumeTexts.value ?? allowedTextLines(texts.value),
...(action.value === 'validate' || width.value === null ? {} : { width: width.value }),
...(action.value === 'validate' || height.value === null ? {} : { height: height.value })
}))
@@ -229,7 +237,15 @@ watch(
)
/** 付费入口保留明确确认,不因菜单选择或查看历史自动提交。 */
async function submit() {
if (!acknowledged.value || !valid.value || blocked.value || !repairAvailable.value) return
if (
!acknowledged.value ||
!valid.value ||
blocked.value ||
visionBlocked.value ||
!repairAvailable.value ||
(!!vision.resumeTexts.value && action.value !== 'validate')
)
return
acknowledged.value = false
await run(action.value, input.value)
}
@@ -358,8 +374,9 @@ const optionsExpanded = ref<string[]>(['options'])
</div>
<NFormItem class="mt-4 block" path="texts" label="额外允许的画面文字(一行一项,可留空)"
><NInput
v-model:value="texts"
:disabled="pending"
:value="vision.resumeTexts.value?.join('\n') ?? texts"
@update:value="texts = $event"
:disabled="pending || !!vision.resumeTexts.value"
type="textarea"
:autosize="{ minRows: 2, maxRows: 5 }"
:input-props="{ 'aria-label': '额外允许的画面文字' }"
@@ -427,11 +444,18 @@ const optionsExpanded = ref<string[]>(['options'])
@refresh="execution.query.refresh"
@dismiss="execution.dismiss"
/>
<p v-if="vision.state.value.resumable && !vision.resumeTexts.value" class="mt-3 text-xs text-muted">
此窗口没有原审核参数,暂不能安全继续。
</p>
<KeyframeValidationHistory
v-if="target?.kind === 'keyframe'"
v-if="open && target?.kind === 'keyframe'"
:project-id="projectId"
:shot-id="target.shotId"
:key="target.assetId"
:keyframe-id="target.assetId"
:disabled="disabled || pending"
initial-open
@reviewed="emit('changed')"
/>
<QualityResult v-if="session.receipt" :receipt="session.receipt" @locate="emit('locate', $event)" />
<NCollapse v-else-if="saved" class="mt-4" :default-expanded-names="['saved']"
@@ -457,9 +481,15 @@ const optionsExpanded = ref<string[]>(['options'])
<NButton
type="primary"
:loading="pending"
:disabled="blocked || !acknowledged || !repairAvailable"
:disabled="
blocked ||
visionBlocked ||
!acknowledged ||
!repairAvailable ||
(!!vision.resumeTexts.value && action !== 'validate')
"
@click="formRef?.validate(submit)"
>{{ label }}</NButton
>{{ vision.resumeTexts.value && action === 'validate' ? '继续原审核' : label }}</NButton
>
</div>
</div>