Pārlūkot izejas kodu

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

yanliming 4 gadi atpakaļ
vecāks
revīzija
c3d00df75d

+ 2 - 2
.env.development

@@ -1,8 +1,8 @@
 OUT_PUT_DIR=dist/smart-bus-portal
 
-VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-bus-server
+#VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-bus-server
 #VUE_APP_BACKEND_URL=https://ykt-test.xiaoxinda.com/smart-bus-server
-#VUE_APP_BACKEND_URL=http://121.37.187.149/smart-bus-server
+VUE_APP_BACKEND_URL=http://121.37.187.149/smart-bus-server
 
 #手机企业版
 VUE_APP_COMPANY_HEALTH_WECHAT_QY_URL=http://wisdomhousewechat.sudaonline.net/prevention/motemwall.html 

+ 5 - 0
src/views/bus/routeInfo-detail.vue

@@ -475,6 +475,11 @@ export default {
               self.formModel.relationCompanyId = "";
             }
 
+            //按照当前列表排序,重新设置序号
+            for(var i=0;i<self.formModel.stationList.length;i++){
+              self.formModel.stationList[i].sortNo = i+1;
+            }
+
             if (id == null || id.length == 0) {
               return routeInfoApi.add(self.formModel);
             } else {

+ 18 - 0
src/views/bus/routeInfo-list.vue

@@ -179,6 +179,7 @@
           :key="station.id"
           :position="station.position"
           :title="station.title"
+          :icon="station.icon"
         ></el-amap-marker>
         <!--路线-->
         <el-amap-polyline
@@ -263,6 +264,9 @@ import routeInfoApi from "@/api/bus/routeInfo";
 import SelectTree from "@/components/SelectTree";
 import companyInfoApi from "@/api/bus/companyInfo";
 
+import stationIcon from "@/assets/icons/station.svg";
+import greenIcon from "@/assets/icons/green.svg";
+import redIcon from "@/assets/icons/red.svg";
 
 
 import { getToken } from "@/utils/auth"; // get token from cookie
@@ -625,10 +629,24 @@ export default {
                 id: item.id,
                 title: item.name,
                 position: item.location.split(","),
+                icon: stationIcon
               };
 
               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) {
                 this.mapPath.push(station.position);
               }

+ 4 - 4
src/views/bus/shiftInfo-map.vue

@@ -11,7 +11,7 @@
       >
         <!--车辆当前位置-->
         <el-amap-marker
-          :zIndex="2"
+          :zIndex="5"
           :position="vehiclePos"
           :title="vehicle.licensePlateNumber"
           :icon="busIcon"
