@@ -226,6 +226,9 @@ import {
|
||||
import {
|
||||
guideUseCase
|
||||
} from '@/usecases/guideUseCase'
|
||||
import {
|
||||
createVisitorPoiPresentations
|
||||
} from '@/view-models/visitorPoiPresentation'
|
||||
import {
|
||||
HOME_POI_CATEGORIES,
|
||||
POI_CATEGORIES,
|
||||
@@ -356,13 +359,18 @@ const isPoiLocatable = (poi: MuseumPoi) => !getPoiDataIssues(poi).some((issue) =
|
||||
|
||||
const unavailablePoiCount = computed(() => pois.value.filter((poi) => !isPoiLocatable(poi)).length)
|
||||
|
||||
// 数据质量统计保留给诊断日志,普通游客只看到可恢复的加载状态。
|
||||
const dataWarning = computed(() => {
|
||||
const warnings: string[] = []
|
||||
if (excludedPoiCount.value) warnings.push(`${excludedPoiCount.value} 个点位分类或楼层信息不完整`)
|
||||
if (duplicatePoiCount.value) warnings.push(`${duplicatePoiCount.value} 个重复点位已合并`)
|
||||
if (unavailablePoiCount.value) warnings.push(`${unavailablePoiCount.value} 个点位暂无地图坐标`)
|
||||
if (floorLoadError.value) warnings.push('楼层信息读取失败')
|
||||
return warnings.join(',')
|
||||
const diagnostic = {
|
||||
excluded: excludedPoiCount.value,
|
||||
duplicates: duplicatePoiCount.value,
|
||||
unavailable: unavailablePoiCount.value,
|
||||
floorLoadError: floorLoadError.value
|
||||
}
|
||||
if (import.meta.env.DEV && Object.values(diagnostic).some(Boolean)) {
|
||||
console.debug('[guide-poi-diagnostics]', diagnostic)
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
const dedupePois = (items: MuseumPoi[]) => {
|
||||
@@ -860,7 +868,10 @@ const restoreResultListScroll = async () => {
|
||||
if (resultListElement) resultListElement.scrollTop = scrollTop
|
||||
}
|
||||
|
||||
const poiDisplayName = (poi: MuseumPoi) => poi.name?.trim() || '未命名点位'
|
||||
const poiPresentations = computed(() => createVisitorPoiPresentations(pois.value))
|
||||
const poiDisplayName = (poi: MuseumPoi) => (
|
||||
poiPresentations.value.get(poi.id)?.displayName || '未命名点位'
|
||||
)
|
||||
|
||||
const poiResultMeta = (poi: MuseumPoi) => {
|
||||
const categoryLabel = resolvePoiCategory(poi)?.label || poi.primaryCategory?.label || '其他'
|
||||
|
||||
Reference in New Issue
Block a user