|
@@ -293,6 +293,11 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
console.log(nodeData);
|
|
console.log(nodeData);
|
|
|
|
|
+ // 路线 marker(勤务/干线):显示轻量悬浮提示,不弹路口总览卡
|
|
|
|
|
+ if (mapData.name === '勤务路线' || mapData.name === '干线协调') {
|
|
|
|
|
+ this.showRouteHoverTip(mapData, nodeData);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
|
this.showOverviewDalogs(nodeData);
|
|
this.showOverviewDalogs(nodeData);
|
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
@@ -306,12 +311,45 @@ export default {
|
|
|
const id = mapData.id || (mapData.position[0] + mapData.position[1]);
|
|
const id = mapData.id || (mapData.position[0] + mapData.position[1]);
|
|
|
// 关闭离线提示小弹窗
|
|
// 关闭离线提示小弹窗
|
|
|
this.$refs.layout.handleDialogClose('offline_tip_' + id);
|
|
this.$refs.layout.handleDialogClose('offline_tip_' + id);
|
|
|
|
|
+ // 关闭勤务/干线悬浮提示
|
|
|
|
|
+ this.$refs.layout.handleDialogClose('route_tip_' + id);
|
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
this.$refs.layout.handleDialogClose('crossing3_' + id);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 勤务/干线路线 marker 的轻量悬浮提示(名称走标题,状态走 body)
|
|
|
|
|
+ showRouteHoverTip(mapData, nodeData) {
|
|
|
|
|
+ const isDuty = mapData.name === '勤务路线';
|
|
|
|
|
+ const dutyLabelMap = { pending: '待执行', active: '执行中', done: '已完成' };
|
|
|
|
|
+ // 勤务:按 taskId 查真实勤务任务(名称/状态),与特勤列表/详情一致;查不到再退化
|
|
|
|
|
+ const task = isDuty
|
|
|
|
|
+ ? (this.tableData || []).find(t => String(t.id) === String(mapData.taskId))
|
|
|
|
|
+ : null;
|
|
|
|
|
+ // 名称:干线用真实干线名(road),勤务用真实任务名
|
|
|
|
|
+ const name = isDuty
|
|
|
|
|
+ ? (task?.name || (mapData.taskId != null ? `勤务任务 ${mapData.taskId}` : '勤务路线'))
|
|
|
|
|
+ : (mapData.road || '干线协调');
|
|
|
|
|
+ const status = isDuty
|
|
|
|
|
+ ? (task?.status || dutyLabelMap[mapData.dutyState] || '勤务路线')
|
|
|
|
|
+ : '干线协调';
|
|
|
|
|
+ this.$refs.layout.openDialog({
|
|
|
|
|
+ id: 'route_tip_' + nodeData.id,
|
|
|
|
|
+ title: name,
|
|
|
|
|
+ component: 'RouteHoverTip',
|
|
|
|
|
+ width: 240,
|
|
|
|
|
+ height: 96,
|
|
|
|
|
+ center: false,
|
|
|
|
|
+ showClose: false,
|
|
|
|
|
+ noPadding: false,
|
|
|
|
|
+ draggable: false,
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ enableDblclickExpand: false,
|
|
|
|
|
+ position: { x: (nodeData.pixelX || 950) + 10, y: nodeData.pixelY || 430 },
|
|
|
|
|
+ data: { kind: mapData.name, status },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 处理地图点击事件
|
|
// 处理地图点击事件
|
|
|
handleMapCrossingClick(mapData, lnglat, pixel) {
|
|
handleMapCrossingClick(mapData, lnglat, pixel) {
|
|
|
console.log('父组件接收到了地图路口点击事件:', mapData);
|
|
console.log('父组件接收到了地图路口点击事件:', mapData);
|
|
@@ -334,6 +372,18 @@ export default {
|
|
|
pixelX: pixel ? Math.round(pixel.x / scale) : 950,
|
|
pixelX: pixel ? Math.round(pixel.x / scale) : 950,
|
|
|
pixelY: pixel ? Math.round(pixel.y / scale) : 430,
|
|
pixelY: pixel ? Math.round(pixel.y / scale) : 430,
|
|
|
}
|
|
}
|
|
|
|
|
+ // 非真实路口的路线 marker(勤务/干线):按类型直达对应弹窗,绕过路口详情(覆盖总览/路口等所有 Tab)
|
|
|
|
|
+ if (mapData.name === '勤务路线') {
|
|
|
|
|
+ this.showSpecialDutyDalogs({ ...nodeData, id: mapData.taskId != null ? mapData.taskId : nodeData.id });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mapData.name === '干线协调') {
|
|
|
|
|
+ const matched = this.findTrunkMenuNode(mapData.id);
|
|
|
|
|
+ this.showTrunkLineDalogs(matched
|
|
|
|
|
+ ? { id: matched.id, label: matched.label, intersections: matched.intersections, distances: matched.distances }
|
|
|
|
|
+ : { ...nodeData });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 干线marker点击时,从菜单数据中匹配对应干线
|
|
// 干线marker点击时,从菜单数据中匹配对应干线
|
|
|
if (this.activeLeftTab === 'trunkLine' && mapData.id) {
|
|
if (this.activeLeftTab === 'trunkLine' && mapData.id) {
|
|
|
const matched = this.findTrunkMenuNode(mapData.id);
|
|
const matched = this.findTrunkMenuNode(mapData.id);
|