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

地图模糊查询添加

parent 70d2fc07
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<!--信息窗体--> <!--信息窗体-->
<el-amap-info-window <el-amap-info-window
:closeWhenClickMap="true"
:position="window.position" :position="window.position"
:visible="window.visible" :visible="window.visible"
:content="window.content" :content="window.content"
......
...@@ -89,7 +89,11 @@ ...@@ -89,7 +89,11 @@
>编辑站点</el-button >编辑站点</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-button
> >
</el-row> </el-row>
...@@ -103,6 +107,7 @@ ...@@ -103,6 +107,7 @@
<el-select <el-select
style="padding: 5px" style="padding: 5px"
size="mini" size="mini"
@change="deviceStatuschange"
v-model="deviceStatus" v-model="deviceStatus"
placeholder="请选择设备状态" placeholder="请选择设备状态"
> >
...@@ -119,7 +124,8 @@ ...@@ -119,7 +124,8 @@
<el-row> <el-row>
<el-input <el-input
size="mini" size="mini"
v-model="deviceCode" v-model="deviceName"
@change="deviceNameChange"
style="padding: 5px" style="padding: 5px"
placeholder="请输入设备编码" placeholder="请输入设备编码"
></el-input> ></el-input>
...@@ -177,12 +183,28 @@ export default { ...@@ -177,12 +183,28 @@ export default {
this.query = { siteId, siteId }; this.query = { siteId, siteId };
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.map.relocate(this.info); this.$refs.map.relocate(this.info);
}) });
}, },
methods: { methods: {
formatterDate, formatterDate,
addDevice(){ deviceStatuschange(val) {
let row={} 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.siteId = this.info.siteId;
row.siteName = this.info.siteName; row.siteName = this.info.siteName;
row.siteCode = this.info.siteCode; row.siteCode = this.info.siteCode;
...@@ -210,7 +232,7 @@ export default { ...@@ -210,7 +232,7 @@ export default {
if (this.items[item] && this.items[item] != 0) if (this.items[item] && this.items[item] != 0)
arr.push(this.items[item]); arr.push(this.items[item]);
} }
if(arr.length>0){ if (arr.length > 0) {
this.query = Object.assign({}, this.query, { productIdList: arr }); this.query = Object.assign({}, this.query, { productIdList: arr });
} }
...@@ -219,7 +241,7 @@ export default { ...@@ -219,7 +241,7 @@ export default {
afterRender(data) { afterRender(data) {
console.log("tableData", data); console.log("tableData", data);
if (!this.sync) { if (!this.sync) {
console.log("sync") console.log("sync");
this.$nextTick(() => { this.$nextTick(() => {
var count = 0; var count = 0;
for (var i in data.dict.productId) { for (var i in data.dict.productId) {
...@@ -231,8 +253,6 @@ export default { ...@@ -231,8 +253,6 @@ export default {
} }
//刷新地图markers //刷新地图markers
this.$refs.map.refresh(data.data); this.$refs.map.refresh(data.data);
}, },
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
...@@ -278,7 +298,7 @@ export default { ...@@ -278,7 +298,7 @@ export default {
}, },
deviceStatus: null, deviceStatus: null,
deviceCode: null, deviceName: null,
items: { items: {
item0: "", item0: "",
...@@ -353,11 +373,9 @@ export default { ...@@ -353,11 +373,9 @@ export default {
margin: 0; margin: 0;
} }
} }
</style> </style>
<style> <style>
.location0 { .location0 {
font-size: 18px; font-size: 18px;
color: red; color: red;
...@@ -412,10 +430,10 @@ export default { ...@@ -412,10 +430,10 @@ export default {
} }
.location13 { .location13 {
font-size: 18px; font-size: 18px;
color:cyan; color: cyan;
} }
.location14 { .location14 {
font-size: 18px; font-size: 18px;
color:deepskyblue; color: deepskyblue;
} }
</style> </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