fix: 补齐过期首帧素材定位与图库影响提示

This commit is contained in:
GouJ
2026-09-02 18:49:20 +08:00
parent f71d2bf0a4
commit 771b66cafc
11 changed files with 826 additions and 23 deletions
@@ -0,0 +1,16 @@
import { computed, type Ref } from 'vue'
import { usePolling } from '../../composables/usePolling'
import { storyboardApi } from '../storyboard/api'
/** 仅查询已由当前项目列表确认的镜头,切换目标自动取消旧响应。 */
export function useShotReferences(projectId: Ref<string>, shotId: Ref<string>) {
const key = computed(() => JSON.stringify([projectId.value, shotId.value]))
return usePolling(key, async (value, signal) => {
const [project, shot] = JSON.parse(value) as [string, string]
if (!project || !shot) return null
const result = await storyboardApi.references(shot, signal)
if (!result || result.shotId !== shot || !Array.isArray(result.references) || !Array.isArray(result.missing))
throw new Error('镜头参考素材返回不匹配,请刷新后重试。')
return result
})
}