Kaynağa Gözat

fix(cockpit): 定位兜底不再清掉揭示目标,详情浮层才会显示

现场证据(Elements):浮层节点已渲染(data-detail-open 1 of 1),但 element.style 里是
visibility:hidden / display:none —— 即 v-show="selectionVisibleInMode" 为 false。

根因:locateDeviceFromDetail 的兜底调用 openDevice(deviceCode, {}) 传了空对象,
而 openDevice 内部会 setLocateTarget(options.locateTarget || null),把定位链刚设好的 reveal
清成 null;selectionVisible 于是失去「当前选择就是定位目标」的依据,回落到
「设备必须已上图」的判据而被隐藏。

改为兜底时带上 detailStore.locateTarget,保持揭示目标不被覆盖。
ChenJZ 1 saat önce
ebeveyn
işleme
c3ce116db1
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      src/modules/cockpit/CockpitShell.vue

+ 4 - 1
src/modules/cockpit/CockpitShell.vue

@@ -1065,7 +1065,10 @@ async function locateDeviceFromDetail(deviceCode) {
  */
 const selection = computed(() => detailStore.selection || { level: DETAIL_LEVEL.NONE, pointCode: '', deviceCode: '' })
     const opened = selection && selection.level === DETAIL_LEVEL.EQUIPMENT && selection.deviceCode === deviceCode
-    if (!opened) await detailStore.openDevice(deviceCode, {})
+    // 兜底时**必须把定位链设好的揭示目标带上**:openDevice 内部会 setLocateTarget(options.locateTarget || null),
+    // 传空对象等于把 reveal 清成 null,详情面板的可见性判据随即失去「这是定位目标」的依据而被隐藏
+    // (维护者 2026-12-02:定位成功、浮层节点也在,却被 v-show 置成 display:none)。
+    if (!opened) await detailStore.openDevice(deviceCode, { locateTarget: detailStore.locateTarget })
     // 定位这条链跨了「摘要 → 设备档案 → 设备图层 → 详情面板」四层,
     // 只飞不动或只开面板不出点时,光看界面分不清断在哪一层。这行把四层的现场一次打出来。
     console.info('[定位设备]', {