Procházet zdrojové kódy

fix(cockpit): 定位目标就是当前选择时,详情面板直接可见

- 实测(CDP 直连真实浏览器):locateTarget 之后 detailStore.selection 已经是
  { level: 'equipment', deviceCode },说明定位链本身走通了;但详情浮层被
  v-show="selectionVisibleInMode" 隐藏 —— 该判据要求「目标已经出现在图层里」,
  而图层补点(揭示行/坐标准入)是异步的,用它当面板开关会把「还没补上」误判成「不该显示」。
- 改为:当前选择就是定位目标时直接可见;仅在选择不是定位目标时,才按「目标是否真的上图」判定。
  定位的语义是让用户看到目标,面板不该等图层补点完成。
ChenJZ před 4 hodinami
rodič
revize
b5d3f12197
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 8 0
      src/modules/cockpit/domain/modeLayerPlan.js

+ 8 - 0
src/modules/cockpit/domain/modeLayerPlan.js

@@ -235,6 +235,14 @@ function selectionVisible({ mode, selection, objects, markers, associatedDevices
         const targetRow = targetDevice
             ? (Array.isArray(associatedDevices) ? associatedDevices : []).find((row) => row && row.code === targetDevice)
             : null
+        // 当前选择就是定位目标时**直接可见**:用户刚点了「定位设备」,面板必须出来。
+        // 不再要求目标已经出现在图层里 —— 图层补点是异步的(揭示行、坐标准入),
+        // 用它当面板开关会把「还没补上」误判成「不该显示」(维护者 2026-12-02)。
+        const isTarget = current.deviceCode === targetCode
+            || (!current.deviceCode && current.pointCode === targetCode)
+            || (targetDevice && current.deviceCode === targetDevice)
+        if (isTarget) return true
+        // 选择不是定位目标时,仍按「目标是否真的上图」判定。
         const targetDrawn = (Boolean(targetCode) && (markers || []).some((marker) => marker && marker.code === targetCode))
             || Boolean(targetRow && targetRow.placement === 'drawn')
         if (targetDrawn && (current.deviceCode === targetCode