Commit cb472f67 by 前端

修复bug

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