@@ -108,9 +108,9 @@ export default {
 
                 console.log(this.centerPoint);
 
-                // setTimeout(()=>{
-                //     this.loadVehicle(vehicleId);
-                // },60000);
+                setTimeout(()=>{
+                    this.loadVehicle(vehicleId);
+                },60000);
             });
         },
         loadRouteMap(routeId) {

+ 71 - 5
src/views/bus/vehicleHistory-list.vue

@@ -37,14 +37,17 @@
                     vid="vehicleHistoryMap"
                     :center="pointPosition"
                     :zoom="15"
-                    style="width:100%;height:400px;"
+                    style="width:100%;height:600px;"
+                    :plugin="plugin"
+                    :events="events"
                 >
                     <!--数据点-->
-                    <el-amap-marker :zIndex="1"
+                    <el-amap-marker :zIndex="5"
                         v-for="(item,index) in itemList"
                         :key="index"
                         :position="item.position"
                         :title="item.title"
+                        :icon="busIcon"
                         >
                     </el-amap-marker>
                     <!--轨迹-->
@@ -61,6 +64,15 @@
                                     :lineJoin="'round'"
                                     :lineCap="'round'"
                     ></el-amap-polyline>
+                    <!--站点-->
+                    <el-amap-marker
+                    :zIndex="1"
+                    v-for="station in stationList"
+                    :key="station.id"
+                    :position="station.position"
+                    :title="station.title"
+                    :icon="station.icon"
+                    ></el-amap-marker>
                 </el-amap>                
             </div>
             <div class="custom-right">
@@ -70,7 +82,7 @@
                     v-loading="loading"
                     element-loading-text="拼命加载中"
                     stripe
-                    height="400"
+                    height="600"
                     @row-click="rowClick"
                 >
                     <el-table-column label="经纬度" width="200px">
@@ -95,13 +107,19 @@
     </div>
 </template>
 <script>
+import routeInfoApi from "@/api/bus/routeInfo";
 import vehicleApi from "@/api/bus/vehicleInfo";
+import stationIcon from "@/assets/icons/station.svg";
+import greenIcon from "@/assets/icons/green.svg";
+import redIcon from "@/assets/icons/red.svg";
+import busIcon from "@/assets/icons/bus.svg";
 
 export default {
     name:"busVehicleList",
-    props: ["deviceNo"],
+    props: ["deviceNo","routeId"],
     data(){
         return{
+            busIcon: busIcon,
             queryModel: {
                 timeRange: null
             },
@@ -109,13 +127,23 @@ export default {
             tableData: [],
             statusData:[],
             multipleSelection: [],
+            stationList: [],
             pageIndex: 1,
             pageSize: 20,
             totalElements: 0,
             pageSizeList: [20,50,100],
             pointPosition: [112.240222, 30.337053],
             mapPath: [],
-            itemList: []
+            itemList: [],
+            plugin: ["AMap.Scale", "AMap.OverView", "AMap.ToolBar", "AMap.MapType","AMap.RangingTool"],
+            mapRuler: {},
+            ranging: false,
+            events: {
+                init: (map)=>{
+                    const ruler = new window.AMap.RangingTool(map);
+                    this.mapRuler = ruler
+                }
+            }
         }
     },
     methods: {
@@ -206,6 +234,43 @@ export default {
                 date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
 
             self.queryModel.timeRange = [startTime, endTime];
+        },
+        loadRouteMap(routeId) {            
+            //读取当前路线的站点
+            routeInfoApi.edit(routeId).then((response) => {
+                var jsonData = response.data;
+                var model = jsonData.data;
+
+                var _stationList = model.stationList;
+
+                this.stationList = [];
+
+                _stationList.forEach((item) => {
+                    if (item.location != null && item.location.length > 0) {
+                        var station = {
+                            id: item.id,
+                            title: item.name,
+                            position: item.location.split(","),
+                            icon: stationIcon
+                        };
+
+                        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
+                                });
+                            });
+                        }
+                    }
+                });
+            });
         }
     },
     components: {
@@ -213,6 +278,7 @@ export default {
     },
     mounted() {
         //this.changePage(1);
+        //this.loadRouteMap(this.routeId);
     },
     created() {
 

+ 5 - 2
src/views/bus/vehicleInfo-list.vue

@@ -277,13 +277,15 @@
         title="车辆轨迹"
         :modal-append-to-body="true"
         :append-to-body="true"
-        width="1000px"
+        width="1100px"
+        top="5vh"
         style="text-align:left;"
         :close-on-click-modal="false"
     >
         <vehicle-history-list
             ref="vehicleHistoryList"
             :deviceNo="selectedRow.gpsDeviceNo"
+            :routeId="selectedRow.routeId"
         ></vehicle-history-list>
     </el-dialog>
   </div>
@@ -418,7 +420,8 @@ export default {
         this.$nextTick(()=>{
             this.$refs.vehicleHistoryList.getCurrentMonthFirst();
             this.$refs.vehicleHistoryList.changePage(1);
-        });            
+            this.$refs.vehicleHistoryList.loadRouteMap(row.routeId);
+        });
     },
     pageSizeChange(pageSize) {
       this.pageSize = pageSize;