feat(short-drama-agent-front): 接入人工动作修订与视频版本权限
This commit is contained in:
1 parent
7a60db3ced
commit
fa76165960
38 files changed
+2003
-158
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { videoOperationAllowed } from '../video-permissions'
|
||||
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
|
||||
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
@@ -21,7 +22,7 @@ import { runOperation } from '../../workflows/operations'
|
||||
import { productionApi } from '../api'
|
||||
import { qualityApi } from '../quality-api'
|
||||
import { isActiveVideo, primaryKeyframe, primaryVideo, productionStatusLabel, videoRecordedValidation } from '../model'
|
||||
import { productionIssueText, productionMessage } from '../production-messages'
|
||||
import { productionIssueText, productionMessage, videoInputStaleReason } from '../production-messages'
|
||||
import type {
|
||||
GenerateKeyframeInput,
|
||||
KeyframeReadinessItem,
|
||||
@@ -45,7 +46,7 @@ import KeyframeValidationHistory from './KeyframeValidationHistory.vue'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import ModelCapabilities from './ModelCapabilities.vue'
|
||||
import type { QualityTarget } from '../quality.types'
|
||||
import { sessionKeyframePassed, sessionVideoValidation } from '../quality'
|
||||
import { clearVideoConflict, clearVideoQualification, sessionKeyframePassed, sessionVideoValidation } from '../quality'
|
||||
import { useProjectGenerationRevision } from '../../generation-config/context'
|
||||
import { generationConfigApi } from '../../generation-config/api'
|
||||
import type {
|
||||
@@ -210,9 +211,23 @@ const videoCandidatesOpen = ref(false)
|
||||
const videoHistoryOpen = ref(false)
|
||||
/** 当前查看记录的视频 ID,按资产隔离主视频和候选。 */
|
||||
const videoHistoryId = ref('')
|
||||
/** 记录弹窗中的视频是否为需要更新的当前主视频。 */
|
||||
const videoHistoryStale = computed(() => videoHistoryId.value === currentVideo.value?.id && videoStale.value)
|
||||
/** 历史弹窗按用户选择的候选独立判断过期,不套用主视频结论。 */
|
||||
const videoHistoryAsset = computed(() => videos.value.find(item => item.id === videoHistoryId.value))
|
||||
/** 当前选中视频的过期终态独立于主视频判断。 */
|
||||
const videoHistoryStale = computed(
|
||||
() =>
|
||||
!!videoHistoryAsset.value?.motionPlanStale ||
|
||||
videoHistoryAsset.value?.qualityTerminalStatus === 'stale_motion_plan' ||
|
||||
(videoHistoryId.value === currentVideo.value?.id && videoStale.value)
|
||||
)
|
||||
/** 质量操作绑定当前视频的权限,每次刷新列表都会更新。 */
|
||||
const qualityVideo = computed(() => {
|
||||
const target = qualityTarget.value
|
||||
return target?.kind === 'video' ? (videos.value.find(item => item.id === target.assetId) ?? null) : null
|
||||
})
|
||||
const qualityTarget = ref<QualityTarget | null>(null)
|
||||
/** 修复入口打开面板时选择对应动作,仍需重新确认费用。 */
|
||||
const qualityAction = ref<'validate' | 'repair'>('validate')
|
||||
const specsOpen = ref(false)
|
||||
const generationCatalog = ref<GenerationModelCatalog | null>(null)
|
||||
const generationCatalogError = ref('')
|
||||
@@ -255,8 +270,10 @@ watch(
|
||||
* 从实际候选打开质量面板,先关闭候选弹窗,避免遮挡费用与操作确认。
|
||||
* @param kind 需要检查的资产种类
|
||||
* @param assetId 当前选中的真实资产编号
|
||||
* @param repair 是否直接进入修复选项,仍须确认费用
|
||||
*/
|
||||
function openQuality(kind: 'keyframe' | 'video', assetId: string) {
|
||||
function openQuality(kind: 'keyframe' | 'video', assetId: string, repair = false) {
|
||||
qualityAction.value = repair ? 'repair' : 'validate'
|
||||
candidatesOpen.value = false
|
||||
videoCandidatesOpen.value = false
|
||||
qualityTarget.value = {
|
||||
@@ -354,7 +371,31 @@ const videoCandidatesWidth = computed(() => candidateDialogWidth(videoCandidates
|
||||
function keyframePassed(assetId: string) {
|
||||
return sessionKeyframePassed(props.projectId, props.shot.shotId, assetId)
|
||||
}
|
||||
const videoStale = computed(() => !!props.videoReadiness?.primaryVideoStale)
|
||||
/** 主视频过期由资产终态及 readiness 共同说明。 */
|
||||
const videoStale = computed(
|
||||
() =>
|
||||
!!props.videoReadiness?.primaryVideoStale ||
|
||||
!!currentVideo.value?.motionPlanStale ||
|
||||
currentVideo.value?.qualityTerminalStatus === 'stale_motion_plan'
|
||||
)
|
||||
/** 后端具体原因优先,缺省时使用兼容概括说明。 */
|
||||
const videoStaleReason = computed(
|
||||
() =>
|
||||
props.videoReadiness?.primaryVideoStaleReasons?.join(';') ||
|
||||
currentVideo.value?.staleReason ||
|
||||
videoInputStaleReason
|
||||
)
|
||||
/** 权限或版本变化后撤销已失效的本会话结论与切换确认。 */
|
||||
watch(videos, items => {
|
||||
for (const item of items) {
|
||||
if (item.motionPlanStale || item.qualityTerminalStatus === 'stale_motion_plan') {
|
||||
clearVideoQualification(props.projectId, item.shotId, item.id)
|
||||
if (confirmingVideo.value === item.id) confirmingVideo.value = ''
|
||||
}
|
||||
}
|
||||
if (confirmingVideo.value && !items.find(item => item.id === confirmingVideo.value)?.canSetPrimary)
|
||||
confirmingVideo.value = ''
|
||||
})
|
||||
|
||||
watch(key, () => {
|
||||
qualityOpen.value = false
|
||||
@@ -467,22 +508,21 @@ async function refreshActiveVideo() {
|
||||
await refreshAll()
|
||||
}
|
||||
|
||||
/** 切换主视频只接受已完成并具有持久化地址的候选。 */
|
||||
/** 根据本候选后端权限切换主视频;冲突后撤销资格并重新读取真实资产。 */
|
||||
async function setPrimaryVideo() {
|
||||
const videoId = confirmingVideo.value
|
||||
if (assetBlocked.value || !videoId) return
|
||||
const video = videos.value.find(item => item.id === videoId)
|
||||
if (
|
||||
!video ||
|
||||
video.status !== 'completed' ||
|
||||
!video.videoUrl ||
|
||||
sessionVideoValidation(props.projectId, video.shotId, video.id)?.passed !== true
|
||||
)
|
||||
return
|
||||
if (!video || video.status !== 'completed' || !video.videoUrl || !videoOperationAllowed(video, 'primary')) return
|
||||
const shotId = props.shot.shotId
|
||||
confirmingVideo.value = ''
|
||||
await runOperation(props.projectId, `设置镜头 ${props.shot.shotNo} 主视频`, async () => {
|
||||
const result = await productionApi.setPrimaryVideo(shotId, videoId)
|
||||
const result = await productionApi
|
||||
.setPrimaryVideo(shotId, videoId, video.currentMotionPlanRevisionId)
|
||||
.catch(cause => {
|
||||
clearVideoConflict(cause, props.projectId, shotId, videoId)
|
||||
throw cause
|
||||
})
|
||||
if (!result || result.id !== videoId || !result.isPrimary || result.status !== 'completed')
|
||||
throw new Error('接口未确认主视频切换。')
|
||||
})
|
||||
@@ -664,8 +704,8 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:messages="videoIssueMessages"
|
||||
/>
|
||||
</div>
|
||||
<!-- 以下是主视频素材变化说明模块,与此前画面检查结论分别说明 -->
|
||||
<p v-if="videoStale" class="mt-3 text-xs text-muted">首帧或参考图已变化,请重新生成视频。</p>
|
||||
<!-- 以下是主视频输入或动作规划版本变化说明模块,与此前画面检查结论分别说明 -->
|
||||
<p v-if="videoStale" class="mt-3 text-xs text-muted">{{ videoStaleReason }},请重新生成视频。</p>
|
||||
<!-- 以下是主视频展示模块,位于素材引用之前,其它记录在候选弹窗中查看 -->
|
||||
<div v-if="currentVideo" class="video-grid mt-4">
|
||||
<VideoCard
|
||||
@@ -680,6 +720,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
"
|
||||
:confirming="false"
|
||||
@quality="openQuality('video', currentVideo.id)"
|
||||
@repair="openQuality('video', currentVideo.id, true)"
|
||||
@history="openVideoHistory(currentVideo.id)"
|
||||
/>
|
||||
</div>
|
||||
@@ -875,8 +916,16 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
>
|
||||
</AppDialog>
|
||||
<AppDialog v-model:open="motionOpen" title="镜头动作与视线" wide>
|
||||
<div v-if="motionOpen" class="space-y-6">
|
||||
<MotionPlanPanel :key="shot.shotId" :shot-id="shot.shotId" :revision="savedPrompt?.updatedAt" />
|
||||
<!-- 以下是与分镜详情一致的动作和视线模块间距 -->
|
||||
<div v-if="motionOpen" class="workspace-section-stack workspace-section-stack-spacious">
|
||||
<MotionPlanPanel
|
||||
:key="shot.shotId"
|
||||
:shot-id="shot.shotId"
|
||||
:project-id="projectId"
|
||||
:disabled="assetBlocked"
|
||||
:revision="savedPrompt?.updatedAt"
|
||||
@changed="refreshAll"
|
||||
/>
|
||||
<SpatialBindingsPanel
|
||||
:key="shot.shotId"
|
||||
:project-id="projectId"
|
||||
@@ -898,6 +947,8 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
v-model:open="qualityOpen"
|
||||
:project-id="projectId"
|
||||
:target="qualityTarget"
|
||||
:video="qualityVideo"
|
||||
:initial-action="qualityAction"
|
||||
:disabled="assetBlocked"
|
||||
@changed="refreshAll"
|
||||
@started="emit('qualityStarted', $event)"
|
||||
@@ -949,12 +1000,13 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:item="item"
|
||||
:shot-no="shot.shotNo"
|
||||
:duration-seconds="shot.durationSeconds"
|
||||
:stale="false"
|
||||
:stale="item.motionPlanStale || item.qualityTerminalStatus === 'stale_motion_plan'"
|
||||
:blocked="assetBlocked"
|
||||
:validation-passed="sessionVideoValidation(projectId, item.shotId, item.id)?.passed ?? null"
|
||||
:recorded-validation-passed="videoRecordedValidation(videoQualityStatus, item.shotId, item.id)"
|
||||
:confirming="confirmingVideo === item.id"
|
||||
@quality="openQuality('video', item.id)"
|
||||
@repair="openQuality('video', item.id, true)"
|
||||
@history="openVideoHistory(item.id)"
|
||||
@select="confirmingVideo = item.id"
|
||||
@confirm="setPrimaryVideo"
|
||||
@@ -976,6 +1028,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:shot-id="shot.shotId"
|
||||
:video-id="videoHistoryId"
|
||||
:stale="videoHistoryStale"
|
||||
:stale-reason="videoHistoryId === currentVideo?.id ? videoStaleReason : videoHistoryAsset?.staleReason"
|
||||
/>
|
||||
</AppDialog>
|
||||
<AppDialog
|
||||
|
||||
Reference in new issue
Block a user