|
|
@@ -170,10 +170,29 @@ export default {
|
|
|
let nodeData = {
|
|
|
id: mapData.id || (mapData.position[0] + mapData.position[1]),
|
|
|
label: mapData.road,
|
|
|
- // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
|
|
|
pixelX: pixel ? Math.round(pixel.x / scale) : 950,
|
|
|
pixelY: pixel ? Math.round(pixel.y / scale) : 430,
|
|
|
}
|
|
|
+ // 离线/降级/故障:显示小弹窗提示状态
|
|
|
+ const abnormalNames = ['离线', '降级', '故障'];
|
|
|
+ if (abnormalNames.includes(mapData.statusLabel || mapData.name)) {
|
|
|
+ const statusText = mapData.statusLabel || mapData.name;
|
|
|
+ this.$refs.layout.openDialog({
|
|
|
+ id: 'offline_tip_' + nodeData.id,
|
|
|
+ title: nodeData.label,
|
|
|
+ component: 'OfflineTip',
|
|
|
+ width: 260,
|
|
|
+ height: 100,
|
|
|
+ center: false,
|
|
|
+ showClose: false,
|
|
|
+ noPadding: false,
|
|
|
+ draggable: false,
|
|
|
+ resizable: false,
|
|
|
+ position: { x: (nodeData.pixelX || 950) + 10, y: nodeData.pixelY || 430 },
|
|
|
+ data: { status: statusText, road: nodeData.label },
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log(nodeData);
|
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
|
this.showOverviewDalogs(nodeData);
|
|
|
@@ -184,20 +203,28 @@ export default {
|
|
|
// 处理地图鼠标滑出事件
|
|
|
handleMapCrossingMouseout(mapData) {
|
|
|
console.log('父组件接收到了地图路口鼠标滑出事件:', mapData);
|
|
|
- if (this.activeLeftTab === 'overview' && mapData) { // 总览
|
|
|
- const id = mapData.id || (mapData.position[0] + mapData.position[1]);
|
|
|
+ if (!mapData) return;
|
|
|
+ const id = mapData.id || (mapData.position[0] + mapData.position[1]);
|
|
|
+ this.$refs.layout.handleDialogClose('offline_tip_' + id);
|
|
|
+ if (this.activeLeftTab === 'overview') { // 总览
|
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
|
- } else if (this.activeLeftTab === 'crossing' && mapData) { // 路口
|
|
|
-
|
|
|
- const id = mapData.id || (mapData.position[0] + mapData.position[1]);
|
|
|
+ } else if (this.activeLeftTab === 'crossing') { // 路口
|
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
|
}
|
|
|
},
|
|
|
// 处理地图点击事件
|
|
|
handleMapCrossingClick(mapData, lnglat, pixel) {
|
|
|
console.log('父组件接收到了地图路口点击事件:', mapData);
|
|
|
- console.log('父组件接收到了地图路口点击事件:', lnglat);
|
|
|
- console.log('父组件接收到了地图路口点击事件:', pixel);
|
|
|
+ // 离线/降级/故障状态不弹详情
|
|
|
+ const abnormalNames = ['离线', '降级', '故障'];
|
|
|
+ if (abnormalNames.includes(mapData.statusLabel || mapData.name)) {
|
|
|
+ this.$msg({
|
|
|
+ title: '提示',
|
|
|
+ message: `路口「${mapData.road || mapData.id}」设备${mapData.statusLabel || mapData.name},无法查看详情`,
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 组装模拟数据
|
|
|
const scale = window.innerWidth / 1920;
|
|
|
let nodeData = {
|