Commit cb472f67 by 前端

修复bug

1 parent 929f55a2
......@@ -53,7 +53,10 @@
<el-form-item label="设备号">
<div class="device_label" slot="label">
<span>设备号</span>
<el-tooltip content="请先设备号精准搜索设备定位后,再进行“选择区域”操作" placement="top">
<el-tooltip
content="请先设备号精准搜索设备定位后,再进行“选择区域”操作"
placement="top"
>
<i class="el-icon-warning-outline"></i>
</el-tooltip>
</div>
......@@ -74,7 +77,7 @@
</div>
<el-form-item label="">
<div>
<el-button class="area_btn" @click="searchAddess"
<el-button class="area_btn" @click="chooseArea"
>选择区域</el-button
>
<span class="clear_link" @click="onClear">清除</span>
......@@ -95,6 +98,7 @@
type="primary"
class="search_btn"
:loading="loading"
:disabled="!rectangle"
@click="getAreaLocation"
>查询</el-button
>
......@@ -232,7 +236,8 @@ export default {
{ field: "finalGpsTime", title: "最后GPS定位时间" },
{ field: "finalGpsAddress", title: "最后GPS定位地址", width: "300px" },
],
drawDone:false,
drawDone: false,
location:{} , // 设备维度查询的位置点
};
},
mounted() {
......@@ -328,7 +333,7 @@ export default {
* 垂直距离lath(所求点在已知点上方(北方)为正,否则为负)
* 水平距离longw(所求点在已知点右方(东方)为正,否则为负)
* lat = latitude + lath / (ARC * math.pi / 180);
* long = longitude + longw / (ARC * math.cos(latitude) * math.pi / 180);
* lng = longitude + longw / (ARC * math.cos(latitude) * math.pi / 180);
*/
getLngLat(lng, lat, w) {
let ARC = 6371.393 * 1000;
......@@ -371,11 +376,12 @@ export default {
});
},
// 查询
async searchAddess() {
console.log(this.form);
// 选择区域
async chooseArea() {
let _type = this.menuId;
let o = this.form;
let location = {};
if (_type == 1) {
let address = `${o.name || ""}${o.address || ""}`;
let { status, result } = await this.getAddressLngLat(address);
if (status === "complete" && result.info === "OK") {
......@@ -386,7 +392,10 @@ export default {
// 如果解析不出来经纬度,则以地图中心点来画矩形
location = this.map.getCenter();
}
}else{
location = this.location
}
console.log(location)
let lnglats = this.getLngLat(location.lng, location.lat);
this.drawRectangle(lnglats);
},
......@@ -439,6 +448,7 @@ export default {
this.rectangleHeight = 0;
this.rectangleWidth = 0;
this.form = {};
this.deviceList = [];
this.$refs.citySelect.reset();
},
......@@ -543,15 +553,15 @@ export default {
// 设备号查车
async getLocation() {
let params = {};
this.clearMap()
this.clearMap();
params.sns = this.form.sn;
params.deviceCode = "gps";
let res = await GET_DEVICEINFO_BYSNS(params);
let list = res.data || [];
if(list.length<=0){
if (list.length <= 0) {
showToast({
message:'暂无车辆'
})
message: "暂无车辆",
});
return false;
}
let arr = [];
......@@ -571,6 +581,7 @@ export default {
// this.autoOpenLastInfoWindow = false;
// }
//this.addLocation(o, this.autoOpenLastInfoWindow);
this.location = o;
});
this.addMarkers(arr);
},
......@@ -643,7 +654,7 @@ export default {
});
layer.add(markers);
console.log('画点结束',new Date().getTime());
console.log("画点结束", new Date().getTime());
this.drawDone = true;
this.map.setFitView();
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!