Sfoglia il codice sorgente

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

yanliming 4 anni fa
parent
commit
cd4844f6a4

+ 1 - 1
src/main.js

@@ -16,7 +16,7 @@ Vue.use(AMap);
 
 AMap.initAMapApiLoader({
   key: "09abadb2e35fc61fd84042c518e9aebf", 
-  plugin: ["AMap.Scale", "AMap.OverView", "AMap.ToolBar", "AMap.MapType"],
+  plugin: ["AMap.Scale", "AMap.OverView", "AMap.ToolBar", "AMap.MapType","AMap.RangingTool"],
   uiVersion: "1.0.11", // ui库版本,不配置不加载,
   v: "1.4.4"
 });

+ 1 - 1
src/views/base/mobileBannerInfo-list.vue

@@ -3,7 +3,7 @@
     <el-breadcrumb separator=">">
       <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
       <el-breadcrumb-item>
-        <a href="#">系统管理</a>
+        <a href="#">基础信息管理</a>
       </el-breadcrumb-item>
       <el-breadcrumb-item>
         <a href="/#">广告栏管理</a>

+ 1 - 1
src/views/base/paymentInfo-list.vue

@@ -3,7 +3,7 @@
     <el-breadcrumb separator=">">
       <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
       <el-breadcrumb-item>
-        <a href="#">系统管理</a>
+        <a href="#">基础信息管理</a>
       </el-breadcrumb-item>
       <el-breadcrumb-item>
         <a href="#">收款方管理</a>

+ 1 - 1
src/views/bus/passengerInfo-list.vue

@@ -3,7 +3,7 @@
     <el-breadcrumb separator=">">
       <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
       <el-breadcrumb-item>
-        <a href="#">系统管理</a>
+        <a href="#">基础信息管理</a>
       </el-breadcrumb-item>
       <el-breadcrumb-item>
         <a href="/passengerInfo">乘客管理</a>

+ 64 - 8
src/views/bus/routeInfo-detail.vue

@@ -214,6 +214,8 @@
       :modal-append-to-body="true"
       :append-to-body="true"
       style="text-align: left"
+      width="60%"
+      top="5vh"
       :close-on-click-modal="false"
     >
       <el-amap
@@ -224,11 +226,23 @@
         :zoom="zoom"
         :events="events"
         class="amap-demo"
+        :plugin="plugins"
+        style="width: 100%; height: 500px"
       >
         <el-amap-marker
           vid="amapDemo"
           :position="pointPosition"
         ></el-amap-marker>
+
+        <!--站点入口-->
+        <el-amap-marker
+          :zIndex="1"
+          v-for="station in stationSubInfoList"
+          :key="station.id"
+          :position="station.position"
+          :title="station.title"
+          :icon="station.icon"
+        ></el-amap-marker>
       </el-amap>
       <span slot="footer" class="dialog-footer">
         <div style="position: absolute; left: 20px; bottom: 20px">
@@ -241,12 +255,18 @@
             <el-button slot="append" icon="el-icon-search" @click="handleRegeo"
               >定位</el-button
             >
-          </el-input>
+          </el-input>          
+          <el-switch
+            v-model="ranging"
+            @change="rangingChange"
+            active-text="开启测距"
+            inactive-text="关闭测距">
+          </el-switch>
         </div>
         <el-button @click="showMapDialog = false">取 消</el-button>
         <el-button type="primary" @click="handleSelectPoint()">确 定</el-button>
       </span>
-    </el-dialog>
+    </el-dialog>   
     <el-dialog
       title="导入"
       :visible.sync="batchImportVisible"
@@ -306,6 +326,9 @@ import companyInfoApi from "@/api/bus/companyInfo";
 import dataDictionaryApi from "@/api/sys/dataDictionary";
 import regionInfoApi from "@/api/base/regionInfo";
 
+import greenIcon from "@/assets/icons/green.svg";
+import redIcon from "@/assets/icons/red.svg";
+
 import { getToken } from "@/utils/auth"; // get token from cookie
 
 import AMap from "vue-amap";
