瀏覽代碼

修复地图标记点ID使用真实路口编号,统一hover与点击弹窗的路口名称显示,CrossingDetailPanel和CrossingMultiView的header标题优先使用标记点自带名称;TrunkCoordination和SpecialSituationMonitoring页面同步修复标记点ID,统一使用真实路口编号

画安 2 周之前
父節點
當前提交
ec1f2ba177

+ 1 - 1
src/components/ui/CrossingMultiView.vue

@@ -30,7 +30,7 @@
                         <span class="drag-icon">&#x2807;</span>
                     </div>
                     <CrossingDetailHeader
-                        :currentRoute="slot.headerData ? slot.headerData.currentRoute : { name: slot.data.label || slot.data.name }"
+                        :currentRoute="slot.headerData ? { ...slot.headerData.currentRoute, name: slot.data.label || slot.headerData.currentRoute.name } : { name: slot.data.label || slot.data.name }"
                         :intersectionData="slot.headerData ? slot.headerData.intersectionData : {}"
                         :cycleLength="slot.headerData ? slot.headerData.cycleLength : 0"
                     />

+ 4 - 4
src/views/SpecialSituationMonitoring.vue

@@ -194,7 +194,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,
@@ -211,11 +211,11 @@ export default {
         handleMapCrossingMouseout(mapData) {
             console.log('父组件接收到了地图路口鼠标滑出事件:', mapData);
             if (this.activeLeftTab === 'overview' && mapData) { // 总览
-                const id = mapData.position[0] + mapData.position[1];
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             } else if (this.activeLeftTab === 'crossing' && mapData) { // 路口
                 
-                const id = mapData.position[0] + mapData.position[1];
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             }
         },
@@ -227,7 +227,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,

+ 6 - 6
src/views/StatusMonitoring.vue

@@ -200,7 +200,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,
@@ -217,11 +217,11 @@ export default {
         handleMapCrossingMouseout(mapData) {
             console.log('父组件接收到了地图路口鼠标滑出事件:', mapData);
             if (this.activeLeftTab === 'overview' && mapData) { // 总览
-                const id = mapData.position[0] + mapData.position[1];
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             } else if (this.activeLeftTab === 'crossing' && mapData) { // 路口
-                
-                const id = mapData.position[0] + mapData.position[1];
+
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             }
         },
@@ -233,7 +233,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,
@@ -518,7 +518,7 @@ export default {
                 data: { ...nodeData, preloadedData: detailData },
                 headerComponent: 'CrossingDetailHeader',
                 headerProps: {
-                    currentRoute: detailData?.currentRoute || {},
+                    currentRoute: { ...(detailData?.currentRoute || {}), name: nodeData.label || detailData?.currentRoute?.name },
                     intersectionData: detailData?.intersectionData || {},
                     cycleLength: detailData?.cycleLength || 0,
                 }

+ 4 - 4
src/views/TrunkCoordination.vue

@@ -194,7 +194,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,
@@ -211,11 +211,11 @@ export default {
         handleMapCrossingMouseout(mapData) {
             console.log('父组件接收到了地图路口鼠标滑出事件:', mapData);
             if (this.activeLeftTab === 'overview' && mapData) { // 总览
-                const id = mapData.position[0] + mapData.position[1];
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             } else if (this.activeLeftTab === 'crossing' && mapData) { // 路口
                 
-                const id = mapData.position[0] + mapData.position[1];
+                const id = mapData.id || (mapData.position[0] + mapData.position[1]);
                 this.$refs.layout.handleDialogClose('crossing3_' + id);
             }
         },
@@ -227,7 +227,7 @@ export default {
             // 组装模拟数据
             const scale = window.innerWidth / 1920;
             let nodeData = {
-                id: mapData.position[0] + mapData.position[1],
+                id: mapData.id || (mapData.position[0] + mapData.position[1]),
                 label: mapData.road,
                 // 反算为设计稿坐标(SmartDialog 内部会再乘 scale)
                 pixelX: pixel ? Math.round(pixel.x / scale) : 950,