From 0f8be5eece9ec8a8a03dc7d4e4b3231e4dc4ebb6 Mon Sep 17 00:00:00 2001 From: mark <mark18340872469@163.com> Date: 星期三, 28 九月 2022 16:19:07 +0800 Subject: [PATCH] 添加时间段 删除取消确定按钮 --- src/views/dataPush/components/point.vue | 56 ++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/views/dataPush/components/point.vue b/src/views/dataPush/components/point.vue index bdd9d7b..b26d945 100644 --- a/src/views/dataPush/components/point.vue +++ b/src/views/dataPush/components/point.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="checkCamerasList(1)">鎼滅储</div> + <!-- <div class="button resetBtn" @click="reset">閲嶇疆</div> --> + </div> + </div> <div class="btns"> <div class="button add" @click="addPoint"> <span class="iconfont"></span> @@ -19,7 +32,9 @@ <el-table-column prop="channelCode" label="鎶ヨ閫氶亾缂栫爜" show-overflow-tooltip></el-table-column> <el-table-column prop="companyCode" label="浼佷笟缂栫爜" show-overflow-tooltip></el-table-column> <el-table-column prop="scenes" label="鎺ㄩ�佸満鏅�" show-overflow-tooltip></el-table-column> - <el-table-column prop="updatedAt" label="鎺ㄩ�佹椂闂�" show-overflow-tooltip></el-table-column> + <el-table-column prop="updatedAt" label="鎺ㄩ�佹椂闂�" show-overflow-tooltip> + <template slot-scope="scope">{{ scope.row.startTime }}-{{ scope.row.endTime }}</template> + </el-table-column> <el-table-column label="鎿嶄綔" align="center" width="100px"> <template slot-scope="scope"> @@ -52,7 +67,6 @@ class="add-ruleForm" > <el-form-item label="鐐逛綅鍚嶇О" prop="CameraName"> - <!-- <el-input v-model="ruleForm.CameraName" placeholder="璇疯緭鍏ョ偣浣嶅悕绉�" style="width: 350px"></el-input> --> <el-select style="width: 350px" v-model="ruleForm.CameraName" placeholder="璇烽�夋嫨"> <el-option v-for="item in cameraOptions" :key="item.id" :label="item.name" :value="item.name"> </el-option> </el-select> @@ -118,6 +132,8 @@ export default { data() { return { + query: {}, + inputText: "", //杈撳叆妗嗗唴瀹� cameraOptions: [], scene_nameOptions: [ { @@ -135,10 +151,6 @@ { value: "鍖哄煙鍏ヤ镜", label: "鍖哄煙鍏ヤ镜" - }, - { - value: "浜哄憳鎾ょ", - label: "浜哄憳鎾ょ" }, { value: "浜哄憳绂诲矖", @@ -186,22 +198,26 @@ dataList: [], - tip: 1, + tip: 1, // 鍖哄垎淇濆瓨杩樻槸缂栬緫 浣嗘槸鐜板湪娌℃湁缂栬緫 rules: { CameraName: [{ required: true, message: "璇烽�夋嫨璁惧鍚嶇О", trigger: "change" }], ChannelCode: [{ required: true, message: "璇疯緭鍏ユ姤璀﹂�氶亾缂栫爜", trigger: "blur" }], CompanyCode: [{ required: true, message: "璇疯緭鍏ヤ紒涓氱紪鐮�", trigger: "blur" }], - Sceneslist: [{ type: "array", required: true, message: "璇烽�夋嫨鎺ㄩ�佸満鏅�", trigger: "change" }] - // StartTime: [{ required: true, message: "璇烽�夋嫨寮�濮嬫椂闂�", trigger: "change" }], - // EndTime: [{ required: true, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" }] + Sceneslist: [{ type: "array", required: true, message: "璇烽�夋嫨鎺ㄩ�佸満鏅�", trigger: "change" }], + StartTime: [{ type: "string", required: true, message: "璇烽�夋嫨寮�濮嬫椂闂�", trigger: "change" }], + EndTime: [{ type: "string", required: true, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" }] }, page: 1, size: 10, //鍒嗛〉鐩稿叧 total: 0 //鎬绘暟, } }, - created() { - this.checkCamerasList() + async created() { + let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText } + this.query = query + let res = await camerasList(query) + this.dataList = res.data + this.total = res.total this.aaaaa() }, @@ -290,10 +306,18 @@ this.checkCamerasList() }) }, - async checkCamerasList() { - let res = await camerasList({ pageIndex: this.page, pageSize: this.size }) - this.dataList = res.data - this.total = res.total + async checkCamerasList(val) { + if (val === 1) { + let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText } + this.query = query + let res = await camerasList(query) + this.dataList = res.data + this.total = res.total + } else { + let res = await camerasList(this.query) + this.dataList = res.data + this.total = res.total + } }, resetUser() { this.ruleForm = { -- Gitblit v1.8.0