@@ -315,6 +338,7 @@ export default {
   props: ["businessKey", "title"],
   data() {
     return {
+      plugins: ["AMap.Scale", "AMap.OverView", "AMap.ToolBar", "AMap.MapType","AMap.RangingTool"],
       formModel: {
         enableChangeParent: false,
         id: "",
@@ -322,8 +346,9 @@ export default {
         companyId: "",
         goodsId: "",
         stationList: [],
-        removeStationList: [],
+        removeStationList: []
       },
+      stationSubInfoList: [],
       ruleValidate: {
         companyId: [
           { required: true, message: "所属单位不能为空", trigger: "blur" },
@@ -364,14 +389,22 @@ export default {
       showMapDialog: false,
       amapManager,
       zoom: 12,
+      mapRuler: {},
+      ranging: false,
       events: {
+        init: (map)=>{
+          const ruler = new window.AMap.RangingTool(map);
+          this.mapRuler = ruler
+        },
         click: (e) => {
-          var pt = e.lnglat; //点击选择新地址为中心点
-          console.log(pt);
+          if(!this.ranging){
+            var pt = e.lnglat; //点击选择新地址为中心点
+            console.log(pt);
 
-          this.pointPosition = [pt.lng, pt.lat];
-          this.selectedRow.location = pt.lng + "," + pt.lat;
-        },
+            this.pointPosition = [pt.lng, pt.lat];
+            this.selectedRow.location = pt.lng + "," + pt.lat;
+          }
+        }
       },
       props: {
         // 配置项(必选)
@@ -415,6 +448,14 @@ export default {
     });
   },
   methods: {
+    rangingChange(value) {
+      if(value){
+        this.mapRuler.turnOn();
+      }
+      else{
+        this.mapRuler.turnOff();
+      }
+    },
     closeDialog() {
       this.$emit("close", false);
     },
@@ -488,6 +529,21 @@ export default {
 
         this.pointPosition = arr;
       }
+
+      if(row.stationSubInfoList!=null){
+        this.stationSubInfoList = [];
+
+        row.stationSubInfoList.forEach(subItem=>{
+            var startToEnd = subItem.startStationId == this.formModel.stationList[0].id;
+
+            this.stationSubInfoList.push({
+                id: subItem.id,
+                title: row.name + "入口" + (startToEnd ? "(起)" : "(终)"),
+                position: [subItem.longitude,subItem.latitude],
+                icon: startToEnd ? greenIcon : redIcon
+            });
+        });
+      }
     },
     handleAdd() {
       this.formModel.stationList.push({

+ 2 - 1
src/views/bus/shiftInfo-list.vue

@@ -3,7 +3,7 @@
     <el-breadcrumb separator=">">
       <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
       <el-breadcrumb-item>
-        <a href="#">系统管理</a>
+        <a href="#">基础信息管理</a>
       </el-breadcrumb-item>
       <el-breadcrumb-item>
         <a href="/shiftInfo">班次管理</a>
@@ -152,6 +152,7 @@
       width="80%"
       :visible.sync="showMap"
       title="地图"
+      top="5vh"
       :modal-append-to-body="true"
       :append-to-body="true"
       style="text-align: left"

+ 23 - 9
src/views/bus/shiftInfo-map.vue

@@ -7,6 +7,7 @@
         :center="centerPoint"
         :zoom="15"
         style="width: 100%; height: 550px"
+        :events="events"
       >
         <!--车辆当前位置-->
         <el-amap-marker
@@ -43,6 +44,12 @@
           :editable="false"
         ></el-amap-polyline>
       </el-amap>
+    <el-switch
+        v-model="ranging"
+        @change="rangingChange"
+        active-text="开启测距"
+        inactive-text="关闭测距">
+    </el-switch>
     </div>
 </template>
 <script>
@@ -72,19 +79,26 @@ export default {
             mapPath: [],
             vehicle: {},
             vehiclePos: [112.276585, 30.306401],
-            plugin: [
-                {
-                    pName: "ToolBar",
-                    events: {
-                        init(instance) {
-                            console.log(instance);
-                        }
-                    }
+            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: {
+        rangingChange(value) {
+            if(value){
+                this.mapRuler.turnOn();
+            }
+            else{
+                this.mapRuler.turnOff();
+            }
+        },
         loadVehicle(vehicleId) {
             vehicleInfoApi.edit(vehicleId).then(response=>{
                 var jsonData = response.data;

+ 1 - 1
src/views/bus/userInfo-list.vue

@@ -3,7 +3,7 @@
     <el-breadcrumb separator=">">
       <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
       <el-breadcrumb-item>
-        <a href="#">系统管理</a>
+        <a href="#">基础信息管理</a>
       </el-breadcrumb-item>
       <el-breadcrumb-item>
         <a href="/userInfo">注册用户管理</a>