|
@@ -58,6 +58,19 @@
|
|
|
>查询</el-button
|
|
|
>
|
|
|
</div>
|
|
|
+ <div class="in_transit_information2">
|
|
|
+ <span class="item_details">查询地址:</span>
|
|
|
+ <el-input
|
|
|
+ style="width: 300px;"
|
|
|
+ class="inputStyle"
|
|
|
+ v-model.trim="address"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" class="searchstyle" @click="initLocation"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
<div class="driving_information">
|
|
|
<span class="item_details2">时间:{{ runRoute.gtm }}</span>
|
|
|
<br />
|
|
@@ -178,6 +191,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ address:null,
|
|
|
//一、 查询相关
|
|
|
//选择时间区间
|
|
|
time: [],
|
|
@@ -476,6 +490,27 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //查询地址并画点
|
|
|
+ initLocation(){
|
|
|
+ console.log("address:",this.address);
|
|
|
+ if(this.address && this.address!=""){
|
|
|
+ this.axios.get("/api/v1/otms/getLocationForAddress?address="+this.address).then((res)=>{
|
|
|
+ console.log("res:",res);
|
|
|
+ if(res.data.code=="0"){
|
|
|
+ //画点
|
|
|
+ this.initMap2([res.data.data.lon,res.data.data.lat],res.data.data.title,res.data.data.address);
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message:res.data.data,
|
|
|
+ type:"warning",
|
|
|
+ offset:100,
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
//初始化数据
|
|
|
initData() {
|
|
|
let that = this;
|
|
@@ -483,7 +518,7 @@ export default {
|
|
|
if (that.carNumber == "") {
|
|
|
this.$message({
|
|
|
message:"车牌号不能为空!",
|
|
|
- offset:40,
|
|
|
+ offset:100,
|
|
|
type:"warning",
|
|
|
showClose:true
|
|
|
});
|
|
@@ -520,7 +555,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message:"车辆没有开启GPS或尚未注册!",
|
|
|
- offset:40,
|
|
|
+ offset:100,
|
|
|
type:"warning",
|
|
|
showClose:true
|
|
|
});
|
|
@@ -548,6 +583,37 @@ export default {
|
|
|
that.initEndline();
|
|
|
});
|
|
|
},
|
|
|
+ initMap2(lonlat,title,address){
|
|
|
+ lazyAMapApiLoaderInstance.load().then(() => {
|
|
|
+ let that = this;
|
|
|
+ if(!that.map){
|
|
|
+ that.map = new AMap.Map("amap-container", {
|
|
|
+ //设置地图容器id
|
|
|
+ viewMode: "2D", //是否为2D地图模式
|
|
|
+ zoom: 10, //初始化地图级别
|
|
|
+ center: lonlat //初始化地图中心点位置
|
|
|
+ });
|
|
|
+ //初始化
|
|
|
+ that.initGeocoder();
|
|
|
+ }
|
|
|
+ that.initMarkes( 20,25, require("@/assets/img/end.png"),lonlat[0],lonlat[1],title);
|
|
|
+ //自定义窗体内容
|
|
|
+ let content = [
|
|
|
+ "<div style='top:1px;width: 200px; background-color: rgba(22, 160, 133, 1);' ><font color='white'>位置:"+
|
|
|
+ address
|
|
|
+ +"</font>",
|
|
|
+ "<div style='background-color:rgba(22, 160, 133, 1);'><font color='white'>名称:" +
|
|
|
+ title +
|
|
|
+ "</font></div></div>"
|
|
|
+ ];
|
|
|
+ // 创建 infoWindow 实例
|
|
|
+ infoWindow = new AMap.InfoWindow({
|
|
|
+ content: content.join("<br>") //传入 dom 对象,或者 html 字符串
|
|
|
+ });
|
|
|
+ // 打开信息窗体
|
|
|
+ infoWindow.open(that.map, lonlat);
|
|
|
+ });
|
|
|
+ },
|
|
|
//结束点
|
|
|
initEndline() {
|
|
|
let that = this;
|