Selaa lähdekoodia

feat(cockpit): 监测点独立聚合与成员选择

把聚合核心按类别参数化:新增 monitoring-point 命名空间与 groupMonitoringPointsByScreen,设备仍走设备五态、监测点改走点位权威六态(报警>预警>工单>正常>离线>无设备),EMPTY 合法计入数量/状态/成员表,不跨类合并。overlay 同时渲染两类徽章;成员表点击按 group.memberKind 回调真实点位身份;监测点选中经 detailStore.selection.pointCode → mapService.setSelectedPointCode → overlay 从聚合移出并置顶单独显示,关闭详情后归还;requestRenderMode 下主动请求一帧。徽章数量圈标题改用类别量词。
ChenJZ 1 päivä sitten
vanhempi
commit
2dd73ba7bc

+ 7 - 0
src/modules/cockpit/components/MapCanvas.vue

@@ -146,6 +146,8 @@ import {
     syncFacilityMarkersForPlan,
     // 票 101:设施点点击后的镜头定位(与点位/设备同一条地形感知飞行管线)。
     setFacilitySelection,
+    // 04:把「当前打开的监测点」同步给 overlay,用于选中成员从聚合移出。
+    setSelectedPointCode,
     unmountMap,
 } from '../services/mapService.js'
 import { MAP_SUMMARY_PHASE } from '../domain/mapSummary.js'
@@ -204,6 +206,11 @@ const instanceId = ref('')
 // (文案「地图框架已就绪 · 等待分页数据」),随后每取一页才多出点位。
 const mapStore = useMapStore()
 const detailStore = useDetailStore()
+// 04:详情选择 → 当前监测点。打开点位(含从成员列表选中的点)时从聚合移出,
+// 关闭详情后编码清空、该点重新参与聚合。
+watch(() => detailStore.selection.pointCode, (pointCode) => {
+    setSelectedPointCode(pointCode || '')
+}, { immediate: true })
 // 票 43:三维 hover / 点选设备都经这个 store(面板高亮与选中态的唯一持有者)。
 const deviceLayerStore = useDeviceLayerStore()
 const summaryText = computed(() => mapStore.view.label)

+ 116 - 39
src/modules/cockpit/domain/pointAggregation.js

@@ -1,25 +1,31 @@
 /**
- * 未关联设备的屏幕拥挤聚合(本票:未关联设备聚合与成员选择)。
+ * 屏幕拥挤聚合:未关联设备(03)与监测点(04)共用一套分组/成员表/缩放接缝。
  *
- * 纯函数、不 import Vue/Cesium/DOM:输入是**已经投影到窗口坐标**的未关联设备行
+ * 纯函数、不 import Vue/Cesium/DOM:输入是**已经投影到窗口坐标**的对象行
  * (服务层/overlay 每帧用同一枚 projectToWindow 投影),输出是稳定的聚合组与成员表。
  *
  * 第一性原理:
  *   · 聚合只表达**显示拥挤**,不改变成员的真实坐标、身份、状态或统计口径;
- *   · 只聚合同一类对象(未关联设备),不跨类合并;
- *   · 组身份 = 成员编码集合(排序后拼接),成员不变则 groupKey 稳定,相机微移不抖;
+ *   · 三类对象各有独立命名空间,本文件只聚设备与监测点,绝不跨类合并;
+ *   · 组身份 = 类别命名空间 + 成员编码集合(排序后拼接),成员不变 groupKey 稳定;
+ *   · 状态优先级按类别原生词表:设备五态(报警>工单>预警)与点位六态(报警>预警>工单)
+ *     不共用一张表;
  *   · 选中成员从聚合中移出(由调用方传 selectedCode),单独显示并保留详情/状态。
  *
- * 屏幕距离用网格划分 + 并查集,平均 O(n),避免两两比较(密集点位下 O(n^2) 会拖慢每帧)。
+ * 屏幕距离用「排序 + 有界贪心聚类」,避免两两比较(密集点位下 O(n^2) 会拖慢每帧)。
  */
 // 未关联设备的“原生状态”是设备五态(不是点位六态):色/词/优先级都走设备表,
 // 否则工单处置与预警的先后会被点位表带反(设备规则:报警 > 工单处置 > 预警)。
 import { deviceVisualForStatus } from './deviceStatus.js'
 import { industryLabel } from './filterOptions.js'
