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