修正楼层显示顺序
This commit is contained in:
@@ -107,6 +107,7 @@ import type {
|
||||
MuseumPoi
|
||||
} from '@/domain/museum'
|
||||
import {
|
||||
compareFloorsTopToBottom,
|
||||
isIndoorNavigableFloor,
|
||||
isPoiOnIndoorNavigableFloor
|
||||
} from '@/domain/guideFloor'
|
||||
@@ -146,7 +147,7 @@ const isLoading = ref(false)
|
||||
|
||||
const displayFloors = computed(() => [...floors.value]
|
||||
.filter(isIndoorNavigableFloor)
|
||||
.sort((a, b) => floorOrder(a) - floorOrder(b)))
|
||||
.sort(compareFloorsTopToBottom))
|
||||
|
||||
const floorResults = computed(() => {
|
||||
const matched = pois.value.filter((poi) => poi.floorLabel === activeFloor.value)
|
||||
@@ -157,14 +158,6 @@ const emptyTitle = computed(() => (
|
||||
isLoading.value ? '正在读取点位' : '暂无匹配点位'
|
||||
))
|
||||
|
||||
const floorOrder = (floor: MuseumFloor) => {
|
||||
if (Number.isFinite(floor.order)) return floor.order
|
||||
|
||||
const normalized = floor.label.toUpperCase()
|
||||
if (normalized.startsWith('B')) return -Number(normalized.replace('B', '')) || -1
|
||||
return Number(normalized.replace('F', '')) || 0
|
||||
}
|
||||
|
||||
const isVisiblePoi = (poi: MuseumPoi) => poi.primaryCategory.id !== 'touring_poi'
|
||||
&& isPoiOnIndoorNavigableFloor(poi)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user