优化三维导览模型加载与交互体验

This commit is contained in:
lyf
2026-06-27 23:49:38 +08:00
parent 4f6059bbdb
commit f043c85af0
12 changed files with 1433 additions and 509 deletions

View File

@@ -193,6 +193,9 @@ import type {
import type {
GuideRouteResult
} from '@/domain/museum'
import {
isIndoorNavigableFloor
} from '@/domain/guideFloor'
interface GuideFloorOption {
id: string
@@ -367,7 +370,8 @@ const indoorRendererRef = ref<{
disableAutoSwitchTemporarily?: (durationMs: number) => void
} | null>(null)
const floorLabels = computed(() => props.floors.map((floor) => floor.label))
const indoorFloors = computed(() => props.floors.filter((floor) => isIndoorNavigableFloor(floor)))
const floorLabels = computed(() => indoorFloors.value.map((floor) => floor.label))
// #ifdef H5
const effectiveIndoorModelSource = computed(() => props.indoorModelSource)
// #endif
@@ -376,13 +380,13 @@ const showIndoorRightControls = computed(() => (
))
const activeFloorId = computed(() => {
const matchedFloor = props.floors.find((floor) => (
const matchedFloor = indoorFloors.value.find((floor) => (
floor.id === props.activeFloor || floor.label === props.activeFloor
))
if (matchedFloor) return matchedFloor.id
const normalizedFloorId = props.normalizeFloorId(props.activeFloor)
const normalizedFloor = props.floors.find((floor) => (
const normalizedFloor = indoorFloors.value.find((floor) => (
floor.id === normalizedFloorId || floor.label === normalizedFloorId
))
return normalizedFloor?.id || normalizedFloorId
@@ -497,7 +501,7 @@ const handleMoreTap = () => {
}
const handleThreeFloorChange = (floorId: string) => {
const floor = props.floors.find((item) => item.id === floorId)
const floor = indoorFloors.value.find((item) => item.id === floorId)
emit('floorChange', floor?.label || floorId)
emit('indoorViewChange', 'floor')
emit('layerModeChange', 'single')

View File

@@ -65,6 +65,9 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import {
isIndoorNavigableFloor
} from '@/domain/guideFloor'
export interface RoutePointOption {
poiId: string
@@ -128,9 +131,14 @@ watch(
const normalizedKeyword = computed(() => keyword.value.trim().toLowerCase())
const filteredOptions = computed(() => {
if (!normalizedKeyword.value) return props.options
const indoorOptions = props.options.filter((option) => isIndoorNavigableFloor({
floorId: option.floorId,
label: option.floorLabel
}))
return props.options.filter((option) => {
if (!normalizedKeyword.value) return indoorOptions
return indoorOptions.filter((option) => {
const fields = [
option.name,
option.floorId,