Explorar o código

修复勤务路线地图标记点击与任务列表弹窗数据不一致的问题

  - 为勤务路线 mock 数据添加 taskId,关联地图路线与任务列表中的具体任务
  - 地图 marker 点击时优先使用 taskId 查询任务详情,确保与列表"查看"弹窗一致
  - 新增任务4(重要会议)和任务5(演唱会特殊安保)的地图路线
  - 勤务路线使用完整驾车路径绘制,避免 extractMainStraightSegments 拆段导致重复绘制
  - 同步修复 StatusMonitoring 和 TrunkCoordination 页面的特勤 marker 点击逻辑
画安 hai 1 semana
pai
achega
9946b2372c

+ 10 - 6
src/components/TongzhouTrafficMap.vue

@@ -348,9 +348,11 @@ export default {
           { start: [116.66325, 39.9171], end: [116.6833, 39.9171], color: "#13C373", trunkId: 'trunk_6', trunkName: '张台路与湖亦路路口' },
         ],
         "勤务路线": [
-          { start: [116.6445, 39.8980], end: [116.6850, 39.8980], color: "#BC301D", dutyState: 'pending' },
-          { start: [116.6850, 39.8980], end: [116.7250, 39.8980], color: "#BC301D", dutyState: 'active', progress: 0.45 },
-          { start: [116.7250, 39.8980], end: [116.7650, 39.8980], color: "#BC301D", dutyState: 'done' }
+          { start: [116.6445, 39.8980], end: [116.6850, 39.8980], color: "#BC301D", dutyState: 'pending', taskId: 1 },
+          { start: [116.6850, 39.8980], end: [116.7250, 39.8980], color: "#BC301D", dutyState: 'active', progress: 0.45, taskId: 3 },
+          { start: [116.7250, 39.8980], end: [116.7650, 39.8980], color: "#BC301D", dutyState: 'done', taskId: 2 },
+          { start: [116.6445, 39.9080], end: [116.7050, 39.9080], color: "#BC301D", dutyState: 'done', taskId: 4 },
+          { start: [116.6445, 39.8880], end: [116.7050, 39.8880], color: "#BC301D", dutyState: 'pending', taskId: 5 }
         ]
       };
 
@@ -551,7 +553,9 @@ export default {
       const allSegments = this.extractMainStraightSegments(basePath);
       const segments = configName === '干线协调'
         ? allSegments.slice(0, 1)
-        : allSegments;
+        : configName === '勤务路线'
+          ? [basePath]
+          : allSegments;
       const overlays = [];
 
       segments.forEach((rawSegmentPath, segmentIdx) => {
@@ -663,8 +667,8 @@ export default {
 
             const isPastDot = dotDist <= splitDist;
             const dotConfig = isPastDot
-              ? { ...config, color: '#5A5A5A', id: `MOCK-D-${lineIdx}-${segmentIdx}-${idx}`, road: `勤务路线路口-${lineIdx}-${segmentIdx}-${idx}` }
-              : { ...config, id: `MOCK-D-${lineIdx}-${segmentIdx}-${idx}`, road: `勤务路线路口-${lineIdx}-${segmentIdx}-${idx}` };
+              ? { ...config, color: '#5A5A5A', id: `MOCK-D-${lineIdx}-${segmentIdx}-${idx}`, road: `勤务路线路口-${lineIdx}-${segmentIdx}-${idx}`, taskId: line.taskId }
+              : { ...config, id: `MOCK-D-${lineIdx}-${segmentIdx}-${idx}`, road: `勤务路线路口-${lineIdx}-${segmentIdx}-${idx}`, taskId: line.taskId };
             const dotType = isPastDot && markerType === 'normal' ? 'passed' : markerType;
             const marker = this.createTrafficLightMarker([lng, lat], dotConfig, dotType);
             if (marker) overlays.push(marker);

+ 3 - 0
src/views/SpecialSituationMonitoring.vue

@@ -252,6 +252,9 @@ export default {
             } else if (this.activeLeftTab === 'trunkLine') { // 干线
                 this.showTrunkLineDalogs(nodeData);
             } else if (this.activeLeftTab === 'specialDuty') { // 特勤
+                if (mapData.taskId) {
+                    nodeData.id = mapData.taskId;
+                }
                 this.showSpecialDutyDalogs(nodeData);
             }
         },

+ 3 - 0
src/views/StatusMonitoring.vue

@@ -292,6 +292,9 @@ export default {
             } else if (this.activeLeftTab === 'trunkLine') { // 干线
                 this.showTrunkLineDalogs(nodeData);
             } else if (this.activeLeftTab === 'specialDuty') { // 特勤
+                if (mapData.taskId) {
+                    nodeData.id = mapData.taskId;
+                }
                 this.showSpecialDutyDalogs(nodeData);
             }
         },

+ 3 - 0
src/views/TrunkCoordination.vue

@@ -256,6 +256,9 @@ export default {
             } else if (this.activeLeftTab === 'trunkLine') { // 干线
                 this.showTrunkLineDalogs(nodeData);
             } else if (this.activeLeftTab === 'specialDuty') { // 特勤
+                if (mapData.taskId) {
+                    nodeData.id = mapData.taskId;
+                }
                 this.showSpecialDutyDalogs(nodeData);
             }
         },