Commit 4c0539be authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 8d6395a5 72cd7d68
......@@ -25,10 +25,13 @@
v-model="type"
placeholder="请选择搜索类型"
>
<el-option label="按设备名称" :value="1"> </el-option>
<el-option label="按mac地址" :value="2"> </el-option>
<el-option label="按设备IP" :value="3"> </el-option>
<el-option label="按所属机构" :value="4"> </el-option>
<el-option
v-for="(v, key) in typeList"
:key="key"
:label="v"
:value="key"
>
</el-option>
</el-select>
<el-input
size="small"
......@@ -71,6 +74,8 @@
</el-table-column>
<el-table-column align="center" prop="deviceMac" label="mac地址">
</el-table-column>
<el-table-column align="center" prop="ip" label="IP地址">
</el-table-column>
<el-table-column align="center" label="设备位置">
<template slot-scope="scope">
<span
......@@ -204,6 +209,12 @@ import {
delDevice,
} from "@/api/device";
import local from "@/utils/local";
const typeList = {
deviceName: "按设备名称",
deviceMac: "按mac地址",
ip: "按IP地址",
belong: "按所属机构",
};
export default {
components: {
TableHeader,
......@@ -214,6 +225,7 @@ export default {
},
data() {
return {
typeList,
searchVal: "",
siteId: local.getLocal("sampleSiteId")
? local.getLocal("sampleSiteId")
......@@ -227,7 +239,7 @@ export default {
loading: false,
matterDrawer: false,
dict: {}, // 字典
type: 1,
type: "deviceName",
};
},
created() {
......@@ -242,15 +254,8 @@ export default {
page: this.current,
size: this.size,
};
if (this.type == 1) {
obj.deviceName = `%${this.searchVal}%`;
} else if (this.type == 2) {
obj.deviceMac = `%${this.searchVal}%`;
} else if (this.type == 3) {
obj.ip = `%${this.searchVal}%`;
} else if (this.type == 4) {
obj.belong = `%${this.searchVal}%`;
}
let value = `%${this.searchVal}%`;
obj[this.type] = value;
let res = await getDeviceList(obj);
this.loading = false;
......@@ -278,7 +283,7 @@ export default {
searchReset() {
this.searchVal = "";
this.current = 1;
this.type = 1;
this.type = "deviceName";
this.getDeviceList();
},
// 翻页
......
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