+import { ringEffectFor } from './markerMetrics.js'
 import { PIPE_PALETTE } from './pipeVisual.js'
+import { visualForStatus } from './pointStatus.js'
 
 /** 聚合符号的 kind(只用于显示/拾取身份,不是业务对象,也不是设备编码)。 */
 export const AGGREGATE_KIND = 'unassociated-equipment-aggregate'
+/** 监测点聚合符号的 kind:与设备聚合**独立命名空间**,同位置也不跨类合并。 */
+export const POINT_AGGREGATE_KIND = 'monitoring-point-aggregate'
 
 /** 默认屏幕合并阈值(px):小于该距离视为拥挤。 */
 export const DEFAULT_MIN_SEPARATION_PX = 22
@@ -99,8 +105,8 @@ export function depthZIndex(distance, { min = 1, max = 900 } = {}) {
 }
 
 /** 类型字的行业色语义:沿用管线行业色单源(燃气红 / 供水蓝 / 排水绿 / 窨井紫)。 */
-export function typeCharOf(industry) {
-    return TYPE_CHAR[industry] || '设'
+export function typeCharOf(industry, fallback = '设') {
+    return TYPE_CHAR[industry] || fallback
 }
 
 export function typeColorOf(industry) {
@@ -108,13 +114,54 @@ export function typeColorOf(industry) {
     return (PIPE_PALETTE[industry] || PIPE_PALETTE.UNKNOWN).color
 }
 
+/**
+ * 聚合类别档案:把「哪些对象、什么状态词表、什么类别文案」收成一份参数。
+ *
+ * 03 的设备聚合与 04 的监测点聚合共用同一套分组/成员表/缩放接缝,但**状态语义不同**:
+ * 设备走设备五态(报警>工单>预警),监测点走后端点位六态(报警>预警>工单>正常>离线>无设备)。
+ * 两者不共享状态优先级、不跨类合并;这里只参数化,不把两套词表揉成一张。
+ */
+const CATEGORY_PROFILE = {
+    'unassociated-equipment': {
+        key: 'unassociated-equipment',
+        memberKind: 'unassociated-equipment',
+        aggregateKind: AGGREGATE_KIND,
+        category: '独立设备',
+        noun: '台独立设备',
+        fallbackTypeChar: '设',
+        fallbackTypeLabel: '设备',
+        toneFallback: 'point-unassociated',
+        visualOf: deviceVisualForStatus,
+        effectOf: (status) => deviceVisualForStatus(status).effect || '',
+    },
+    'monitoring-point': {
+        key: 'monitoring-point',
+        memberKind: 'monitoring-point',
+        aggregateKind: POINT_AGGREGATE_KIND,
+        category: '监测点',
+        noun: '个监测点',
+        fallbackTypeChar: '点',
+        fallbackTypeLabel: '点位',
+        toneFallback: 'point-unknown',
+        visualOf: visualForStatus,
+        // 点位状态表只给优先级/色/形状/文案;动效键仍取 markerMetrics 的同一张 RING_EFFECT 表,
+        // 于是徽章特效与单体点位特效同源(ALARM pulse / WARNING blink / WORK_ORDER spin)。
+        effectOf: (status) => {
+            const ring = ringEffectFor(status)
+            return ring ? ring.effect : ''
+        },
+    },
+}
+
+const EQUIPMENT_PROFILE = CATEGORY_PROFILE['unassociated-equipment']
+
 const EARTH_LAT_METERS = 110540
 const EARTH_LON_METERS = 111320
 const DEG = Math.PI / 180
 
-function isCandidate(item) {
+function isCandidate(item, profile) {
     return Boolean(item)
-        && item.kind === 'unassociated-equipment'
+        && item.kind === profile.memberKind
         && Number.isFinite(item.longitude)
         && Number.isFinite(item.latitude)
         && item.screen
@@ -122,31 +169,35 @@ function isCandidate(item) {
         && Number.isFinite(item.screen.y)
 }
 
-/** 未关联设备的状态优先级:设备五态(报警 > 工单处置 > 预警 > 正常 > 离线 > 未发布)。 */
-export function statusPriority(status) {
-    const visual = deviceVisualForStatus(status || '')
+/**
+ * 状态优先级(缺省按未关联设备的五态;监测点调用方传点位档案)。
+ * 设备:报警 > 工单处置 > 预警 > 正常 > 离线 > 未发布;
+ * 点位:报警 > 预警 > 工单处置 > 正常 > 离线 > 无设备 > 未发布。
+ */
+export function statusPriority(status, profile = EQUIPMENT_PROFILE) {
+    const visual = profile.visualOf(status || '')
     return Number.isFinite(visual.priority) ? visual.priority : 999
 }
 
-function statusSummaryOf(members) {
+function statusSummaryOf(members, profile) {
     const counts = {}
     for (const member of members) {
         const key = member.status || 'UNKNOWN'
         counts[key] = (counts[key] || 0) + 1
     }
     const statuses = Object.keys(counts).map((status) => {
-        const visual = deviceVisualForStatus(status)
+        const visual = profile.visualOf(status)
         return {
             status,
             count: counts[status],
             priority: Number.isFinite(visual.priority) ? visual.priority : 999,
             tone: visual.tone,
             label: visual.label,
-            effect: visual.effect || '',
+            effect: profile.effectOf(status),
         }
     }).sort((a, b) => a.priority - b.priority || String(a.status).localeCompare(String(b.status)))
     const primary = statuses[0] || null
-    // 「异常」= 设备表里带动效的三态(报警/工单处置/预警);角标取最高优先级异常,其余用 +N 种状态。
+    // 「异常」= 该类别词表里带动效的状态(设备三态 / 点位三态);角标取最高优先级异常,其余 +N 种。
     const abnormal = statuses.filter((item) => item.effect !== '')
     return {
         counts,
@@ -188,7 +239,7 @@ export function worldSpanMeters(bounds) {
     return Math.max(latM, lonM)
 }
 
-function buildGroup(rawMembers) {
+function buildGroup(rawMembers, profile) {
     const members = rawMembers.slice().sort((a, b) => String(a.code).localeCompare(String(b.code)))
     const screen = {
         x: members.reduce((sum, item) => sum + item.screen.x, 0) / members.length,
@@ -208,10 +259,20 @@ function buildGroup(rawMembers) {
         .map(([key, count]) => ({ key, count, label: industryLabel(key) || (key || '未标注') }))
         .sort((a, b) => b.count - a.count || a.key.localeCompare(b.key))
     const mixedIndustry = industrySummary.length > 1
+    const statusSummary = statusSummaryOf(members, profile)
     return {
-        kind: AGGREGATE_KIND,
-        // 组身份 = 成员编码集合(成员不变则稳定,相机微移不抖)。
-        groupKey: AGGREGATE_KIND + '|' + codes.join(','),
+        kind: profile.aggregateKind,
+        // 组身份 = 类别命名空间 + 成员编码集合(成员不变则稳定,相机微移不抖)。
+        groupKey: profile.aggregateKind + '|' + codes.join(','),
+        statusProfile: profile.key,
+        memberKind: profile.memberKind,
+        category: profile.category,
+        noun: profile.noun,
+        toneFallback: profile.toneFallback,
+        fallbackTypeChar: profile.fallbackTypeChar,
+        fallbackTypeLabel: profile.fallbackTypeLabel,
+        // 成员表排序用的状态优先级表(点位与设备各一张,不跨类借用)。
+        statusPriorities: Object.fromEntries(statusSummary.statuses.map((item) => [item.status, item.priority])),
         count: members.length,
         members,
         screen,
@@ -223,16 +284,15 @@ function buildGroup(rawMembers) {
         boundsScreen: screenBox,
         boundsWorld,
         spreadPx: Math.hypot(screenBox.maxX - screenBox.minX, screenBox.maxY - screenBox.minY),
-        statusSummary: statusSummaryOf(members),
+        statusSummary,
         industrySummary,
         mixedIndustry,
         primaryIndustry: industrySummary.length ? industrySummary[0].key : '',
-        typeLabel: mixedIndustry ? '混合' : (industrySummary.length ? industrySummary[0].label : '设备'),
-        // 徽章中央大字:混合=混、同质=行业短字(燃/水/排/井),认不出=设。
-        typeChar: mixedIndustry ? '混' : typeCharOf(industrySummary.length ? industrySummary[0].key : ''),
+        typeLabel: mixedIndustry ? '混合' : (industrySummary.length ? industrySummary[0].label : profile.fallbackTypeLabel),
+        // 徽章中央大字:混合=混、同质=行业短字(燃/水/排/井),认不出=类别兜底(设备「设」/点位「点」)。
+        typeChar: mixedIndustry ? '混' : typeCharOf(industrySummary.length ? industrySummary[0].key : '', profile.fallbackTypeChar),
         // 类型色语义:同质用行业色;混合用中性色(避免冒充某一行业)。
         typeColor: mixedIndustry ? PIPE_PALETTE.UNKNOWN.color : typeColorOf(industrySummary.length ? industrySummary[0].key : ''),
-        category: '独立设备',
     }
 }
 
@@ -247,8 +307,9 @@ function buildGroup(rawMembers) {
  * @param {string} [options.selectedCode] 已选成员编码:从聚合中移出,单独显示
  * @returns {{groups: Array, selected: object|null}} 组内 count>1 才应显示为聚合徽章
  */
-export function groupUnassociatedByScreen(items, { minSeparationPx = DEFAULT_MIN_SEPARATION_PX, maxSpreadPx = DEFAULT_MAX_SPREAD_PX, releaseBufferPx = DEFAULT_RELEASE_BUFFER_PX, previousGroups = [], selectedCode = '' } = {}) {
-    const list = (Array.isArray(items) ? items : []).filter(isCandidate)
+function groupByScreen(items, categoryKey, { minSeparationPx = DEFAULT_MIN_SEPARATION_PX, maxSpreadPx = DEFAULT_MAX_SPREAD_PX, releaseBufferPx = DEFAULT_RELEASE_BUFFER_PX, previousGroups = [], selectedCode = '' } = {}) {
+    const profile = CATEGORY_PROFILE[categoryKey] || EQUIPMENT_PROFILE
+    const list = (Array.isArray(items) ? items : []).filter((item) => isCandidate(item, profile))
     const selected = typeof selectedCode === 'string' ? selectedCode : ''
     const pool = list.filter((item) => String(item.code || '') !== selected)
     const selectedRow = selected ? (list.find((item) => String(item.code) === selected) || null) : null
@@ -308,11 +369,24 @@ export function groupUnassociatedByScreen(items, { minSeparationPx = DEFAULT_MIN
         target.members.push(item)
         target.box = mergeBox(target.box, item.screen.x, item.screen.y)
     }
-    const groups = clusters.map((cluster) => buildGroup(cluster.members))
+    const groups = clusters.map((cluster) => buildGroup(cluster.members, profile))
         .sort((a, b) => a.groupKey.localeCompare(b.groupKey))
     return { groups, selected: selectedRow }
 }
 
+/** 未关联设备的屏幕聚合(03 的稳定入口)。 */
+export function groupUnassociatedByScreen(items, options = {}) {
+    return groupByScreen(items, 'unassociated-equipment', options)
+}
+
+/**
+ * 监测点的屏幕聚合(04):与设备**独立命名空间**,同位置也不跨类合并;
+ * 状态改用点位自身权威六态(含 EMPTY「无设备」),不借用设备五态。
+ */
+export function groupMonitoringPointsByScreen(items, options = {}) {
+    return groupByScreen(items, 'monitoring-point', options)
+}
+
 /**
  * 聚合徽章的可显示描述(规格 69–72)。
  *
@@ -332,14 +406,15 @@ export function aggregateBadge(group) {
         ? abnormal.label + ' ' + abnormal.count
         : (primary ? primary.label + ' ' + primary.count : '无')
     return {
-        kind: AGGREGATE_KIND,
+        kind: group.kind || AGGREGATE_KIND,
         code: group.groupKey,
         groupKey: group.groupKey,
         count: group.count,
         category: group.category || '独立设备',
-        label: group.count + ' 台独立设备',
+        noun: group.noun || '台独立设备',
+        label: group.count + ' ' + (group.noun || '台独立设备'),
         // 圆形徽章的描边/角标色:取本组最高优先级状态(异常优先),与成员状态词表同源。
-        tone: abnormal ? abnormal.tone : (primary ? primary.tone : 'point-unassociated'),
+        tone: abnormal ? abnormal.tone : (primary ? primary.tone : (group.toneFallback || 'point-unassociated')),
         primaryStatus: primary ? primary.status : '',
         primaryLabel: primary ? primary.label : '',
         // 角标:最高优先级异常及数量;otherAbnormalCount = 其余异常**状态种数**(+N 种)。
@@ -350,14 +425,14 @@ export function aggregateBadge(group) {
         effect: abnormal ? abnormal.effect : '',
         // 类型:同质给具体行业(图案),混合给通用(typeLabel=混合、industryKey 为空)。
         mixedIndustry: Boolean(group.mixedIndustry),
-        typeLabel: group.typeLabel || (group.mixedIndustry ? '混合' : '设备'),
-        typeChar: group.typeChar || (group.mixedIndustry ? '混' : '设'),
+        typeLabel: group.typeLabel || (group.mixedIndustry ? '混合' : (group.fallbackTypeLabel || '设备')),
+        typeChar: group.typeChar || (group.mixedIndustry ? '混' : (group.fallbackTypeChar || '设')),
         typeColor: group.typeColor || PIPE_PALETTE.UNKNOWN.color,
         industryKey: group.mixedIndustry ? '' : (group.primaryIndustry || ''),
         types: group.industrySummary || [],
         statuses,
         tooltip: [
-            group.count + ' 台独立设备',
+            group.count + ' ' + (group.noun || '台独立设备'),
             '类型:' + (typeText || '未标注'),
             '状态:' + (statusText || '状态未发布'),
             '最高优先级:' + highestText,
@@ -371,7 +446,7 @@ export function canZoomAggregate(group, { minSpreadPx = DEFAULT_MIN_SPREAD_PX, m
     return group.spreadPx > minSpreadPx && worldSpanMeters(group.boundsWorld) > minSpanMeters
 }
 
-function sortRows(rows, sort) {
+function sortRows(rows, sort, priorityOf = statusPriority) {
     const list = rows.slice()
     if (sort === 'name' || sort === 'code') {
         const field = sort
@@ -379,7 +454,7 @@ function sortRows(rows, sort) {
         return list
     }
     // 默认:风险优先(报警→预警→工单→…),再按名称/编码稳定排序。
-    list.sort((a, b) => statusPriority(a.status) - statusPriority(b.status)
+    list.sort((a, b) => priorityOf(a.status) - priorityOf(b.status)
         || String(a.name || '').localeCompare(String(b.name || ''))
         || String(a.code || '').localeCompare(String(b.code || '')))
     return list
@@ -392,9 +467,11 @@ export function planMemberList(group, { query = '', sort = 'risk' } = {}) {
     const filtered = q
         ? members.filter((item) => String(item.name || '').toLowerCase().includes(q) || String(item.code || '').toLowerCase().includes(q))
         : members
-    // 成员表要能回答「有哪些设备、什么类型、什么状态」:逐行补原生状态与类型的中文词。
+    // 成员表要能回答「有哪些对象、什么类型、什么状态」:逐行补**该类别原生**状态与类型中文词。
+    const profile = CATEGORY_PROFILE[group && group.statusProfile] || EQUIPMENT_PROFILE
+    const priorities = (group && group.statusPriorities) || {}
     const rows = filtered.map((item) => {
-        const visual = deviceVisualForStatus(item.status || '')
+        const visual = profile.visualOf(item.status || '')
         return {
             ...item,
             statusLabel: visual.label,
@@ -402,7 +479,7 @@ export function planMemberList(group, { query = '', sort = 'risk' } = {}) {
             industryLabel: industryLabel(item.industry) || (item.industry || '未标注'),
         }
     })
-    return sortRows(rows, sort)
+    return sortRows(rows, sort, (status) => (Number.isFinite(priorities[status]) ? priorities[status] : 999))
 }
 
 /**

+ 26 - 0
src/modules/cockpit/services/mapService.js

@@ -1348,6 +1348,8 @@ async function bootEngine(record) {
                     // (独立未关联设备 / k=1 关联设备)上「被选择态」同款高亮;
                     // 聚合设备的中心态另由引擎 `pinned` 标志表达,两者不混用。
                     selectedCode: getSelectedDevice(),
+                    // 04:选中的监测点从聚合移出,单独显示并保持两级详情。
+                    selectedPointCode: getSelectedPointCode(),
                     tones: colors,
                     // 票 45/84/85:摘要标记与关联设备各自的动效键(门控/降级判定都在 domain 计划里;
                     // 降级时键仍在,只把收敛系数下传,环不消失)。
@@ -1471,6 +1473,8 @@ export function unmountMap() {
     refreshCombinedEffectState()
     selectedFacilityKey = ''
     facilitySelectionIdentity = null
+    // 04:卸载后不能把「上次打开的监测点」留给下一次挂载,否则该点会被永久排除在聚合外。
+    selectedPointCode = ''
     pipeComponentRows = []
     pipeSyncDeferred = false
     pipeSyncDeferredPlan = null
@@ -3872,6 +3876,8 @@ function paintDeviceState() {
 
 /** 当前选中设备(`deviceCode`)与三维 hover 设备(`deviceCode`)。 */
 let selectedDeviceCode = ''
+/** 当前打开两级详情的监测点编码:overlay 据此把该点从聚合移出、保持单体标记。 */
+let selectedPointCode = ''
 /**
  * 票 76(四态规格):一次点击内,`setSelectedDevice` 该落 ③ 还是 ④。
  *
@@ -4003,6 +4009,26 @@ export function getSelectedDevice() {
     return selectedDeviceCode
 }
 
+/** 当前打开两级详情的监测点编码(空串=没有打开点位详情)。 */
+export function getSelectedPointCode() {
+    return selectedPointCode
+}
+
+/**
+ * 详情选择变化时同步「当前监测点」——由 MapCanvas 在 `detailStore.selection` 变化时调用。
+ * 只影响聚合的「选中成员移出」,不改详情/镜头/业务选择本身。
+ */
+export function setSelectedPointCode(code) {
+    const next = typeof code === 'string' ? code : ''
+    if (next !== selectedPointCode && instance && instance.viewer && instance.viewer.scene
+        && typeof instance.viewer.scene.requestRender === 'function') {
+        // requestRenderMode:详情开关本身不一定产生新帧;主动请一帧让聚合立刻剔除/归还该点。
+        instance.viewer.scene.requestRender()
+    }
+    selectedPointCode = next
+    return selectedPointCode
+}
+
 /**
  * 三维 hover 一台设备(pointermove 拾取调用;空串=离开设备)。
  *

+ 39 - 16
src/modules/cockpit/services/markerOverlay.js

@@ -49,7 +49,7 @@ import {
 // 票 83:几何读数(本体宽 / 绘制宽 / pad)与计划读数同一出口,走查不读 DOM 内部结构。
 import { markerGeometryDataset } from '../domain/markerPlan.js'
 // 本票:未关联设备的屏幕拥挤聚合(纯 domain;本层只负责投影/渲染/点击)。
-import { AGGREGATE_BADGE, AGGREGATE_KIND, aggregateBadge, canZoomAggregate, depthZIndex, groupUnassociatedByScreen, labelOccludedByAggregates, planMemberList } from '../domain/pointAggregation.js'
+import { AGGREGATE_BADGE, AGGREGATE_KIND, aggregateBadge, canZoomAggregate, depthZIndex, groupMonitoringPointsByScreen, groupUnassociatedByScreen, labelOccludedByAggregates, planMemberList } from '../domain/pointAggregation.js'
 
 /**
  * 类名单源:注入的特效 CSS(下方模板串)与 DOM 构建(buildNode/mount)共用同一组常量。
@@ -508,6 +508,8 @@ const aggregateGroups = new Map()
 let aggregateSelectedCode = ''
 /** 上一帧的聚合分组:供迟滞判断「已进组」成员(边界抖动不进出)。 */
 let lastAggregateGroups = []
+/** 监测点聚合的上一帧分组(与设备分组分开,互不串用迟滞历史)。 */
+let lastPointAggregateGroups = []
 /** 成员列表面板(宿主子节点,单例)。 */
 let memberListEl = null
 let memberListGroupKey = ''
@@ -904,6 +906,9 @@ function badgeFingerprint(badge) {
     const statusFp = (badge.statuses || []).map((item) => item.status + ':' + item.count).join(',')
     const typeFp = (badge.types || []).map((item) => item.key + ':' + item.count).join(',')
     return [
+        badge.kind,
+        badge.category,
+        badge.noun,
         badge.count,
         badge.primaryStatus,
         badge.abnormal ? badge.abnormal.status : '',
@@ -921,7 +926,7 @@ function badgeFingerprint(badge) {
 }
 
 /**
- * 聚合徽章节点(规格 69–72,**36px 方案**)。
+ * 聚合徽章节点(规格 69–72,**36px 方案**;未关联设备 / 监测点共用)。
  *
  * 布局(2026-11-24 维护者要求):中央 = **类型大字**(燃/水/排/井/混,行业色语义,
  * 不使用设备图标);左上 = **数量提示圈(放大)**;右上 = 最高优先级异常数量(其余异常 +N 种);
@@ -939,7 +944,7 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
     const root = document.createElement('div')
     root.className = NODE_CLASS + ' ' + NODE_CLASS + '--aggregate'
     root.dataset.markerOverlayKey = key
-    root.dataset.markerOverlayKind = AGGREGATE_KIND
+    root.dataset.markerOverlayKind = badge.kind || AGGREGATE_KIND
     root.dataset.markerOverlayCode = key
     root.dataset.markerOverlayAggregate = 'yes'
     // 层级不再写死:由 renderAggregates 按「组内最近成员的相机距离」动态给 z-index。
@@ -984,7 +989,7 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
     // 左上 = 数量提示圈(放大到 20px,可容纳三位数)。
     const countEl = document.createElement('div')
     countEl.textContent = String(badge.count)
-    countEl.title = badge.count + ' 台独立设备'
+    countEl.title = badge.count + ' ' + (badge.noun || '台独立设备')
     countEl.style.cssText = [
         'position:absolute',
         'left:' + (-Math.round(bubble * 0.35)) + 'px',
@@ -1110,7 +1115,7 @@ function openMemberList(group, onPick) {
     const header = document.createElement('div')
     header.style.cssText = 'display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;'
     const title = document.createElement('strong')
-    title.textContent = group.count + ' 台独立设备'
+    title.textContent = group.count + ' ' + (group.noun || '台独立设备')
     const close = document.createElement('button')
     close.type = 'button'
     close.textContent = '关闭'
@@ -1141,9 +1146,12 @@ function openMemberList(group, onPick) {
             button.addEventListener('pointerout', () => { button.style.background = 'transparent' })
             button.addEventListener('click', (event) => {
                 event.stopPropagation()
-                aggregateSelectedCode = row.code
+                // 设备:本地立刻把成员移出聚合;监测点:由详情选择驱动 selectedPointCode,
+                // 下一帧从聚合移出并保持单体标记与两级详情。
+                const memberKind = group.memberKind || 'unassociated-equipment'
+                if (memberKind === 'unassociated-equipment') aggregateSelectedCode = row.code
                 closeMemberList()
-                if (typeof onPick === 'function') onPick({ kind: 'unassociated-equipment', code: row.code, key: 'unassociated-equipment|' + row.code })
+                if (typeof onPick === 'function') onPick({ kind: memberKind, code: row.code, key: memberKind + '|' + row.code })
             })
             const name = document.createElement('span')
             name.textContent = row.name || row.code
@@ -1183,7 +1191,7 @@ function handleAggregateClick(group, { onAggregateZoom, onPick } = {}) {
     openMemberList(group, onPick)
 }
 
-export function syncMarkerOverlay({ markers, devices, aggregates, facilities, selectedFacilityKey, pipeComponents, pipeComponentsVisible, pointScales, tones, planOf, facilityPlanOf, componentPlanOf, effectOf, deviceEffectOf, facilityEffectOf, converge, selectedCode, projectToWindow }) {
+export function syncMarkerOverlay({ markers, devices, aggregates, facilities, selectedFacilityKey, pipeComponents, pipeComponentsVisible, pointScales, tones, planOf, facilityPlanOf, componentPlanOf, effectOf, deviceEffectOf, facilityEffectOf, converge, selectedCode, selectedPointCode, projectToWindow }) {
     if (!hostNode || !hostNode.isConnected || typeof projectToWindow !== 'function') return
     // 每帧刷新门控查询(mapService 在计划变化时给新闭包;这里只搬运、不判定)。
     frameEffectOf = typeof effectOf === 'function' ? effectOf : () => ''
@@ -1211,13 +1219,14 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
         const pos = projectToWindow(marker.longitude, marker.latitude)
         if (pos && Number.isFinite(pos.x) && Number.isFinite(pos.y)) windowPositions.set(`${marker.kind}|${marker.code}`, pos)
     }
-    // 未关联设备按屏幕拥挤分组:成员节点本轮隐藏,由聚合徽章代表;选中成员已由 domain 移出。
+    // 03 未关联设备 / 04 监测点:各自独立命名空间,同位置也不跨类合并。
     const aggregateRows = []
+    const pointAggregateRows = []
     for (const marker of markers || []) {
-        if (!marker || marker.kind !== 'unassociated-equipment') continue
+        if (!marker) continue
         const pos = windowPositions.get(`${marker.kind}|${marker.code}`)
         if (!pos) continue
-        aggregateRows.push({
+        const row = {
             kind: marker.kind,
             code: marker.code,
             name: marker.name || '',
@@ -1226,7 +1235,9 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
             longitude: marker.longitude,
             latitude: marker.latitude,
             screen: pos,
-        })
+        }
+        if (marker.kind === 'unassociated-equipment') aggregateRows.push(row)
+        else if (marker.kind === 'monitoring-point') pointAggregateRows.push(row)
     }
     // 迟滞:带上上一帧的组,已进组成员要拉开「阈值 + 缓冲」才释放(防止边界闪烁)。
     if (!aggregateRows.length) lastAggregateGroups = []
@@ -1235,10 +1246,18 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
         previousGroups: lastAggregateGroups,
     })
     lastAggregateGroups = aggregateResult.groups
-    const badgeGroups = aggregateResult.groups.filter((group) => group.count > 1)
+    if (!pointAggregateRows.length) lastPointAggregateGroups = []
+    const pointAggregateResult = groupMonitoringPointsByScreen(pointAggregateRows, {
+        // 选中的监测点从聚合移出,单独显示并保持两级详情(选中态由详情 store 驱动)。
+        selectedCode: typeof selectedPointCode === 'string' ? selectedPointCode : '',
+        previousGroups: lastPointAggregateGroups,
+    })
+    lastPointAggregateGroups = pointAggregateResult.groups
+    const badgeGroups = [...aggregateResult.groups, ...pointAggregateResult.groups]
+        .filter((group) => group.count > 1)
     const groupedMemberKeys = new Set()
     for (const group of badgeGroups) {
-        for (const member of group.members) groupedMemberKeys.add(`unassociated-equipment|${member.code}`)
+        for (const member of group.members) groupedMemberKeys.add(`${group.memberKind}|${member.code}`)
     }
     // 标签避让(2026-11-24):聚合徽章优先;徽章附近的单体名称标签默认折叠,hover 到该单体时展开。
     const badgeCenters = badgeGroups.map((group) => group.screen)
@@ -1300,7 +1319,10 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
         }
         if (record.root.style.display !== 'block') record.root.style.display = 'block'
         // 深度排序:图标 = 2z,标签 = 2z+1(标签略高于自身图标,低于更近的图标)。
-        const markerDepth = depthZIndex(windowPos.distance)
+        // 04:已选中的监测点单独显示时置顶,且标签不被邻近聚合折叠 —— 否则「保持选择」只剩一个点。
+        const selectedPoint = marker.kind === 'monitoring-point' && marker.code === selectedPointCode
+        // 901 > depthZIndex 上限 900:选中点连同标签压过所有徽章(图标 1802、标签 1803)。
+        const markerDepth = selectedPoint ? 901 : depthZIndex(windowPos.distance)
         const markerZ = String(markerDepth * 2)
         if (record.root.style.zIndex !== markerZ) record.root.style.zIndex = markerZ
         if (record.labelWrap) {
@@ -1312,7 +1334,7 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
         placeLabel(record, windowPos.x, windowPos.y)
         const markerHovered = hoveredLabelKey === key
         const markerLabel = markerLabelState(markerHovered)
-        const markerCollapsed = !markerHovered && labelBlockedByAggregate(windowPos)
+        const markerCollapsed = !markerHovered && !selectedPoint && labelBlockedByAggregate(windowPos)
         applyLabelState(record, markerLabel.visible && !markerCollapsed, markerLabel.expanded)
         // 选择态发光(2026-10-28 维护者规格④):**非聚合的设备点**(独立未关联设备)被选中时,
         // 用与「被选择态」同款的 --active 高亮。聚合设备中心由设备循环的 pinned 负责。
@@ -1674,6 +1696,7 @@ export function unmountMarkerOverlay() {
     aggregateGroups.clear()
     aggregateSelectedCode = ''
     lastAggregateGroups = []
+    lastPointAggregateGroups = []
     pool.clear()
 }