From 39d577ac7950e87b593d96df0b77d5a386756566 Mon Sep 17 00:00:00 2001 From: mark <mark18340872469@163.com> Date: 星期三, 28 九月 2022 10:43:05 +0800 Subject: [PATCH] 摄像机 find 与 数据推送 的 查询(查询后加的 --- src/views/dataPush/components/device.vue | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/views/dataPush/components/device.vue b/src/views/dataPush/components/device.vue index 4844177..41f078d 100644 --- a/src/views/dataPush/components/device.vue +++ b/src/views/dataPush/components/device.vue @@ -1,5 +1,18 @@ <template> <div class="sub-account" v-if="!isShowAdd"> + <div class="search"> + <div class="left"> + <div class="id"> + 璁惧鍚嶇О + <el-input v-model="inputText" placeholder="璇疯緭鍏�" clearable></el-input> + </div> + </div> + + <div class="right"> + <div class="button searchBtn" @click="fetchDevicesList(1)">鎼滅储</div> + <!-- <div class="button resetBtn" @click="reset">閲嶇疆</div> --> + </div> + </div> <div class="btns"> <div class="button add" @click="addDevice"> <span class="iconfont"></span> @@ -16,9 +29,15 @@ :default-sort="{ prop: 'createTime', order: 'descending' }" > <el-table-column prop="devName" label="璁惧鍚嶇О" show-overflow-tooltip></el-table-column> - <el-table-column prop="devId" label="璁惧ID" show-overflow-tooltip></el-table-column> + <!-- <el-table-column prop="devId" label="璁惧ID" show-overflow-tooltip></el-table-column> --> <el-table-column prop="devIp" label="璁惧IP" show-overflow-tooltip></el-table-column> <el-table-column prop="devCode" label="璁惧缂栫爜" show-overflow-tooltip></el-table-column> + <el-table-column prop="state" label="鐘舵��" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-if="scope.row.state == 0" class="status green">绂荤嚎</div> + <div v-else class="status">鍦ㄧ嚎</div> + </template> + </el-table-column> <el-table-column prop="companyCode" label="浼佷笟缂栫爜" show-overflow-tooltip></el-table-column> <el-table-column label="鎿嶄綔" align="center" width="100px"> @@ -86,6 +105,8 @@ export default { data() { return { + query: {}, + inputText: "", //杈撳叆妗嗗唴瀹� isShowAdd: false, //鏄惁灞曠ず鏂板寮圭獥 dataList: [], tip: 1, @@ -114,15 +135,27 @@ total: 0 //鎬绘暟, } }, - created() { - this.fetchDevicesList() + async created() { + let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText } + this.query = query + let res = await getDevicesList(query) + this.dataList = res.data + this.total = res.total }, mounted() {}, methods: { - async fetchDevicesList() { - let res = await getDevicesList({ pageIndex: this.page, pageSize: this.size }) - this.dataList = res.data - this.total = res.total + async fetchDevicesList(val) { + if (val === 1) { + let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText } + this.query = query + let res = await getDevicesList(query) + this.dataList = res.data + this.total = res.total + } else { + let res = await getDevicesList(this.query) + this.dataList = res.data + this.total = res.total + } }, delUser(row) { console.log(row, "row") -- Gitblit v1.8.0