Commit 3ab840d0 authored by 赵啸非's avatar 赵啸非

地图模糊查询添加

parent 70d2fc07
......@@ -31,6 +31,7 @@
<!--信息窗体-->
<el-amap-info-window
:closeWhenClickMap="true"
:position="window.position"
:visible="window.visible"
:content="window.content"
......
......@@ -89,7 +89,11 @@
>编辑站点</el-button
>
<el-button type="primary" size="mini" @click="addDevice" icon="el-icon-plus"
<el-button
type="primary"
size="mini"
@click="addDevice"
icon="el-icon-plus"
>添加设备</el-button
>
</el-row>
......@@ -103,6 +107,7 @@
<el-select
style="padding: 5px"
size="mini"
@change="deviceStatuschange"
v-model="deviceStatus"
placeholder="请选择设备状态"
>
......@@ -119,7 +124,8 @@
<el-row>
<el-input
size="mini"
v-model="deviceCode"
v-model="deviceName"
@change="deviceNameChange"
style="padding: 5px"
placeholder="请输入设备编码"
></el-input>
......@@ -176,13 +182,29 @@ export default {
//this.$router.push({ query: {} });
this.query = { siteId, siteId };
this.$nextTick(() => {
this.$refs.map.relocate(this.info);
})
this.$refs.map.relocate(this.info);
});
},
methods: {
formatterDate,
addDevice(){
let row={}
deviceStatuschange(val) {
this.query = Object.assign({}, this.query, { deviceStatus: val });
this.getData();
},
deviceNameChange(val) {
val = val.trim();
if (val.charAt(0) != "%") {
val = "%" + val;
}
if (val.charAt(val.length - 1) != "%") {
val = val + "%";
}
this.query = Object.assign({}, this.query, { deviceName: val });
this.getData();
},
addDevice() {
let row = {};
row.siteId = this.info.siteId;
row.siteName = this.info.siteName;
row.siteCode = this.info.siteCode;
......@@ -210,8 +232,8 @@ export default {
if (this.items[item] && this.items[item] != 0)
arr.push(this.items[item]);
}
if(arr.length>0){
this.query = Object.assign({}, this.query, { productIdList: arr });
if (arr.length > 0) {
this.query = Object.assign({}, this.query, { productIdList: arr });
}
this.getData();
......@@ -219,7 +241,7 @@ export default {
afterRender(data) {
console.log("tableData", data);
if (!this.sync) {
console.log("sync")
console.log("sync");
this.$nextTick(() => {
var count = 0;
for (var i in data.dict.productId) {
......@@ -229,10 +251,8 @@ export default {
this.sync = true;
});
}
//刷新地图markers
//刷新地图markers
this.$refs.map.refresh(data.data);
},
/** 重写新增方法 */
toAdd(row) {
......@@ -278,7 +298,7 @@ export default {
},
deviceStatus: null,
deviceCode: null,
deviceName: null,
items: {
item0: "",
......@@ -353,11 +373,9 @@ export default {
margin: 0;
}
}
</style>
<style>
.location0 {
font-size: 18px;
color: red;
......@@ -412,10 +430,10 @@ export default {
}
.location13 {
font-size: 18px;
color:cyan;
color: cyan;
}
.location14 {
font-size: 18px;
color:deepskyblue;
color: deepskyblue;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment