|
@@ -313,11 +313,12 @@ export default {
|
|
|
|
|
|
|
|
const realRouteConfigs = {
|
|
const realRouteConfigs = {
|
|
|
"干线协调": [
|
|
"干线协调": [
|
|
|
- { start: [116.6421, 39.9272], end: [116.6825, 39.9272], color: "#13C373" },
|
|
|
|
|
- { start: [116.6426, 39.9221], end: [116.6830, 39.9221], color: "#13C373" },
|
|
|
|
|
- { start: [116.6432, 39.9171], end: [116.6833, 39.9171], color: "#13C373" },
|
|
|
|
|
- { start: [116.6438, 39.9123], end: [116.6841, 39.9123], color: "#13C373" },
|
|
|
|
|
- { start: [116.6445, 39.9075], end: [116.6846, 39.9075], color: "#13C373" }
|
|
|
|
|
|
|
+ { start: [116.6421, 39.9272], end: [116.6623, 39.9272], color: "#13C373", trunkId: 'trunk_1', trunkName: '古城南路与古城大街' },
|
|
|
|
|
+ { start: [116.6623, 39.9272], end: [116.6825, 39.9272], color: "#13C373", trunkId: 'trunk_2', trunkName: '古城西路东口南一过街' },
|
|
|
|
|
+ { start: [116.6426, 39.9221], end: [116.6628, 39.9221], color: "#13C373", trunkId: 'trunk_3', trunkName: '古城大街与古城北路' },
|
|
|
|
|
+ { start: [116.6628, 39.9221], end: [116.683, 39.9221], color: "#13C373", trunkId: 'trunk_4', trunkName: '八角北路与八角东街' },
|
|
|
|
|
+ { start: [116.6432, 39.9171], end: [116.66325, 39.9171], color: "#13C373", trunkId: 'trunk_5', trunkName: '古城西路与古城大街' },
|
|
|
|
|
+ { start: [116.66325, 39.9171], end: [116.6833, 39.9171], color: "#13C373", trunkId: 'trunk_6', trunkName: '张台路与湖亦路路口' },
|
|
|
],
|
|
],
|
|
|
"勤务路线": [
|
|
"勤务路线": [
|
|
|
// 第一段:未执行(全红)— 通州大街西段,干线协调下方约600m
|
|
// 第一段:未执行(全红)— 通州大街西段,干线协调下方约600m
|
|
@@ -371,25 +372,16 @@ export default {
|
|
|
path
|
|
path
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // 统计干线协调实际生成的线段数
|
|
|
|
|
|
|
+ // 每条路线配置对应一条干线菜单项
|
|
|
if (config.name === '干线协调' && overlays.length > 0) {
|
|
if (config.name === '干线协调' && overlays.length > 0) {
|
|
|
- const trunkNames = [
|
|
|
|
|
- '古城南路与古城大街', '古城西路东口南一过街', '古城大街与古城北路',
|
|
|
|
|
- '八角北路与八角东街', '古城西路与古城大街'
|
|
|
|
|
- ];
|
|
|
|
|
- const polylineCount = overlays.filter(o => o instanceof this.AMap.Polyline).length;
|
|
|
|
|
- for (let s = 0; s < polylineCount; s++) {
|
|
|
|
|
- const idx = trunkSegments.length + 1;
|
|
|
|
|
- const name = trunkNames[idx - 1] || ('干线' + idx);
|
|
|
|
|
- trunkSegments.push({
|
|
|
|
|
- id: 'trunk_' + idx,
|
|
|
|
|
- label: name,
|
|
|
|
|
- intersections: Array.from({ length: 6 }, (_, k) => name + '_路口' + (k + 1)),
|
|
|
|
|
- distances: Array.from({ length: 6 }, (_, k) => k * 1000),
|
|
|
|
|
- _lineIdx: lineIdx,
|
|
|
|
|
- _segmentIdx: s
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const name = line.trunkName || ('干线' + (lineIdx + 1));
|
|
|
|
|
+ trunkSegments.push({
|
|
|
|
|
+ id: line.trunkId || ('trunk_' + (lineIdx + 1)),
|
|
|
|
|
+ label: name,
|
|
|
|
|
+ intersections: Array.from({ length: 6 }, (_, k) => name + '_路口' + (k + 1)),
|
|
|
|
|
+ distances: Array.from({ length: 6 }, (_, k) => k * 500),
|
|
|
|
|
+ _lineIdx: lineIdx
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (this.isComponentDestroyed || drawSeq !== this.drawSeq) return;
|
|
if (this.isComponentDestroyed || drawSeq !== this.drawSeq) return;
|
|
@@ -500,7 +492,11 @@ export default {
|
|
|
return [lng + offsetVal, lat + offsetVal];
|
|
return [lng + offsetVal, lat + offsetVal];
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const segments = this.extractMainStraightSegments(basePath);
|
|
|
|
|
|
|
+ const allSegments = this.extractMainStraightSegments(basePath);
|
|
|
|
|
+ // 干线协调每条路线只取最长的1段,保证6条配置 = 6条线
|
|
|
|
|
+ const segments = configName === '干线协调'
|
|
|
|
|
+ ? allSegments.slice(0, 1)
|
|
|
|
|
+ : allSegments;
|
|
|
const overlays = [];
|
|
const overlays = [];
|
|
|
|
|
|
|
|
segments.forEach((rawSegmentPath, segmentIdx) => {
|
|
segments.forEach((rawSegmentPath, segmentIdx) => {
|
|
@@ -693,10 +689,18 @@ export default {
|
|
|
else if (i === indices.length - 1) markerType = 'end';
|
|
else if (i === indices.length - 1) markerType = 'end';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 干线协调:id 用干线编号,road 用干线名称(与菜单标题一致)
|
|
|
|
|
+ const markerId = (configName === '干线协调' && line.trunkId)
|
|
|
|
|
+ ? `${line.trunkId}_point_${i + 1}`
|
|
|
|
|
+ : `MOCK-${configName.charAt(0)}-${lineIdx}-${segmentIdx}-${idx}`;
|
|
|
|
|
+ const markerRoad = (configName === '干线协调' && line.trunkName)
|
|
|
|
|
+ ? line.trunkName
|
|
|
|
|
+ : `${configName}路口-${lineIdx}-${segmentIdx}-${idx}`;
|
|
|
|
|
+
|
|
|
const marker = this.createTrafficLightMarker([lng, lat], {
|
|
const marker = this.createTrafficLightMarker([lng, lat], {
|
|
|
...config,
|
|
...config,
|
|
|
- id: `MOCK-${configName.charAt(0)}-${lineIdx}-${segmentIdx}-${idx}`,
|
|
|
|
|
- road: `${configName}路口-${lineIdx}-${segmentIdx}-${idx}`
|
|
|
|
|
|
|
+ id: markerId,
|
|
|
|
|
+ road: markerRoad
|
|
|
}, markerType);
|
|
}, markerType);
|
|
|
if (marker) overlays.push(marker);
|
|
if (marker) overlays.push(marker);
|
|
|
}
|
|
}
|