feat: 视频生成按钮使用主首帧持久化质量状态门禁
This commit is contained in:
1 parent
c00898017d
commit
0b5cc9c7ef
1 file changed
+15
-1
@@ -240,9 +240,23 @@ const canGenerateVideo = computed(
|
|||||||
!!props.videoReadiness &&
|
!!props.videoReadiness &&
|
||||||
props.videoReadiness.issues.length === 0 &&
|
props.videoReadiness.issues.length === 0 &&
|
||||||
/** 真正的视频质量门仍由后端编译器执行,前端不以易过期的会话结果代替持久化状态。 */
|
/** 真正的视频质量门仍由后端编译器执行,前端不以易过期的会话结果代替持久化状态。 */
|
||||||
!!currentKeyframe.value
|
!!currentKeyframe.value &&
|
||||||
|
!primaryQualityBlocked.value
|
||||||
)
|
)
|
||||||
const keyframeStale = computed(() => !!props.keyframeReadiness?.primaryKeyframeStale)
|
const keyframeStale = computed(() => !!props.keyframeReadiness?.primaryKeyframeStale)
|
||||||
|
/** 当前主首帧的持久化质量状态,避免会话缓存与按钮状态冲突。 */
|
||||||
|
const primaryQualityKey = computed(() => currentKeyframe.value
|
||||||
|
? JSON.stringify([props.shot.shotId, currentKeyframe.value.id, reviewRevision.value])
|
||||||
|
: '')
|
||||||
|
const primaryQualityQuery = useQuery(primaryQualityKey, (value, signal) => {
|
||||||
|
if (!value) return Promise.resolve(null)
|
||||||
|
const [shotId, keyframeId] = JSON.parse(value) as [string, string, number]
|
||||||
|
return qualityApi.keyframeQualityReview(shotId, keyframeId, signal)
|
||||||
|
})
|
||||||
|
const primaryQualityBlocked = computed(() => {
|
||||||
|
const status = primaryQualityQuery.data.value?.effectiveQualityStatus
|
||||||
|
return !status || status === 'failed' || status === 'needs_review' || status === 'unknown'
|
||||||
|
})
|
||||||
const reviewRevision = ref(0)
|
const reviewRevision = ref(0)
|
||||||
/** 审核后强制更新每张卡片的数据库质量状态。 */
|
/** 审核后强制更新每张卡片的数据库质量状态。 */
|
||||||
async function refreshAfterReview() {
|
async function refreshAfterReview() {
|
||||||
|
|||||||
Reference in new issue
Block a user