diff --git a/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue b/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue index 4cf4172637d3d6d5d99cc2861d4811730e0b18c4..1e408646f96ac521087b245f6fa2ff60269ee091 100644 --- a/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue +++ b/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue @@ -25,10 +25,13 @@ v-model="type" placeholder="璇烽€夋嫨鎼滅储绫诲瀷" > - <el-option label="鎸夎澶囧悕绉�" :value="1"> </el-option> - <el-option label="鎸塵ac鍦板潃" :value="2"> </el-option> - <el-option label="鎸夎澶嘔P" :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: "鎸塵ac鍦板潃", + ip: "鎸塈P鍦板潃", + 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(); }, // 缈婚〉