Commit 0aff1aa4 by 前端

交互更新

1 parent 6f07b14d
......@@ -37,24 +37,29 @@
>
<div v-show="menuId == 1">
<el-form-item label="详细地址">
<el-input
v-model.trim="form.address"
id="tipInput"
maxlength="50"
placeholder="请输入详细地址"
/>
<div class="device_item">
<el-input
ref="addressInput"
v-model.trim="form.address"
id="tipInput"
maxlength="50"
placeholder="请输入详细地址"
@keyup.enter.native="getAddress"
/>
<el-button
type="primary"
class="btn"
:disabled="!form.address"
@click="getAddress"
>搜索</el-button
>
</div>
</el-form-item>
</div>
<div v-show="menuId == 2">
<el-form-item label="设备号" prop="sn">
<div class="device_label" slot="label">
<span>设备号</span>
<!-- <el-tooltip
content="请先设备号精准搜索设备定位后,再进行“选择区域”操作"
placement="top"
>
<glsx-image src="circle-question.png" class="img" />
</el-tooltip> -->
<el-popover
trigger="hover"
placement="top"
......@@ -72,6 +77,7 @@
v-model.trim="form.sn"
maxlength="50"
placeholder="请输入您要查询的设备号"
@keyup.enter.native="getLocation"
/>
<el-button
type="primary"
......@@ -165,7 +171,7 @@ import {
} from "@/api/services/zooneCar";
import EventBus from "@/event-bus";
import { showToast, deepClone } from "@/utils/utils.js";
import { Validator,CHECK_NUMBER } from "@/common/validator";
import { Validator, CHECK_NUMBER } from "@/common/validator";
export default {
data() {
return {
......@@ -195,7 +201,6 @@ export default {
deviceList: [],
loading: false,
dloading: false,
autoOpenLastInfoWindow: false,
columns: [
{ type: "seq", title: "序号", width: "55px" },
{ field: "workOrderNo", title: "业务工单号" },
......@@ -204,7 +209,7 @@ export default {
{ field: "vin", title: "车架号" },
{ field: "sn", title: "设备号" },
{ field: "activeDate", title: "激活时间" },
{ field: "deviceTypeStr", title: "设备类型" },
{ field: "sourceStr", title: "设备类型" },
{ field: "finalGpsTime", title: "最后GPS定位时间" },
{ field: "finalGpsAddress", title: "最后GPS定位地址", width: "300px" },
],
......@@ -212,7 +217,8 @@ export default {
location: {}, // 设备维度查询的位置点
autoCenterMarker: null,
mouseTool: null,
mapMass:null
mapMass: null,
poi: {},
};
},
mounted() {
......@@ -250,11 +256,8 @@ export default {
autoComplete.on("select", function (e) {
console.log(e);
let poi = e.poi || {};
if (poi && poi.location) {
_this.autoCenterMarker = mapService.createMarker(poi.location);
_this.map.setFitView();
_this.map.add(_this.autoCenterMarker);
}
_this.poi = poi;
_this.$refs.addressInput.focus()
});
})
.catch((error) => {
......@@ -263,6 +266,18 @@ export default {
});
},
// 获取地址
getAddress() {
let _this = this;
let poi = this.poi;
_this.clearMap()
if (poi && poi.location) {
_this.autoCenterMarker = mapService.createMarker(poi.location);
_this.map.setFitView();
_this.map.add(_this.autoCenterMarker);
}
},
// 选择区域
async chooseArea() {
let _this = this;
......@@ -336,6 +351,8 @@ export default {
this.rectangleHeight = 0;
this.rectangleWidth = 0;
this.rectangle = null;
this.mouseTool = null;
this.deviceList = [];
this.map.setZooms([2, 30]);
},
......@@ -452,7 +469,7 @@ export default {
// 切换类型
menuEvent(row) {
this.menuId = row.id;
this.$refs.form.clearValidate('sn')
this.$refs.form.clearValidate("sn");
},
// 设备号查车
......@@ -519,8 +536,8 @@ export default {
}
_this.deviceList = [];
if(_this.mapMass){
_this.mapMass.clear()
if (_this.mapMass) {
_this.mapMass.clear();
_this.mapMass = null;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!