|
@@ -49,7 +49,7 @@ import {
|
|
|
// 票 83:几何读数(本体宽 / 绘制宽 / pad)与计划读数同一出口,走查不读 DOM 内部结构。
|
|
// 票 83:几何读数(本体宽 / 绘制宽 / pad)与计划读数同一出口,走查不读 DOM 内部结构。
|
|
|
import { markerGeometryDataset } from '../domain/markerPlan.js'
|
|
import { markerGeometryDataset } from '../domain/markerPlan.js'
|
|
|
// 本票:未关联设备的屏幕拥挤聚合(纯 domain;本层只负责投影/渲染/点击)。
|
|
// 本票:未关联设备的屏幕拥挤聚合(纯 domain;本层只负责投影/渲染/点击)。
|
|
|
-import { AGGREGATE_BADGE, AGGREGATE_KIND, aggregateBadge, canZoomAggregate, groupUnassociatedByScreen, planMemberList } from '../domain/pointAggregation.js'
|
|
|
|
|
|
|
+import { AGGREGATE_BADGE, AGGREGATE_KIND, aggregateBadge, canZoomAggregate, groupUnassociatedByScreen, labelOccludedByAggregates, planMemberList } from '../domain/pointAggregation.js'
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 类名单源:注入的特效 CSS(下方模板串)与 DOM 构建(buildNode/mount)共用同一组常量。
|
|
* 类名单源:注入的特效 CSS(下方模板串)与 DOM 构建(buildNode/mount)共用同一组常量。
|
|
@@ -950,7 +950,8 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
|
|
|
root.dataset.markerOverlayKind = AGGREGATE_KIND
|
|
root.dataset.markerOverlayKind = AGGREGATE_KIND
|
|
|
root.dataset.markerOverlayCode = key
|
|
root.dataset.markerOverlayCode = key
|
|
|
root.dataset.markerOverlayAggregate = 'yes'
|
|
root.dataset.markerOverlayAggregate = 'yes'
|
|
|
- root.style.cssText = 'position:absolute;left:0;top:0;width:' + size + 'px;height:' + size + 'px;pointer-events:auto;cursor:pointer;transform-origin:50% 50%;'
|
|
|
|
|
|
|
+ // z-index 7 > 标签层 6:聚合徽章永远压在单体名称标签之上(「聚合优先」)。
|
|
|
|
|
+ root.style.cssText = 'position:absolute;left:0;top:0;z-index:7;width:' + size + 'px;height:' + size + 'px;pointer-events:auto;cursor:pointer;transform-origin:50% 50%;'
|
|
|
root.style.setProperty('--marker-tone', toneHex)
|
|
root.style.setProperty('--marker-tone', toneHex)
|
|
|
root.title = badge.tooltip || badge.label
|
|
root.title = badge.tooltip || badge.label
|
|
|
|
|
|
|
@@ -1234,6 +1235,9 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
|
|
|
for (const group of badgeGroups) {
|
|
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(`unassociated-equipment|${member.code}`)
|
|
|
}
|
|
}
|
|
|
|
|
+ // 标签避让(2026-11-24):聚合徽章优先;徽章附近的单体名称标签默认折叠,hover 到该单体时展开。
|
|
|
|
|
+ const badgeCenters = badgeGroups.map((group) => group.screen)
|
|
|
|
|
+ const labelBlockedByAggregate = (pos) => labelOccludedByAggregates(pos, badgeCenters)
|
|
|
|
|
|
|
|
for (const marker of markers || []) {
|
|
for (const marker of markers || []) {
|
|
|
const key = `${marker.kind}|${marker.code}`
|
|
const key = `${marker.kind}|${marker.code}`
|
|
@@ -1293,8 +1297,10 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
|
|
|
// 标签(2026-10-28):点位与未关联设备**始终显示**(截断),hover 才展开全名;
|
|
// 标签(2026-10-28):点位与未关联设备**始终显示**(截断),hover 才展开全名;
|
|
|
// 若它是当前选中对象(独立设备被选中)则由下面的 `--active` 正규负责发光,标签仍在。
|
|
// 若它是当前选中对象(独立设备被选中)则由下面的 `--active` 正규负责发光,标签仍在。
|
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
|
- const markerLabel = markerLabelState(hoveredLabelKey === key)
|
|
|
|
|
- applyLabelState(record, markerLabel.visible, markerLabel.expanded)
|
|
|
|
|
|
|
+ const markerHovered = hoveredLabelKey === key
|
|
|
|
|
+ const markerLabel = markerLabelState(markerHovered)
|
|
|
|
|
+ const markerCollapsed = !markerHovered && labelBlockedByAggregate(windowPos)
|
|
|
|
|
+ applyLabelState(record, markerLabel.visible && !markerCollapsed, markerLabel.expanded)
|
|
|
// 选择态发光(2026-10-28 维护者规格④):**非聚合的设备点**(独立未关联设备)被选中时,
|
|
// 选择态发光(2026-10-28 维护者规格④):**非聚合的设备点**(独立未关联设备)被选中时,
|
|
|
// 用与「被选择态」同款的 --active 高亮。聚合设备中心由设备循环的 pinned 负责。
|
|
// 用与「被选择态」同款的 --active 高亮。聚合设备中心由设备循环的 pinned 负责。
|
|
|
const markerActive = marker.kind === 'unassociated-equipment' && markerSelectedCode !== '' && marker.code === markerSelectedCode
|
|
const markerActive = marker.kind === 'unassociated-equipment' && markerSelectedCode !== '' && marker.code === markerSelectedCode
|
|
@@ -1379,10 +1385,12 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
|
|
|
// · ③ 设备常态的中心设备:显示(它此时就是一枚正常设备点);hover 展开全名。
|
|
// · ③ 设备常态的中心设备:显示(它此时就是一枚正常设备点);hover 展开全名。
|
|
|
// · ④ 设备被选择的中心设备:隐藏(与 ② 聚合被选择态同性质)。
|
|
// · ④ 设备被选择的中心设备:隐藏(与 ② 聚合被选择态同性质)。
|
|
|
// · 非聚合设备点(k=1 关联设备):**始终显示** —— 聚合规则不得外溢到它们。
|
|
// · 非聚合设备点(k=1 关联设备):**始终显示** —— 聚合规则不得外溢到它们。
|
|
|
- placeLabel(record, device.x - hostOffset.x, device.y - hostOffset.y)
|
|
|
|
|
|
|
+ const devicePos = { x: device.x - hostOffset.x, y: device.y - hostOffset.y }
|
|
|
|
|
+ placeLabel(record, devicePos.x, devicePos.y)
|
|
|
const isHovered = hoveredLabelKey === key
|
|
const isHovered = hoveredLabelKey === key
|
|
|
const deviceLabel = deviceLabelState(device, isHovered)
|
|
const deviceLabel = deviceLabelState(device, isHovered)
|
|
|
- applyLabelState(record, deviceLabel.visible, deviceLabel.expanded)
|
|
|
|
|
|
|
+ const deviceCollapsed = !isHovered && labelBlockedByAggregate(devicePos)
|
|
|
|
|
+ applyLabelState(record, deviceLabel.visible && !deviceCollapsed, deviceLabel.expanded)
|
|
|
// 圈内设备标记(CSS/走查读这个类;标签显隐已由上面统一驱动,不再靠 CSS 后代选择器)。
|
|
// 圈内设备标记(CSS/走查读这个类;标签显隐已由上面统一驱动,不再靠 CSS 后代选择器)。
|
|
|
record.root.classList.toggle(`${NODE_CLASS}--fan`, device.fan === true)
|
|
record.root.classList.toggle(`${NODE_CLASS}--fan`, device.fan === true)
|
|
|
// 票 76(四态规格 2026-10-26)设备节点:
|
|
// 票 76(四态规格 2026-10-26)设备节点:
|
|
@@ -1493,8 +1501,10 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
|
|
|
if (record.root.style.transform !== transform) record.root.style.transform = transform
|
|
if (record.root.style.transform !== transform) record.root.style.transform = transform
|
|
|
if (record.root.style.display !== 'block') record.root.style.display = 'block'
|
|
if (record.root.style.display !== 'block') record.root.style.display = 'block'
|
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
|
- const facilityLabel = markerLabelState(hoveredLabelKey === key)
|
|
|
|
|
- applyLabelState(record, facilityLabel.visible, facilityLabel.expanded)
|
|
|
|
|
|
|
+ const facilityHovered = hoveredLabelKey === key
|
|
|
|
|
+ const facilityLabel = markerLabelState(facilityHovered)
|
|
|
|
|
+ const facilityCollapsed = !facilityHovered && labelBlockedByAggregate(windowPos)
|
|
|
|
|
+ applyLabelState(record, facilityLabel.visible && !facilityCollapsed, facilityLabel.expanded)
|
|
|
record.root.classList.toggle(`${NODE_CLASS}--active`, selectedFacilityKey === key)
|
|
record.root.classList.toggle(`${NODE_CLASS}--active`, selectedFacilityKey === key)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1537,8 +1547,10 @@ export function syncMarkerOverlay({ markers, devices, aggregates, facilities, se
|
|
|
if (record.root.style.transform !== transform) record.root.style.transform = transform
|
|
if (record.root.style.transform !== transform) record.root.style.transform = transform
|
|
|
if (record.root.style.display !== 'block') record.root.style.display = 'block'
|
|
if (record.root.style.display !== 'block') record.root.style.display = 'block'
|
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
placeLabel(record, windowPos.x, windowPos.y)
|
|
|
- const componentLabel = markerLabelState(hoveredLabelKey === key)
|
|
|
|
|
- applyLabelState(record, componentLabel.visible, componentLabel.expanded)
|
|
|
|
|
|
|
+ const componentHovered = hoveredLabelKey === key
|
|
|
|
|
+ const componentLabel = markerLabelState(componentHovered)
|
|
|
|
|
+ const componentCollapsed = !componentHovered && labelBlockedByAggregate(windowPos)
|
|
|
|
|
+ applyLabelState(record, componentLabel.visible && !componentCollapsed, componentLabel.expanded)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 本轮不在计划里的:隐藏(池复用,不销毁)。
|
|
// 本轮不在计划里的:隐藏(池复用,不销毁)。
|