Bladeren bron

fix(cockpit): 地图摘要里没有该设备时,定位退回设备档案取坐标并打开详情

- locateMapObject 第一步只在 mapStore.summary.objects 里找目标;关联设备不在摘要里
  (还没上图 / 被筛选掉)时会直接返回不可定位 —— 既不起飞也不开详情,
  表现就是「点了定位设备什么都没发生」。
- 补一条兜底:摘要里找不到时从设备档案取坐标,飞行与开详情并行执行,
  揭示目标同时带上设备行与设备编码(设备图层能补点,详情可见性判据也认得出)。
ChenJZ 15 uur geleden
bovenliggende
commit
8db6eb9708
1 gewijzigde bestanden met toevoegingen van 21 en 1 verwijderingen
  1. 21 1
      src/modules/cockpit/stores/pointLocateStore.js

+ 21 - 1
src/modules/cockpit/stores/pointLocateStore.js

@@ -116,7 +116,27 @@ export const usePointLocateStore = defineStore('pointLocateStore', () => {
             deviceCode: plan.deviceCode || '',
             reasonText: plan.reasonText,
         }
-        if (plan.result !== LOCATE_RESULT.OK) return setLocate(base)
+        if (plan.result !== LOCATE_RESULT.OK) {
+            // 目标不在当前地图摘要里(还没上图 / 被筛选掉):关联设备仍可以从**设备档案**取坐标。
+            // 不补这条,「点定位设备」的表现就是什么都没发生(维护者 2026-12-02)。
+            const archive = await deviceFromAggregate(code)
+            if (!archive) return setLocate(base)
+            let failure = TERRAIN_LOCATE_REASON.MAP
+            const flying = Promise.resolve()
+                .then(() => flyPoint(archive, { tier: 'device', onFailure: (reason) => { failure = reason } }))
+                .catch(() => false)
+            // 揭示目标带上设备行与设备编码:图层能补点,详情面板的可见性判据也认得出它。
+            const reveal = { code, deviceCode: archive.code || code, device: archive }
+            await openDevice(code, { locateTarget: reveal })
+            const applied = await flying
+            return setLocate({
+                result: applied === true ? LOCATE_RESULT.OK : LOCATE_RESULT.UNAVAILABLE,
+                code,
+                pointCode: code,
+                deviceCode: code,
+                reasonText: applied === true ? '' : locateFailureText(failure),
+            })
+        }
 
         // #131 补充:关联设备要**越过宿主监测点**直接飞到设备自己的坐标。
         // 设备坐标不在 map-snapshot(关联设备不带坐标),必须先打开宿主点位详情,