同步加载页与首页模型加载状态

This commit is contained in:
lyf
2026-07-06 10:11:20 +08:00
parent b99ae572da
commit 4a6a7f9c29
3 changed files with 151 additions and 14 deletions

View File

@@ -26,6 +26,7 @@
@selection-clear="handleSelectionClear"
@target-focus="handleTargetFocus"
@auto-switch="handleAutoSwitch"
@initial-model-progress="handleInitialModelProgress"
@initial-model-ready="handleInitialModelReady"
@initial-model-failed="handleInitialModelFailed"
/>
@@ -289,6 +290,14 @@ type IndoorViewMode = 'overview' | 'floor' | 'multi'
type LayerDisplayMode = 'single' | 'multi'
type TouchGestureMode = 'orbit' | 'pan'
interface InitialModelProgressEvent {
progress: number
message: string
view: IndoorViewMode
floorId?: string
elapsedMs?: number
}
const props = withDefaults(defineProps<{
searchText?: string
activeMode?: '2d' | '3d'
@@ -403,6 +412,7 @@ const emit = defineEmits<{
selectionClear: []
targetFocus: [result: TargetPoiFocusResult]
autoSwitch: [event: { from: 'overview' | 'floor'; to: 'overview' | 'floor'; trigger: string; distance: number }]
initialModelProgress: [event: InitialModelProgressEvent]
initialModelReady: [event: { view: IndoorViewMode; floorId?: string; elapsedMs?: number }]
initialModelFailed: [event: { view: IndoorViewMode; floorId?: string; message: string; elapsedMs?: number }]
mapTap: [location: { latitude: number; longitude: number }]
@@ -710,6 +720,10 @@ const handleAutoSwitch = (event: { from: 'overview' | 'floor'; to: 'overview' |
emit('autoSwitch', event)
}
const handleInitialModelProgress = (event: InitialModelProgressEvent) => {
emit('initialModelProgress', event)
}
const handleInitialModelReady = (event: { view: IndoorViewMode; floorId?: string; elapsedMs?: number }) => {
emit('initialModelReady', event)
}