|
@@ -42,6 +42,7 @@ import {
|
|
|
nudgeOverlap as nudgeOverlapService,
|
|
nudgeOverlap as nudgeOverlapService,
|
|
|
resolveDeviceEffectsOptions,
|
|
resolveDeviceEffectsOptions,
|
|
|
locateMonitoringPoint,
|
|
locateMonitoringPoint,
|
|
|
|
|
+ cancelPointLocate,
|
|
|
setHoveredDevice,
|
|
setHoveredDevice,
|
|
|
setSelectedDevice,
|
|
setSelectedDevice,
|
|
|
syncAssociatedDevices,
|
|
syncAssociatedDevices,
|
|
@@ -108,8 +109,11 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
return list.filter((row) => row.placement === 'drawn')
|
|
return list.filter((row) => row.placement === 'drawn')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function planKeyOf(code, drawn) {
|
|
|
|
|
- return `${code}|${drawn.map((row) => row.code).join(',')}`
|
|
|
|
|
|
|
+ function planKeyOf(code, drawn, maxFan = 10, effects = null) {
|
|
|
|
|
+ return JSON.stringify([code, maxFan, effects, drawn.map((row) => [
|
|
|
|
|
+ row.code, row.longitude, row.latitude, row.status, row.shape, row.size,
|
|
|
|
|
+ row.assetMode, row.assetReason, row.tone,
|
|
|
|
|
+ ])])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -128,7 +132,7 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
|
|
|
|
|
// 票 46:引导态(进入前)不显示任何业务对象 —— 关联设备图层直接撤下。
|
|
// 票 46:引导态(进入前)不显示任何业务对象 —— 关联设备图层直接撤下。
|
|
|
// 数据仍可预取(详情/快照照常),只是**呈现**被门控。
|
|
// 数据仍可预取(详情/快照照常),只是**呈现**被门控。
|
|
|
- if (options.entered === false) {
|
|
|
|
|
|
|
+ if (options.entered === false || options.parentVisible === false) {
|
|
|
token += 1
|
|
token += 1
|
|
|
pointCode.value = ''
|
|
pointCode.value = ''
|
|
|
rows.value = []
|
|
rows.value = []
|
|
@@ -245,7 +249,7 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
const effects = planDeviceEffects({ devices: drawn, ...resolveDeviceEffectsOptions() })
|
|
const effects = planDeviceEffects({ devices: drawn, ...resolveDeviceEffectsOptions() })
|
|
|
effectsPlan.value = effects
|
|
effectsPlan.value = effects
|
|
|
|
|
|
|
|
- const key = planKeyOf(code, drawn)
|
|
|
|
|
|
|
+ const key = planKeyOf(code, drawn, options.maxFan || 10, effects)
|
|
|
|
|
|
|
|
// 同点位的同一份计划**不重画**(翻页/无关重渲染都不会让设备层闪烁)。
|
|
// 同点位的同一份计划**不重画**(翻页/无关重渲染都不会让设备层闪烁)。
|
|
|
// `force` 用于「快照换了、旧图层必须先撤下」这条路径(规格要求先撤后取)。
|
|
// `force` 用于「快照换了、旧图层必须先撤下」这条路径(规格要求先撤后取)。
|
|
@@ -294,6 +298,8 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
/** 上一次的详情层级与设备编码 —— 镜头联动判"该怎么动"要拿它做对照。 */
|
|
/** 上一次的详情层级与设备编码 —— 镜头联动判"该怎么动"要拿它做对照。 */
|
|
|
let lastLevel = DETAIL_LEVEL.NONE
|
|
let lastLevel = DETAIL_LEVEL.NONE
|
|
|
let lastDeviceCode = ''
|
|
let lastDeviceCode = ''
|
|
|
|
|
+ let pendingDeviceTier = false
|
|
|
|
|
+ let deviceFlightToken = 0
|
|
|
|
|
|
|
|
/** 是否需要弱化(该点位设备数 ≥ 阈值)。界面按它决定要不要给"其余设备压暗"的样式。 */
|
|
/** 是否需要弱化(该点位设备数 ≥ 阈值)。界面按它决定要不要给"其余设备压暗"的样式。 */
|
|
|
const dimming = ref(false)
|
|
const dimming = ref(false)
|
|
@@ -345,10 +351,16 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
*/
|
|
*/
|
|
|
function applyDeviceFlight(flight, code) {
|
|
function applyDeviceFlight(flight, code) {
|
|
|
if (flight === DEVICE_FLIGHT.NONE) return ''
|
|
if (flight === DEVICE_FLIGHT.NONE) return ''
|
|
|
|
|
+ const mine = ++deviceFlightToken
|
|
|
|
|
+ if (flight === DEVICE_FLIGHT.DEVICE_TIER) pendingDeviceTier = true
|
|
|
const device = rows.value.find((row) => row.code === code) || null
|
|
const device = rows.value.find((row) => row.code === code) || null
|
|
|
- if (!device || device.placement !== 'drawn') return ''
|
|
|
|
|
- void locateMonitoringPoint(device, {
|
|
|
|
|
- tier: 'device', centerOnly: flight === DEVICE_FLIGHT.CENTER_ONLY,
|
|
|
|
|
|
|
+ if (!device || device.placement !== 'drawn') {
|
|
|
|
|
+ cancelPointLocate()
|
|
|
|
|
+ return ''
|
|
|
|
|
+ }
|
|
|
|
|
+ const centerOnly = flight === DEVICE_FLIGHT.CENTER_ONLY && !pendingDeviceTier
|
|
|
|
|
+ void locateMonitoringPoint(device, { tier: 'device', centerOnly }).then((applied) => {
|
|
|
|
|
+ if (applied && mine === deviceFlightToken && !centerOnly) pendingDeviceTier = false
|
|
|
})
|
|
})
|
|
|
return flight
|
|
return flight
|
|
|
}
|
|
}
|
|
@@ -369,6 +381,9 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
|
|
|
|
|
/** 「返回点位」:清设备强化、回点位级(**监测点仍选中**,不是取消选中)。 */
|
|
/** 「返回点位」:清设备强化、回点位级(**监测点仍选中**,不是取消选中)。 */
|
|
|
function backToPointLevel() {
|
|
function backToPointLevel() {
|
|
|
|
|
+ deviceFlightToken += 1
|
|
|
|
|
+ pendingDeviceTier = false
|
|
|
|
|
+ cancelPointLocate()
|
|
|
const detailStore = useDetailStore()
|
|
const detailStore = useDetailStore()
|
|
|
const before = { level: lastLevel, deviceCode: lastDeviceCode }
|
|
const before = { level: lastLevel, deviceCode: lastDeviceCode }
|
|
|
detailStore.backToPoint()
|
|
detailStore.backToPoint()
|
|
@@ -393,6 +408,11 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
|
|
|
|
|
/** 详情层级变了(外壳订阅)→ 同步内部对照值,避免下一次判定拿错"变化前"。 */
|
|
/** 详情层级变了(外壳订阅)→ 同步内部对照值,避免下一次判定拿错"变化前"。 */
|
|
|
function noteLevel(level, deviceCode) {
|
|
function noteLevel(level, deviceCode) {
|
|
|
|
|
+ if (level !== DETAIL_LEVEL.EQUIPMENT) {
|
|
|
|
|
+ deviceFlightToken += 1
|
|
|
|
|
+ pendingDeviceTier = false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (level === DETAIL_LEVEL.NONE) cancelPointLocate()
|
|
|
lastLevel = level || DETAIL_LEVEL.NONE
|
|
lastLevel = level || DETAIL_LEVEL.NONE
|
|
|
lastDeviceCode = deviceCode || ''
|
|
lastDeviceCode = deviceCode || ''
|
|
|
}
|
|
}
|
|
@@ -442,6 +462,9 @@ export const useDeviceLayerStore = defineStore('deviceLayerStore', () => {
|
|
|
dimming.value = false
|
|
dimming.value = false
|
|
|
lastLevel = DETAIL_LEVEL.NONE
|
|
lastLevel = DETAIL_LEVEL.NONE
|
|
|
lastDeviceCode = ''
|
|
lastDeviceCode = ''
|
|
|
|
|
+ pendingDeviceTier = false
|
|
|
|
|
+ deviceFlightToken += 1
|
|
|
|
|
+ cancelPointLocate()
|
|
|
clearAssociatedDevices()
|
|
clearAssociatedDevices()
|
|
|
}
|
|
}
|
|
|
|
|
|