feat(short-drama-agent-front): 接入人工动作修订与视频版本权限

This commit is contained in:
GJ committed 2026-10-14 13:44:02 +08:00
1 parent 7a60db3ced
commit fa76165960
38 files changed
+2003 -158

No files matched your search

+20 -14
View File
@@ -1,3 +1,4 @@
import { videoOperationAllowed } from './video-permissions'
import { computed, onScopeDispose, watch } from 'vue'
import { useWorkflowExecution } from '../workflows/execution'
import { isQualityBatchResult } from './quality'
@@ -8,11 +9,12 @@ import { productionApi } from './api'
import { qualityApi } from './quality-api'
import {
isVisualValidation,
clearVideoQualification,
clearVideoConflict,
qualityKey,
qualitySession,
qualityTargets,
validQualityInput,
sessionVideoValidation
validQualityInput
} from './quality'
import type { QualityAction, QualityInput, QualityReceipt, QualityTarget, RepairAttempt } from './quality.types'
@@ -212,17 +214,20 @@ export function useQuality(
video.durationSeconds <= 0
)
throw new Error('视频未完成、缺少视频地址或有效时长,不能执行抽样校验。')
if (video.motionPlanStale || video.qualityTerminalStatus === 'stale_motion_plan')
clearVideoQualification(projectId, target.shotId, target.assetId)
if (!videoOperationAllowed(video, action === 'repair' ? 'repair' : 'validate'))
throw new Error(video.staleReason || '后端当前不允许此候选执行所选质量操作,请刷新权限。')
if (action === 'repair') {
if (sessionVideoValidation(projectId, target.shotId, target.assetId)?.passed !== false)
throw new Error('请先完成视频质量校验;只有未通过的视频才能创建修复候选。')
if (videos.some(item => ['pending', 'queued', 'running'].includes(item.status)))
throw new Error('此镜头仍有活动视频任务,请结束后再修复。')
if (!stillCurrent()) throw new Error('已离开原操作目标,未提交质量任务。')
const result = await qualityApi.repairVideo(
target.shotId,
target.assetId,
input.maxRepairAttempts
)
const result = await qualityApi
.repairVideo(target.shotId, target.assetId, input.maxRepairAttempts)
.catch(cause => {
clearVideoConflict(cause, projectId, target.shotId, target.assetId)
throw cause
})
if (
!result ||
result.shotId !== target.shotId ||
@@ -239,11 +244,12 @@ export function useQuality(
receipt = { kind: 'video-repair', result }
} else {
if (!stillCurrent()) throw new Error('已离开原操作目标,未提交质量任务。')
const result = await qualityApi.validateVideo(
target.shotId,
target.assetId,
input.allowedTexts ?? []
)
const result = await qualityApi
.validateVideo(target.shotId, target.assetId, input.allowedTexts ?? [])
.catch(cause => {
clearVideoConflict(cause, projectId, target.shotId, target.assetId)
throw cause
})
if (
!isVisualValidation(result) ||
result.shotId !== target.shotId ||