fix: 合并图库吸顶区域并关闭自动刷新
This commit is contained in:
1 parent
acc0a1e9ad
commit
bd66f7e719
16 files changed
+359
-197
No files matched your search
@@ -5,35 +5,41 @@ import { useShotReferences } from '../production/useShotReferences'
|
||||
|
||||
/** 镜头影响检查与素材查询独立;检查失败不把素材误判为正常或阻断独立的素材操作。 */
|
||||
export function useKeyframeImpact(projectId: Ref<string>, sourceShotId: Ref<string>) {
|
||||
const query = usePolling(projectId, async (id, signal) => {
|
||||
if (!id) return null
|
||||
const [keyframes, videos] = await Promise.all([
|
||||
productionApi.keyframeReadiness(id, false, signal),
|
||||
productionApi.videoReadiness(id, false, signal)
|
||||
])
|
||||
if (!keyframes || !Array.isArray(keyframes.items) || !videos || !Array.isArray(videos.items))
|
||||
throw new Error('主首帧影响检查未返回镜头列表。')
|
||||
const byShot = new Map(videos.items.map(item => [item.shotId, item]))
|
||||
if (byShot.size !== keyframes.items.length || keyframes.items.some(item => !byShot.has(item.shotId)))
|
||||
throw new Error('首帧与视频检查的镜头列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
return {
|
||||
...keyframes,
|
||||
items: keyframes.items.map(item => {
|
||||
const issues = byShot.get(item.shotId)?.issues.filter(issue => issue.code === 'stale_keyframe') ?? []
|
||||
return {
|
||||
...item,
|
||||
primaryKeyframeStale: !!item.primaryKeyframeStale || issues.length > 0,
|
||||
inconsistent: item.primaryKeyframeStale === false && issues.length > 0
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
const query = usePolling(
|
||||
projectId,
|
||||
async (id, signal) => {
|
||||
if (!id) return null
|
||||
const [keyframes, videos] = await Promise.all([
|
||||
productionApi.keyframeReadiness(id, false, signal),
|
||||
productionApi.videoReadiness(id, false, signal)
|
||||
])
|
||||
if (!keyframes || !Array.isArray(keyframes.items) || !videos || !Array.isArray(videos.items))
|
||||
throw new Error('主首帧影响检查未返回镜头列表。')
|
||||
const byShot = new Map(videos.items.map(item => [item.shotId, item]))
|
||||
if (byShot.size !== keyframes.items.length || keyframes.items.some(item => !byShot.has(item.shotId)))
|
||||
throw new Error('首帧与视频检查的镜头列表不一致,可能正在重新拆解,请刷新后重试。')
|
||||
return {
|
||||
...keyframes,
|
||||
items: keyframes.items.map(item => {
|
||||
const issues =
|
||||
byShot.get(item.shotId)?.issues.filter(issue => issue.code === 'stale_keyframe') ?? []
|
||||
return {
|
||||
...item,
|
||||
primaryKeyframeStale: !!item.primaryKeyframeStale || issues.length > 0,
|
||||
inconsistent: item.primaryKeyframeStale === false && issues.length > 0
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
false
|
||||
)
|
||||
const stale = computed(() => query.data.value?.items.filter(item => item.primaryKeyframeStale) ?? [])
|
||||
// 不根据 URL 中的任意镜头 ID 发请求,必须属于当前项目的就绪列表。
|
||||
const source = computed(() => query.data.value?.items.find(item => item.shotId === sourceShotId.value))
|
||||
const references = useShotReferences(
|
||||
projectId,
|
||||
computed(() => source.value?.shotId ?? '')
|
||||
computed(() => source.value?.shotId ?? ''),
|
||||
false
|
||||
)
|
||||
const relatedForms = computed(
|
||||
() => new Set(references.data.value?.references.map(item => item.subjectFormId) ?? [])
|
||||
|
||||
Reference in new issue
Block a user