|
|
@@ -593,7 +593,7 @@ import { selectMonitoringPoint } from './pointSelection.js'
|
|
|
import { planModeLayers, planModeSelectionTransition } from './domain/modeLayerPlan.js'
|
|
|
import { PIPE_ENHANCEMENT_KIND, planPipeEnhancement } from './domain/pipeEnhancement.js'
|
|
|
import { facilityAsComponent, facilityUndergroundTarget } from './domain/facilityUnderground.js'
|
|
|
-import { facilityBelongsToObject } from './domain/assetDetailKind.js'
|
|
|
+import { facilityBelongsToObject, pipeEnhancementFacilityIdentity } from './domain/assetDetailKind.js'
|
|
|
// 票 48:图例计数纯函数(色值/词条/计数与地图管线同源的 domain 单源)。
|
|
|
import { pipeColorCounts } from './domain/pipeVisual.js'
|
|
|
import { usePipeEnhancementStore } from './stores/pipeEnhancementStore.js'
|
|
|
@@ -689,6 +689,7 @@ const enhancementFacilityState = computed(() => {
|
|
|
error: Boolean(entityDetailStore.error),
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
const runtimeStore = useRuntimeStore()
|
|
|
const statusPanelExpanded = ref(false)
|
|
|
const { mode, expandedPanelIds } = storeToRefs(uiStore)
|
|
|
@@ -1206,6 +1207,36 @@ const introVisible = ref(intro.value.enabled)
|
|
|
const pipeEnhancementStore = usePipeEnhancementStore()
|
|
|
const enhancementDevicesStore = useEnhancementDevicesStore()
|
|
|
const { selected: pipeEnhancementSelection, radiusM: pipeEnhancementRadius } = storeToRefs(pipeEnhancementStore)
|
|
|
+
|
|
|
+/**
|
|
|
+ * 管段选中 → 现取一次「管道详情」(维护者 2026-11-16)。
|
|
|
+ *
|
|
|
+ * 用 `watch` 而不是只挂在点击处理函数上:3D 里的管段可以从多条路径被选中
|
|
|
+ * (管线拾取、附近管道列表、外部的 `pipeEnhancementStore.select`),
|
|
|
+ * 挂在单一入口必漏。取数沿用 `facilityPointStore.select`(同一条只读详情端点)。
|
|
|
+ *
|
|
|
+ * 取数主键用 `sourceId` 而不是 `code`:几何里管段
|
|
|
+ * `properties.code` 是业务编码、`properties.sourceId` 才是 `pipe_network_base` 主键,
|
|
|
+ * 拿编码去查详情会 404(实测 TCRQ202609080001 → raw_P11920)。
|
|
|
+ * `pipeEnhancementFacilityIdentity()` 负责从选中对象或可见管线里补出主键。
|
|
|
+ */
|
|
|
+watch(
|
|
|
+ () => `${pipeEnhancementSelection.value?.kind || ''}|${pipeEnhancementSelection.value?.code || ''}`,
|
|
|
+ () => {
|
|
|
+ const identity = pipeEnhancementFacilityIdentity(
|
|
|
+ pipeEnhancementSelection.value,
|
|
|
+ pipeNetworkStore.pipelines?.value ?? pipeNetworkStore.pipelines ?? [],
|
|
|
+ )
|
|
|
+ if (!identity) return
|
|
|
+ const current = entityDetailStore.identity
|
|
|
+ // 同一管段已取过就不重复请求(半径/筛选变化会反复触发本 watch)。
|
|
|
+ if (current && String(current.kind) === 'facility'
|
|
|
+ && String(current.category) === identity.category
|
|
|
+ && String(current.id) === identity.id) return
|
|
|
+ facilityPointStore.select(identity, null, { side: 'right' })
|
|
|
+ },
|
|
|
+ { immediate: true },
|
|
|
+)
|
|
|
/** 选中的图例行 → 命中的设备编码集(与图例同一份设备台账;空集=不筛)。 */
|
|
|
const deviceFilter = computed(() => deviceStatusStore.filterDeviceCodes(pointStatus.value))
|
|
|
|
|
|
@@ -1352,6 +1383,28 @@ function selectPipeEnhancement(hit) {
|
|
|
: ''
|
|
|
if (!kind) return
|
|
|
pipeEnhancementStore.select(kind, hit.code)
|
|
|
+ loadPipeAssetDetail(kind, hit.code)
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 管段选中时按自己的链现取一次「管道详情」(维护者 2026-11-16)。
|
|
|
+ *
|
|
|
+ * 为什么窨井不用这一步:窨井从设施点链进来,`entityDetailStore` 已有详情,
|
|
|
+ * 3D 视图按主键认回即可。管段从管线拾取链进来,`entityDetailStore` 从未被填充,
|
|
|
+ * 资产详情因此恒空 —— 这就是「井盖能显示、管道不显示」的根源。
|
|
|
+ *
|
|
|
+ * 详情取数沿用既有的 `facilityPointStore.select`(同一条 `/entities/{id}/detail` 只读端点),
|
|
|
+ * 不新造取数路径;失败按既有降级(资产详情显示取数提示,不阻塞 3D 场景)。
|
|
|
+ */
|
|
|
+function loadPipeAssetDetail(kind, code) {
|
|
|
+ const identity = pipeEnhancementFacilityIdentity({ kind, code })
|
|
|
+ if (!identity) return
|
|
|
+ const current = entityDetailStore.identity
|
|
|
+ // 同一个管段已经取过就不重复请求(切换半径/筛选时会被反复触发)。
|
|
|
+ if (current && String(current.kind) === 'facility'
|
|
|
+ && String(current.category) === identity.category
|
|
|
+ && String(current.id) === identity.id) return
|
|
|
+ facilityPointStore.select(identity, null, { side: 'right' })
|
|
|
}
|
|
|
|
|
|
/** 资产详情页签的设施重试:沿用实体详情的既有重试入口,不另造取数路径。 */
|