|
@@ -252,14 +252,6 @@
|
|
|
现在它是主体区底部的浮层(见 cockpit-shell__notice),这里只留注释锚点。
|
|
现在它是主体区底部的浮层(见 cockpit-shell__notice),这里只留注释锚点。
|
|
|
-->
|
|
-->
|
|
|
|
|
|
|
|
- <span v-if="detailOpen && !introVisible && !fixedLocationReason && !anchorLayout.visible"
|
|
|
|
|
- class="cockpit-shell__chip cockpit-shell__anchor-status" data-anchor-hidden
|
|
|
|
|
- :data-anchor-reason="anchorLayout.reason" role="status">
|
|
|
|
|
- {{ selectedDetailCode }} · {{ hiddenAnchorText }}
|
|
|
|
|
- <button v-if="canRelocate" type="button" data-anchor-relocate @click="relocateSelected">重新定位</button>
|
|
|
|
|
- <button type="button" data-anchor-close @click="closeActiveDetail">关闭</button>
|
|
|
|
|
- </span>
|
|
|
|
|
-
|
|
|
|
|
<!--
|
|
<!--
|
|
|
票 42(规格 14:刷新核对链):换新快照期间设备图层已挂起,详情进入「待核对」;
|
|
票 42(规格 14:刷新核对链):换新快照期间设备图层已挂起,详情进入「待核对」;
|
|
|
顶栏如实提示并保留关闭入口(关闭按钮在上方 data-anchor-hidden chip 里)。
|
|
顶栏如实提示并保留关闭入口(关闭按钮在上方 data-anchor-hidden chip 里)。
|
|
@@ -569,8 +561,7 @@ import { responseEfficiencyTitle } from './domain/warningResponsePanels.js'
|
|
|
import { EVENT_FAMILY } from './domain/events.js'
|
|
import { EVENT_FAMILY } from './domain/events.js'
|
|
|
import { LOCATE_RESULT } from './domain/mapLocate.js'
|
|
import { LOCATE_RESULT } from './domain/mapLocate.js'
|
|
|
import { resolveDetailAnchor, resolveFacilityDetailAnchor, detailAnchorLocation } from './domain/detailAnchor.js'
|
|
import { resolveDetailAnchor, resolveFacilityDetailAnchor, detailAnchorLocation } from './domain/detailAnchor.js'
|
|
|
-import { DEVICE_LAYER_KIND } from './domain/deviceLayer.js'
|
|
|
|
|
-import { ANCHOR_HIDDEN, solvePointAnchor } from './domain/pointAnchor.js'
|
|
|
|
|
|
|
+import { solvePointAnchor } from './domain/pointAnchor.js'
|
|
|
import {
|
|
import {
|
|
|
overallFreshness,
|
|
overallFreshness,
|
|
|
overallFreshnessText,
|
|
overallFreshnessText,
|
|
@@ -612,6 +603,8 @@ import { STARTUP_ACTION, planCockpitStartup } from './domain/startupPlan.js'
|
|
|
import { selectMonitoringPoint } from './pointSelection.js'
|
|
import { selectMonitoringPoint } from './pointSelection.js'
|
|
|
// 票 46:模式图层计划(唯一裁决点)+ 模式切换的选择态语义判定。
|
|
// 票 46:模式图层计划(唯一裁决点)+ 模式切换的选择态语义判定。
|
|
|
import { planModeLayers, planModeSelectionTransition } from './domain/modeLayerPlan.js'
|
|
import { planModeLayers, planModeSelectionTransition } from './domain/modeLayerPlan.js'
|
|
|
|
|
+// #13:定位揭示目标**由选择派生**(选择关掉揭示就消失,不再靠一次性选项传递)。
|
|
|
|
|
+import { deriveLocateReveal } from './domain/locateReveal.js'
|
|
|
// 本票(主场景渐进显示与完整加载):显示就绪门控(区域锁定 + 相机归位 + 至少一帧真实渲染)。
|
|
// 本票(主场景渐进显示与完整加载):显示就绪门控(区域锁定 + 相机归位 + 至少一帧真实渲染)。
|
|
|
import { DISPLAY_GATE, armDisplayGate, createDisplayGate, disarmDisplayGate, displayReady, observeDisplayGate } from './domain/displayReadiness.js'
|
|
import { DISPLAY_GATE, armDisplayGate, createDisplayGate, disarmDisplayGate, displayReady, observeDisplayGate } from './domain/displayReadiness.js'
|
|
|
import { PIPE_ENHANCEMENT_KIND, planPipeEnhancement } from './domain/pipeEnhancement.js'
|
|
import { PIPE_ENHANCEMENT_KIND, planPipeEnhancement } from './domain/pipeEnhancement.js'
|
|
@@ -1064,7 +1057,7 @@ async function locateDeviceFromDetail(deviceCode) {
|
|
|
* 这里包一层 computed,使之与下游所有 `selection.value.xxx` 的写法一致。
|
|
* 这里包一层 computed,使之与下游所有 `selection.value.xxx` 的写法一致。
|
|
|
*/
|
|
*/
|
|
|
const selection = computed(() => detailStore.selection || { level: DETAIL_LEVEL.NONE, pointCode: '', deviceCode: '' })
|
|
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.value.level === DETAIL_LEVEL.EQUIPMENT && selection.value.deviceCode === deviceCode
|
|
|
// 兜底时**必须把定位链设好的揭示目标带上**:openDevice 内部会 setLocateTarget(options.locateTarget || null),
|
|
// 兜底时**必须把定位链设好的揭示目标带上**:openDevice 内部会 setLocateTarget(options.locateTarget || null),
|
|
|
// 传空对象等于把 reveal 清成 null,详情面板的可见性判据随即失去「这是定位目标」的依据而被隐藏
|
|
// 传空对象等于把 reveal 清成 null,详情面板的可见性判据随即失去「这是定位目标」的依据而被隐藏
|
|
|
// (维护者 2026-12-02:定位成功、浮层节点也在,却被 v-show 置成 display:none)。
|
|
// (维护者 2026-12-02:定位成功、浮层节点也在,却被 v-show 置成 display:none)。
|
|
@@ -1392,15 +1385,22 @@ const deviceFilterActive = computed(
|
|
|
() => industryQuery(industry.value) !== '' || districtQuery(scope.value) !== '' || String(deviceType.value || '').trim() !== '',
|
|
() => industryQuery(industry.value) !== '' || districtQuery(scope.value) !== '' || String(deviceType.value || '').trim() !== '',
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-/** 定位状态兜底:detailStore 的揭示目标被清空时,用最近一次定位的编码在摘要里找回那一行。 */
|
|
|
|
|
-function revealFromLocateState() {
|
|
|
|
|
- const state = pointLocateStore.locate
|
|
|
|
|
- const deviceCode = (state && (state.deviceCode || state.code)) || ''
|
|
|
|
|
- if (!deviceCode) return null
|
|
|
|
|
- const device = (mapStore.summary.objects || []).find((item) => item && item.code === deviceCode) || null
|
|
|
|
|
- if (!device) return null
|
|
|
|
|
- return { code: deviceCode, deviceCode: state.deviceCode || '', device }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 当前定位揭示目标(#13):**由选择派生**,不是由定位链传下来的一次性选项。
|
|
|
|
|
+ *
|
|
|
|
|
+ * 选择是「用户正在看谁」的唯一真相;揭示只是它的投影。于是:
|
|
|
|
|
+ * 关闭详情 → 选择清空 → 揭示自动消失;定位完成后数据到达 → 揭示自动补上。
|
|
|
|
|
+ * 原先读 `detailStore.locateTarget`(会被关闭/返回/切模式/改图例清空)的链路正是
|
|
|
|
|
+ * 「定位成功之后图标与锚定又没了」的成因。
|
|
|
|
|
+ *
|
|
|
|
|
+ * 兜底仍保留一次性记录:坐标只在设备档案里(要异步取)时,派生拿不到,
|
|
|
|
|
+ * 但定位链当场已经把那一行交过来了。
|
|
|
|
|
+ */
|
|
|
|
|
+const locateReveal = computed(() => deriveLocateReveal({
|
|
|
|
|
+ selection: selection.value,
|
|
|
|
|
+ objects: mapStore.summary.objects,
|
|
|
|
|
+ pointDetail: sections.value.pointDetail && sections.value.pointDetail.data,
|
|
|
|
|
+}) || detailStore.locateTarget || null)
|
|
|
|
|
|
|
|
function syncDeviceLayer(options = {}) {
|
|
function syncDeviceLayer(options = {}) {
|
|
|
// 票 46:`entered` 跟随引导态 —— 进入前关联设备图层整体不呈现(规格 18 的引导列)。
|
|
// 票 46:`entered` 跟随引导态 —— 进入前关联设备图层整体不呈现(规格 18 的引导列)。
|
|
@@ -1409,8 +1409,8 @@ function syncDeviceLayer(options = {}) {
|
|
|
const maxFan = options.maxFan || (mapConfig && mapConfig.overlap && mapConfig.overlap.maxFan) || 10
|
|
const maxFan = options.maxFan || (mapConfig && mapConfig.overlap && mapConfig.overlap.maxFan) || 10
|
|
|
// #135:关联设备定位时,宿主点位可能被当前模式隐藏;设备图层仍要按揭示目标常驻,
|
|
// #135:关联设备定位时,宿主点位可能被当前模式隐藏;设备图层仍要按揭示目标常驻,
|
|
|
// 否则 parentVisible=false 会把刚补出来的设备点又撤掉(表现就是“定位成功但图标丢失”)。
|
|
// 否则 parentVisible=false 会把刚补出来的设备点又撤掉(表现就是“定位成功但图标丢失”)。
|
|
|
- const locateReveal = detailStore.locateTarget
|
|
|
|
|
- const revealParent = Boolean(locateReveal && locateReveal.deviceCode && locateReveal.code === selection.value.pointCode)
|
|
|
|
|
|
|
+ const reveal = locateReveal.value
|
|
|
|
|
+ const revealParent = Boolean(reveal && reveal.deviceCode && reveal.code === selection.value.pointCode)
|
|
|
return deviceLayerStore.syncForSelection({
|
|
return deviceLayerStore.syncForSelection({
|
|
|
...options,
|
|
...options,
|
|
|
mode: mode.value,
|
|
mode: mode.value,
|
|
@@ -1421,10 +1421,9 @@ function syncDeviceLayer(options = {}) {
|
|
|
filterActive: deviceFilterActive.value,
|
|
filterActive: deviceFilterActive.value,
|
|
|
// #131:关联设备定位时把揭示目标(含设备自身坐标)交给设备图层,正常/离线也能临时上图。
|
|
// #131:关联设备定位时把揭示目标(含设备自身坐标)交给设备图层,正常/离线也能临时上图。
|
|
|
//
|
|
//
|
|
|
- // detailStore.locateTarget 会被后续的 close/回收链路清掉(实测定位完成后读已是 null),
|
|
|
|
|
- // 一旦为空,设备图层就补不出揭示行 —— 图标与锚定全都失去依据。
|
|
|
|
|
- // 所以这里再从定位状态本身兜底构造一次:定位已知设备编码时,用摘要里的那一行。
|
|
|
|
|
- revealDevice: detailStore.locateTarget || revealFromLocateState(),
|
|
|
|
|
|
|
+ // 揭示目标由**选择派生**(见上方 locateReveal):关闭详情就自动消失,
|
|
|
|
|
+ // 不再依赖"谁记得清 / 谁记得再写一次"。
|
|
|
|
|
+ revealDevice: reveal,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1513,11 +1512,12 @@ const modeDeviceFacts = computed(() => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 当前定位揭示目标(#127):由 `detailStore` 在定位成功后写入,关闭/换选择/切模式/改图例筛选时清除。
|
|
|
|
|
- * 只把「目标本身是摘要对象」的情况交给计划层;关联设备揭示的是宿主点位标记,仍由设备层按标签状态着色。
|
|
|
|
|
|
|
+ * 交给计划层的定位揭示目标(#127):与设备图层同源,都读**选择派生**的 `locateReveal`。
|
|
|
|
|
+ * 只把「目标本身是摘要对象」的情况交给计划层;关联设备揭示的是宿主点位标记,
|
|
|
|
|
+ * 仍由设备层按标签状态着色。
|
|
|
*/
|
|
*/
|
|
|
const modeLocateTarget = computed(() => {
|
|
const modeLocateTarget = computed(() => {
|
|
|
- const target = detailStore.locateTarget
|
|
|
|
|
|
|
+ const target = locateReveal.value
|
|
|
if (!target || !target.code) return null
|
|
if (!target || !target.code) return null
|
|
|
const onMap = (mapStore.summary.objects || []).some((object) => object && object.code === target.code)
|
|
const onMap = (mapStore.summary.objects || []).some((object) => object && object.code === target.code)
|
|
|
return onMap ? { code: target.code, deviceCode: target.deviceCode || '' } : null
|
|
return onMap ? { code: target.code, deviceCode: target.deviceCode || '' } : null
|
|
@@ -1872,10 +1872,6 @@ const detailOpen = computed(() => {
|
|
|
const current = selection.value
|
|
const current = selection.value
|
|
|
return Boolean(current && current.level && current.level !== DETAIL_LEVEL.NONE)
|
|
return Boolean(current && current.level && current.level !== DETAIL_LEVEL.NONE)
|
|
|
})
|
|
})
|
|
|
-function closeActiveDetail() {
|
|
|
|
|
- if (facilityDetailOpen.value) entityDetailStore.close()
|
|
|
|
|
- else detailStore.closeDetail()
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
// ---- 票 41:详情面板锚定跟随监测点标记(决策票 04 / 规格票 12 的修订节)----
|
|
// ---- 票 41:详情面板锚定跟随监测点标记(决策票 04 / 规格票 12 的修订节)----
|
|
|
//
|
|
//
|
|
@@ -1923,13 +1919,6 @@ const fixedLocationReason = computed(() => {
|
|
|
return verdict.present && !verdict.renderable ? verdict.reasonText : ''
|
|
return verdict.present && !verdict.renderable ? verdict.reasonText : ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const hiddenAnchorText = computed(() => ANCHOR_HIDDEN[anchorLayout.value.reason] || '点位标记当前不可见')
|
|
|
|
|
-/** 仅**标记仍有效**时才给重新定位入口(不对已消失的标记发无效定位)。 */
|
|
|
|
|
-const canRelocate = computed(() => {
|
|
|
|
|
- if (introVisible.value || !detailTarget.value || fixedLocationReason.value) return false
|
|
|
|
|
- return hasMapMarker(detailTarget.value.kind, detailTarget.value.code, detailTarget.value.pointCode, detailTarget.value.key)
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 求当前锚点的落位。
|
|
* 求当前锚点的落位。
|
|
|
* 返回 `{ canvas, layout }`:`canvas` 只作内部判定输入,`layout` 才是写进视图的对象
|
|
* 返回 `{ canvas, layout }`:`canvas` 只作内部判定输入,`layout` 才是写进视图的对象
|
|
@@ -2005,11 +1994,17 @@ const detailStyle = computed(() => {
|
|
|
// (`display:none` 会让 `scrollHeight` 变 0,恢复后面板会先塌成 1px)。
|
|
// (`display:none` 会让 `scrollHeight` 变 0,恢复后面板会先塌成 1px)。
|
|
|
// **必须同时关掉 `pointer-events`**:本组件是 `pointer-events: auto` 的绝对定位浮层,
|
|
// **必须同时关掉 `pointer-events`**:本组件是 `pointer-events: auto` 的绝对定位浮层,
|
|
|
// 只隐藏视觉仍会**拦截它覆盖区域内的地图点击**(看不见却吃掉交互)。
|
|
// 只隐藏视觉仍会**拦截它覆盖区域内的地图点击**(看不见却吃掉交互)。
|
|
|
- // 锚定不到(目标还没上图 / 不在视口内)时**仍要显示**,只是改回 CSS 的靠右固定位置:
|
|
|
|
|
- // 用户点「定位设备」是为了读详情,看不看得见图标不该决定详情能不能读。
|
|
|
|
|
- // 早先这里整块 visibility:hidden,于是面板虽然渲染了、有尺寸,却谁也看不见
|
|
|
|
|
- // (维护者 2026-12-02:data-detail-open 1 of 1、display:flex、618×618,但不可见)。
|
|
|
|
|
- if (!layout.visible) return { visibility: 'visible', pointerEvents: 'auto' }
|
|
|
|
|
|
|
+ //
|
|
|
|
|
+ // 锚定不到(目标还没上图 / 已离开视口)时**暂隐**,由顶栏 `data-anchor-hidden` chip
|
|
|
|
|
+ // 说明原因并给「重新定位 / 关闭」入口。
|
|
|
|
|
+ //
|
|
|
|
|
+ // 这条改了两轮,两个极端都踩过,不要再来回翻:
|
|
|
|
|
+ // · 2026-12-02 之前直接 `visibility:hidden`,但当时目标根本没能上图,于是面板"渲染了却谁也看不见";
|
|
|
|
|
+ // · 2026-12-02 改成"退回 CSS 固定位置",把病根挪到了锚定链上——真机表现为
|
|
|
|
|
+ // **目标离开视口后面板自己固定到一个不该存在的位置**(维护者 2026-12-03 报的正是这条)。
|
|
|
|
|
+ // 现在图标与锚定都能正常解析,所以恢复"锚不到就暂隐":看不见目标时不该给一张
|
|
|
|
|
+ // 位置无依据的面板;无地图位置的那一类仍走上面的 `fixedLocationReason` 固定详情。
|
|
|
|
|
+ if (!layout.visible) return { visibility: 'hidden', pointerEvents: 'none' }
|
|
|
const origin = anchorOrigin.value
|
|
const origin = anchorOrigin.value
|
|
|
return {
|
|
return {
|
|
|
left: `${layout.rect.left - origin.left}px`,
|
|
left: `${layout.rect.left - origin.left}px`,
|
|
@@ -2041,15 +2036,6 @@ const anchorLeadStyle = computed(() => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-/** 暂隐入口的「重新定位」:只对仍有效的监测点标记走统一选择入口(不发明第二条定位路径)。 */
|
|
|
|
|
-function relocateSelected() {
|
|
|
|
|
- const target = detailTarget.value
|
|
|
|
|
- if (!target) return
|
|
|
|
|
- if (target.kind === 'facility-point') return facilityPointStore.select(entityDetailStore.identity, entityDetailStore.detail?.raw)
|
|
|
|
|
- if (target.kind === DEVICE_LAYER_KIND) deviceLayerStore.selectDevice(target.code)
|
|
|
|
|
- else if (target.kind === MAP_OBJECT_KIND.MONITORING_POINT) selectMonitoringPoint(target.code)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 详情选择或地图对象变化 → 立即重算一次落位(不等下一帧)。
|
|
* 详情选择或地图对象变化 → 立即重算一次落位(不等下一帧)。
|
|
|
* `nextTick` 是等卡片挂载/换内容后再量高度:刚打开时 `scrollHeight` 还是 0,
|
|
* `nextTick` 是等卡片挂载/换内容后再量高度:刚打开时 `scrollHeight` 还是 0,
|