Quellcode durchsuchen

chore(cockpit): 定位设备时打印四层现场状态

定位这条链跨「地图摘要 → 设备档案 → 设备图层 → 详情面板」四层,
只飞不动或只开面板不出点时,光看界面分不清断在哪一层。
点「定位设备」时在控制台打一行 [定位设备],带 result/reason、是否在摘要、当前详情层级与设备编码。
ChenJZ vor 4 Stunden
Ursprung
Commit
023d8cd9ac
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 10 0
      src/modules/cockpit/CockpitShell.vue

+ 10 - 0
src/modules/cockpit/CockpitShell.vue

@@ -1055,6 +1055,16 @@ async function locateDeviceFromDetail(deviceCode) {
     const selection = detailStore.selection
     const opened = selection && selection.level === DETAIL_LEVEL.EQUIPMENT && selection.deviceCode === deviceCode
     if (!opened) await detailStore.openDevice(deviceCode, {})
+    // 定位这条链跨了「摘要 → 设备档案 → 设备图层 → 详情面板」四层,
+    // 只飞不动或只开面板不出点时,光看界面分不清断在哪一层。这行把四层的现场一次打出来。
+    console.info('[定位设备]', {
+        code: deviceCode,
+        result: result && result.result,
+        reason: result && result.reasonText,
+        inSummary: (mapStore.summary.objects || []).some((item) => item && item.code === deviceCode),
+        level: detailStore.selection && detailStore.selection.level,
+        deviceCode: detailStore.selection && detailStore.selection.deviceCode,
+    })
     return result
 }