|
|
@@ -49,7 +49,7 @@ import {
|
|
|
// 票 83:几何读数(本体宽 / 绘制宽 / pad)与计划读数同一出口,走查不读 DOM 内部结构。
|
|
|
import { markerGeometryDataset, innerIconFor } from '../domain/markerPlan.js'
|
|
|
// 本票:未关联设备的屏幕拥挤聚合(纯 domain;本层只负责投影/渲染/点击)。
|
|
|
-import { AGGREGATE_KIND, aggregateBadge, canZoomAggregate, groupUnassociatedByScreen, planMemberList } from '../domain/pointAggregation.js'
|
|
|
+import { AGGREGATE_BADGE, AGGREGATE_KIND, aggregateBadge, canZoomAggregate, groupUnassociatedByScreen, planMemberList } from '../domain/pointAggregation.js'
|
|
|
|
|
|
/**
|
|
|
* 类名单源:注入的特效 CSS(下方模板串)与 DOM 构建(buildNode/mount)共用同一组常量。
|
|
|
@@ -393,7 +393,8 @@ function buildAggregateNode(key, row, toneHex, plan) {
|
|
|
`top:${-(h + pad)}px`,
|
|
|
`width:${plan.draw.width}px`,
|
|
|
`height:${plan.draw.height}px`,
|
|
|
- plan.desaturate ? 'filter:saturate(0.55) brightness(0.72)' : '',
|
|
|
+ // 美化:在原有降饱和之外补一层极轻的落影,让图标在浅色地形/底图上仍能「立住」。
|
|
|
+ 'filter:' + (plan.desaturate ? 'saturate(0.55) brightness(0.72) ' : '') + 'drop-shadow(0 2px 3px rgba(0,0,0,0.55))',
|
|
|
].join(';')
|
|
|
svg.style.transformOrigin = `${pad + w * plan.anchor.x}px ${h + pad}px`
|
|
|
root.appendChild(svg)
|
|
|
@@ -600,7 +601,8 @@ function buildNode(key, marker, plan, toneHex, fx) {
|
|
|
`top:${-(h + pad)}px`,
|
|
|
`width:${plan.draw.width}px`,
|
|
|
`height:${plan.draw.height}px`,
|
|
|
- plan.desaturate ? 'filter:saturate(0.55) brightness(0.72)' : '',
|
|
|
+ // 美化:在原有降饱和之外补一层极轻的落影,让图标在浅色地形/底图上仍能「立住」。
|
|
|
+ 'filter:' + (plan.desaturate ? 'saturate(0.55) brightness(0.72) ' : '') + 'drop-shadow(0 2px 3px rgba(0,0,0,0.55))',
|
|
|
].join(';')
|
|
|
// 反应量缩放的**原点 = 尖端**(尖端固定在地面坐标上,标记围绕尖端放大/缩小,
|
|
|
// 与 billboard verticalOrigin:BOTTOM + scale 同一行为)。
|
|
|
@@ -925,13 +927,20 @@ function badgeFingerprint(badge) {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 聚合徽章节点(规格 69–72):圆形 40px,常驻「类别 + 准确成员数」,
|
|
|
- * 左上角是类型图案(同质单一行业)/通用“混”,右上角是最高优先级异常及数量(+N 种),
|
|
|
- * 外圈按最高优先级异常挂**唯一一套**聚合级特效,title 汇总类型与状态分布。
|
|
|
+ * 聚合徽章节点(规格 69–72,**36px 方案**)。
|
|
|
+ *
|
|
|
+ * 视觉:径向高光的玻璃质感圆盘 + 状态色描边/外辉光 + 中心成员数;
|
|
|
+ * 左上角类型角标(同质行业图案 / 混合“混”)、右上角最高优先级异常数量(其余异常 +N 种);
|
|
|
+ * 下方类别短文案;外圈只挂一套与最高异常一致的聚合级特效。
|
|
|
*/
|
|
|
function buildUnassociatedAggregateNode(key, badge, tones) {
|
|
|
const palette = tones || {}
|
|
|
const toneHex = palette[badge.tone] || palette.neutral || '#01abea'
|
|
|
+ const abnormalTone = badge.abnormal ? (palette[badge.abnormal.tone] || toneHex) : toneHex
|
|
|
+ const size = AGGREGATE_BADGE.size
|
|
|
+ const chip = AGGREGATE_BADGE.typeChip
|
|
|
+ const corner = AGGREGATE_BADGE.statusCorner
|
|
|
+ const half = size / 2
|
|
|
|
|
|
const root = document.createElement('div')
|
|
|
root.className = NODE_CLASS + ' ' + NODE_CLASS + '--aggregate'
|
|
|
@@ -939,7 +948,7 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
|
|
|
root.dataset.markerOverlayKind = AGGREGATE_KIND
|
|
|
root.dataset.markerOverlayCode = key
|
|
|
root.dataset.markerOverlayAggregate = 'yes'
|
|
|
- root.style.cssText = 'position:absolute;left:0;top:0;width:40px;height:40px;pointer-events:auto;cursor:pointer;transform-origin:50% 50%;'
|
|
|
+ root.style.cssText = 'position:absolute;left:0;top:0;width:' + size + 'px;height:' + size + 'px;pointer-events:auto;cursor:pointer;transform-origin:50% 50%;'
|
|
|
root.style.setProperty('--marker-tone', toneHex)
|
|
|
root.title = badge.tooltip || badge.label
|
|
|
|
|
|
@@ -948,27 +957,51 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
|
|
|
if (badge.effect && badge.effectStatus) {
|
|
|
const profile = effectProfileFor(badge.effectStatus)
|
|
|
if (profile && profile.effect === badge.effect) {
|
|
|
- fxHost = buildFxLayers({ effect: profile.effect, profile, converge: null }, { draw: { width: 40 } }, toneHex, key)
|
|
|
+ fxHost = buildFxLayers({ effect: profile.effect, profile, converge: null }, { draw: { width: size } }, toneHex, key)
|
|
|
+ // 聚合级特效收敛:多个聚合相邻时,脉冲环不应互相压叠到看不见徽章。
|
|
|
+ fxHost.style.transform = 'scale(' + AGGREGATE_BADGE.effectScale + ')'
|
|
|
+ fxHost.style.opacity = String(AGGREGATE_BADGE.effectOpacity)
|
|
|
root.appendChild(fxHost)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 圆盘:径向高光(左上受光)+ 深色玻璃底 + 状态色描边与柔光。
|
|
|
const circle = document.createElement('div')
|
|
|
- circle.style.cssText = 'position:absolute;left:0;top:0;width:40px;height:40px;border-radius:50%;border:2px solid ' + toneHex + ';background:rgba(2,9,27,0.92);display:flex;align-items:center;justify-content:center;box-shadow:0 0 10px ' + toneHex + '66;'
|
|
|
+ circle.style.cssText = [
|
|
|
+ 'position:absolute', 'left:0', 'top:0',
|
|
|
+ 'width:' + size + 'px', 'height:' + size + 'px', 'border-radius:50%',
|
|
|
+ 'border:1.5px solid ' + toneHex,
|
|
|
+ 'background:radial-gradient(circle at 34% 28%, rgba(255,255,255,0.22) 0%, rgba(3,15,34,0.96) 56%, rgba(2,9,27,0.99) 100%)',
|
|
|
+ 'box-shadow:inset 0 0 0 1px rgba(255,255,255,0.10), inset 0 -6px 10px rgba(0,0,0,0.45), 0 0 12px ' + toneHex + '59, 0 4px 10px rgba(0,0,0,0.55)',
|
|
|
+ 'display:flex', 'align-items:center', 'justify-content:center',
|
|
|
+ ].join(';')
|
|
|
+ const sheen = document.createElement('div')
|
|
|
+ sheen.style.cssText = 'position:absolute;inset:1px;border-radius:50%;background:linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 52%);pointer-events:none;'
|
|
|
+ circle.appendChild(sheen)
|
|
|
const countEl = document.createElement('span')
|
|
|
countEl.textContent = String(badge.count)
|
|
|
- countEl.style.cssText = 'color:#fff;font:600 15px/1 monospace;'
|
|
|
+ countEl.style.cssText = 'position:relative;color:#f4fbff;font:700 13px/1 "Bahnschrift","DIN Alternate","Segoe UI",monospace;letter-spacing:-0.02em;text-shadow:0 1px 3px rgba(0,0,0,0.85);'
|
|
|
circle.appendChild(countEl)
|
|
|
root.appendChild(circle)
|
|
|
|
|
|
- // 类型图案:同质单一行业 → 该行业图案;混合 → 通用「混」。
|
|
|
+ // 类型角标:同质单一行业 → 该行业图案;混合 → 通用「混」。
|
|
|
const typeEl = document.createElement('div')
|
|
|
- typeEl.style.cssText = 'position:absolute;left:-6px;top:-6px;width:18px;height:18px;border-radius:50%;background:rgba(2,9,27,0.96);border:1px solid rgba(1,171,234,0.55);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#9fd8f2;font:600 10px/1 sans-serif;'
|
|
|
+ typeEl.style.cssText = [
|
|
|
+ 'position:absolute',
|
|
|
+ 'left:' + (-Math.round(chip * 0.3)) + 'px',
|
|
|
+ 'top:' + (-Math.round(chip * 0.3)) + 'px',
|
|
|
+ 'width:' + chip + 'px', 'height:' + chip + 'px', 'border-radius:50%',
|
|
|
+ 'background:radial-gradient(circle at 40% 30%, rgba(255,255,255,0.14), rgba(2,10,24,0.98) 70%)',
|
|
|
+ 'border:1px solid ' + toneHex + '88',
|
|
|
+ 'box-shadow:0 1px 4px rgba(0,0,0,0.65), 0 0 6px ' + toneHex + '33',
|
|
|
+ 'display:flex', 'align-items:center', 'justify-content:center', 'overflow:hidden',
|
|
|
+ 'color:#cfe9ff', 'font:700 8px/1 "Segoe UI",sans-serif',
|
|
|
+ ].join(';')
|
|
|
const iconKey = badge.industryKey ? innerIconFor(badge.industryKey) : ''
|
|
|
if (iconKey) {
|
|
|
const img = document.createElement('img')
|
|
|
img.alt = badge.typeLabel
|
|
|
- img.style.cssText = 'width:14px;height:14px;display:block;'
|
|
|
+ img.style.cssText = 'width:' + (chip - 4) + 'px;height:' + (chip - 4) + 'px;display:block;'
|
|
|
renderInnerIconUrl(iconKey).then((url) => { img.src = url }).catch(() => {})
|
|
|
typeEl.appendChild(img)
|
|
|
} else {
|
|
|
@@ -977,22 +1010,47 @@ function buildUnassociatedAggregateNode(key, badge, tones) {
|
|
|
typeEl.title = '类型:' + badge.typeLabel
|
|
|
root.appendChild(typeEl)
|
|
|
|
|
|
- // 角标:最高优先级异常及数量;其余异常用 +N 种状态提示。
|
|
|
+ // 异常角标:最高优先级异常数量;其余异常以紧凑 +N 种提示。
|
|
|
const statusEl = document.createElement('div')
|
|
|
if (badge.abnormal) {
|
|
|
- statusEl.textContent = badge.abnormal.count + (badge.otherAbnormalCount > 0 ? ' +' + badge.otherAbnormalCount : '')
|
|
|
+ statusEl.textContent = String(badge.abnormal.count)
|
|
|
statusEl.title = badge.abnormal.label + ' ' + badge.abnormal.count
|
|
|
+ (badge.otherAbnormalCount > 0 ? ' · 另有 ' + badge.otherAbnormalCount + ' 种异常状态' : '')
|
|
|
- const abnormalTone = palette[badge.abnormal.tone] || toneHex
|
|
|
- statusEl.style.cssText = 'position:absolute;right:-10px;top:-10px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:' + abnormalTone + ';color:#02091b;font:700 10px/16px monospace;text-align:center;box-shadow:0 0 6px ' + abnormalTone + ';'
|
|
|
+ statusEl.style.cssText = [
|
|
|
+ 'position:absolute',
|
|
|
+ 'right:' + (-Math.round(corner * 0.55)) + 'px',
|
|
|
+ 'top:' + (-Math.round(corner * 0.55)) + 'px',
|
|
|
+ 'min-width:' + corner + 'px', 'height:' + corner + 'px',
|
|
|
+ 'padding:0 3px', 'border-radius:' + Math.round(corner / 2) + 'px',
|
|
|
+ 'background:linear-gradient(180deg, ' + abnormalTone + ', ' + abnormalTone + 'cc)',
|
|
|
+ 'border:1px solid rgba(255,255,255,0.35)',
|
|
|
+ 'box-shadow:0 0 8px ' + abnormalTone + 'cc, 0 2px 4px rgba(0,0,0,0.5)',
|
|
|
+ 'color:#04121f', 'font:800 9px/' + corner + 'px "Bahnschrift",monospace',
|
|
|
+ 'text-align:center',
|
|
|
+ ].join(';')
|
|
|
+ if (badge.otherAbnormalCount > 0) {
|
|
|
+ const more = document.createElement('span')
|
|
|
+ more.textContent = '+' + badge.otherAbnormalCount
|
|
|
+ more.style.cssText = 'position:absolute;right:-10px;top:-7px;padding:1px 2px;border-radius:4px;background:rgba(2,9,27,0.98);border:1px solid ' + abnormalTone + ';color:' + abnormalTone + ';font:700 8px/1 "Bahnschrift",monospace;'
|
|
|
+ statusEl.appendChild(more)
|
|
|
+ }
|
|
|
} else {
|
|
|
statusEl.style.display = 'none'
|
|
|
}
|
|
|
root.appendChild(statusEl)
|
|
|
|
|
|
+ // 类别短文案(常驻)。
|
|
|
const label = document.createElement('span')
|
|
|
label.textContent = badge.category
|
|
|
- label.style.cssText = 'position:absolute;left:50%;top:42px;transform:translateX(-50%);padding:1px 5px;border-radius:3px;background:rgba(2,9,27,0.92);color:#9fd8f2;font:11px/1.4 sans-serif;white-space:nowrap;'
|
|
|
+ label.style.cssText = [
|
|
|
+ 'position:absolute', 'left:50%', 'top:' + AGGREGATE_BADGE.labelOffset + 'px', 'transform:translateX(-50%)',
|
|
|
+ 'padding:1px 6px', 'border-radius:5px',
|
|
|
+ 'background:rgba(2,9,27,0.72)',
|
|
|
+ 'border:1px solid rgba(140,200,255,0.22)',
|
|
|
+ 'color:#b9dcf2', 'font:600 9px/1.35 "Microsoft YaHei UI","PingFang SC",sans-serif',
|
|
|
+ 'letter-spacing:0.02em', 'white-space:nowrap',
|
|
|
+ 'box-shadow:0 2px 6px rgba(0,0,0,0.4)',
|
|
|
+ ].join(';')
|
|
|
root.appendChild(label)
|
|
|
|
|
|
return { root, countEl, typeEl, statusEl, labelEl: label, fxHost, fp: badgeFingerprint(badge) }
|