This commit is contained in:
@@ -300,6 +300,8 @@ const emit = defineEmits<{
|
||||
targetFocus: [result: TargetPoiFocusResult]
|
||||
autoSwitch: [event: { from: 'overview' | 'floor'; to: 'overview' | 'floor'; trigger: 'zoom-in' | 'zoom-out'; distance: number }]
|
||||
autoSwitchBlocked: [reason: { reason: 'loading-locked' | 'cooldown' | 'disabled' }]
|
||||
initialModelReady: [event: { view: ViewMode; floorId?: string; elapsedMs?: number }]
|
||||
initialModelFailed: [event: { view: ViewMode; floorId?: string; message: string; elapsedMs?: number }]
|
||||
}>()
|
||||
|
||||
const containerRef = ref<ContainerRef>(null)
|
||||
@@ -4726,6 +4728,11 @@ const init3DScene = async () => {
|
||||
|
||||
setProgress(100, '馆内三维模型加载完成')
|
||||
isLoading.value = false
|
||||
emit('initialModelReady', {
|
||||
view: activeView.value,
|
||||
floorId: currentFloor.value,
|
||||
elapsedMs: firstModelLoadStartedAt ? Math.round(getNow() - firstModelLoadStartedAt) : undefined
|
||||
})
|
||||
await syncRequestedIndoorView()
|
||||
queueTargetFocus(pendingTargetFocus || props.targetFocus || null)
|
||||
} catch (error) {
|
||||
@@ -4734,7 +4741,14 @@ const init3DScene = async () => {
|
||||
console.error('馆内 3D 模型资源加载失败:', error)
|
||||
loadError.value = true
|
||||
isLoading.value = false
|
||||
setProgress(0, error instanceof Error ? error.message : '请检查模型资源或网络状态后重试')
|
||||
const message = error instanceof Error ? error.message : '请检查模型资源或网络状态后重试'
|
||||
setProgress(0, message)
|
||||
emit('initialModelFailed', {
|
||||
view: activeView.value,
|
||||
floorId: currentFloor.value,
|
||||
message,
|
||||
elapsedMs: firstModelLoadStartedAt ? Math.round(getNow() - firstModelLoadStartedAt) : undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user