|
@@ -1052,7 +1052,16 @@ async function locateDeviceFromDetail(deviceCode) {
|
|
|
const result = await pointLocateStore.locateTarget({ kind: 'map-object', code: deviceCode })
|
|
const result = await pointLocateStore.locateTarget({ kind: 'map-object', code: deviceCode })
|
|
|
// 兜底:定位链在「设备未上图 / 宿主点位取不到」时不会进设备级详情,
|
|
// 兜底:定位链在「设备未上图 / 宿主点位取不到」时不会进设备级详情,
|
|
|
// 而用户点这个按钮要的是「看到设备」。这里不依赖定位结果,直接按设备编码补开一次。
|
|
// 而用户点这个按钮要的是「看到设备」。这里不依赖定位结果,直接按设备编码补开一次。
|
|
|
- const selection = detailStore.selection
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 当前两级详情选择。
|
|
|
|
|
+ *
|
|
|
|
|
+ * Pinia 的 setup store 会把 ref 解包,所以 `detailStore.selection` 拿到的**已经是对象**;
|
|
|
|
|
+ * 早先直接写 `const selection = detailStore.selection` 再用 `selection.value.level`,
|
|
|
|
|
+ * 等于对普通对象取 `.value` —— `detailOpen` 这个 computed 每次渲染都抛 TypeError,
|
|
|
|
|
+ * 详情浮层的 `v-if` 于是恒为假:定位成功、选择正确,面板却永远不出现(维护者 2026-12-02)。
|
|
|
|
|
+ * 这里包一层 computed,使之与下游所有 `selection.value.xxx` 的写法一致。
|
|
|
|
|
+ */
|
|
|
|
|
+const selection = computed(() => detailStore.selection || { level: DETAIL_LEVEL.NONE, pointCode: '', deviceCode: '' })
|
|
|
const opened = selection && selection.level === DETAIL_LEVEL.EQUIPMENT && selection.deviceCode === deviceCode
|
|
const opened = selection && selection.level === DETAIL_LEVEL.EQUIPMENT && selection.deviceCode === deviceCode
|
|
|
if (!opened) await detailStore.openDevice(deviceCode, {})
|
|
if (!opened) await detailStore.openDevice(deviceCode, {})
|
|
|
// 定位这条链跨了「摘要 → 设备档案 → 设备图层 → 详情面板」四层,
|
|
// 定位这条链跨了「摘要 → 设备档案 → 设备图层 → 详情面板」四层,
|