Selaa lähdekoodia

fix(cockpit): 进入系统不再被地图就绪卡住,详情浮层补可查标记

- flyHome 的失败分支没有把 introVisible 置 false:地图未就绪时用户被永久锁在引导态,
  所有 v-if="!introVisible" 的节点(实体详情抽屉、点位/设备详情浮层、事件详情)永远不渲染。
  改为「点过进入就结束引导态」,地图稍后自行就绪。
- detailOpen 加防御(selection 取不到时按未选择处理),避免再次因取值形状抛错而整块 v-if 恒假。
- 浮层补 data-detail-open / data-intro-visible 两个诊断标记,便于走查时一眼看出卡在哪个条件。
ChenJZ 1 tunti sitten
vanhempi
commit
3c539bf63e
1 muutettua tiedostoa jossa 11 lisäystä ja 1 poistoa
  1. 11 1
      src/modules/cockpit/CockpitShell.vue

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

@@ -502,6 +502,8 @@
                 :data-fixed-side="facilityFixedLeft ? 'left' : 'right'"
                 :data-anchor-code="selectedDetailCode"
                 :data-selection-paused="selectionVisibleInMode ? 'no' : 'yes'"
+                :data-detail-open="String(detailOpen)"
+                :data-intro-visible="String(introVisible)"
                 :aria-label="facilityDetailOpen ? '设施详情' : '点位与设备详情'"
                 :data-facility-anchor-id="facilityDetailOpen ? entityDetailStore.identity.id : null">
                 <FacilityDetailCard
@@ -1848,7 +1850,11 @@ function syncLayersForEntered(nextEntered) {
 const stopDeviceWatches = []
 
 /** 票 10:两级详情是否打开(浮层只在有选择时渲染;关掉后地图与面板保持原样)。 */
-const detailOpen = computed(() => facilityDetailOpen.value || selection.value.level !== DETAIL_LEVEL.NONE)
+const detailOpen = computed(() => {
+    if (facilityDetailOpen.value) return true
+    const current = selection.value
+    return Boolean(current && current.level && current.level !== DETAIL_LEVEL.NONE)
+})
 function closeActiveDetail() {
     if (facilityDetailOpen.value) entityDetailStore.close()
     else detailStore.closeDetail()
@@ -2349,6 +2355,10 @@ function flyHome({ fromIntro = false } = {}) {
             defer(fly, 250)
         } else {
             homeFlightPending.value = false
+            // 进入动作不该被地图就绪卡死:点过「进入」就结束引导态。
+            // 否则 Drawer / 详情浮层这些 v-if="!introVisible" 的节点永远不渲染 ——
+            // 表现就是「点什么都打不开详情」,而地图本身稍后仍会就绪(维护者 2026-12-02)。
+            if (fromIntro) introVisible.value = false
             areaNotice.value = '地图暂未就绪,请稍后重试'
         }
     }