Browse Source

Merge branch 'master' of http://47.92.161.104:10080/shuzhan/smart-bus-portal

yanliming 4 years ago
parent
commit
651f6080cd
3 changed files with 24 additions and 5 deletions
  1. 1 0
      src/assets/icons/green.svg
  2. 1 0
      src/assets/icons/red.svg
  3. 22 5
      src/views/bus/shiftInfo-map.vue

+ 1 - 0
src/assets/icons/green.svg

@@ -0,0 +1 @@
+<svg t="1620834019526" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1070" width="32" height="32"><path d="M768 678.4C608 844.8 512 832 512 832s-121.6-12.8-249.6-153.6C128 531.2 128 396.8 128 339.2 128 147.2 307.2 0 512 0c211.2 0 384 147.2 384 339.2 0 76.8 12.8 198.4-128 339.2zM512 256c-70.4 0-128 57.6-128 128s57.6 128 128 128 128-57.6 128-128-57.6-128-128-128z m0 640c140.8 0 192 25.6 192 64s-51.2 64-192 64-192-25.6-192-64c0-32 51.2-64 192-64z" fill="#1afa29" p-id="1071"></path></svg>

+ 1 - 0
src/assets/icons/red.svg

@@ -0,0 +1 @@
+<svg t="1620834019526" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1070" width="32" height="32"><path d="M768 678.4C608 844.8 512 832 512 832s-121.6-12.8-249.6-153.6C128 531.2 128 396.8 128 339.2 128 147.2 307.2 0 512 0c211.2 0 384 147.2 384 339.2 0 76.8 12.8 198.4-128 339.2zM512 256c-70.4 0-128 57.6-128 128s57.6 128 128 128 128-57.6 128-128-57.6-128-128-128z m0 640c140.8 0 192 25.6 192 64s-51.2 64-192 64-192-25.6-192-64c0-32 51.2-64 192-64z" fill="#d81e06" p-id="1071"></path></svg>

+ 22 - 5
src/views/bus/shiftInfo-map.vue

@@ -6,7 +6,7 @@
         :plugin="plugin"
         :plugin="plugin"
         :center="centerPoint"
         :center="centerPoint"
         :zoom="15"
         :zoom="15"
-        style="width: 100%; height: 400px"
+        style="width: 100%; height: 550px"
       >
       >
         <!--车辆当前位置-->
         <!--车辆当前位置-->
         <el-amap-marker
         <el-amap-marker
@@ -23,7 +23,7 @@
           :key="station.id"
           :key="station.id"
           :position="station.position"
           :position="station.position"
           :title="station.title"
           :title="station.title"
-          :icon="stationIcon"
+          :icon="station.icon"
         ></el-amap-marker>
         ></el-amap-marker>
 
 
         <!--路线-->
         <!--路线-->
@@ -50,6 +50,9 @@ import routeInfoApi from "@/api/bus/routeInfo";
 import vehicleInfoApi from "@/api/bus/vehicleInfo";
 import vehicleInfoApi from "@/api/bus/vehicleInfo";
 import busIcon from "@/assets/icons/bus.svg";
 import busIcon from "@/assets/icons/bus.svg";
 import stationIcon from "@/assets/icons/station.svg";
 import stationIcon from "@/assets/icons/station.svg";
+import greenIcon from "@/assets/icons/green.svg";
+import redIcon from "@/assets/icons/red.svg";
+
 
 
 export default {
 export default {
     props :{
     props :{
@@ -91,9 +94,9 @@ export default {
 
 
                 console.log(this.centerPoint);
                 console.log(this.centerPoint);
 
 
-                setTimeout(()=>{
-                    this.loadVehicle(vehicleId);
-                },60000);
+                // setTimeout(()=>{
+                //     this.loadVehicle(vehicleId);
+                // },60000);
             });
             });
         },
         },
         loadRouteMap(routeId) {
         loadRouteMap(routeId) {
@@ -131,10 +134,24 @@ export default {
                                 id: item.id,
                                 id: item.id,
                                 title: item.name,
                                 title: item.name,
                                 position: item.location.split(","),
                                 position: item.location.split(","),
+                                icon: stationIcon
                             };
                             };
 
 
                             this.stationList.push(station);
                             this.stationList.push(station);
 
 
+                            if(item.stationSubInfoList!=null){
+                                item.stationSubInfoList.forEach(subItem=>{
+                                    var startToEnd = subItem.startStationId == this.stationList[0].id;
+
+                                    this.stationList.push({
+                                        id: subItem.id,
+                                        title: item.name + "入口" + (startToEnd ? "(起)" : "(终)"),
+                                        position: [subItem.longitude,subItem.latitude],
+                                        icon: startToEnd ? greenIcon : redIcon
+                                    });
+                                });
+                            }
+
                             if (initMapPath) {
                             if (initMapPath) {
                                 this.mapPath.push(station.position);
                                 this.mapPath.push(station.position);
                             }
                             }