From bf95b5fa867fb9de61e8c76315625c51f0138c68 Mon Sep 17 00:00:00 2001 From: lxl <lixuliang_hd@126.com> Date: 星期日, 20 十一月 2022 18:04:47 +0800 Subject: [PATCH] 查询 --- src/views/maintenance/operationLog.vue | 72 ++++++++++++++++++----------------- 1 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/views/maintenance/operationLog.vue b/src/views/maintenance/operationLog.vue index 1d97e43..d0198bf 100644 --- a/src/views/maintenance/operationLog.vue +++ b/src/views/maintenance/operationLog.vue @@ -9,26 +9,25 @@ <el-divider /> <div class="inquire"> <div class="herder_box"> - {{ $t('operatManage.operationLogObj.queryRegion') }} + {{ $t("operatManage.operationLogObj.queryRegion") }} </div> - <el-form ref="formData3" :model="form" :inline="true"> + <el-form :inline="true" ref="sizeForm" :model="sizeForm"> <el-form-item - :label="$t('operatManage.operationLogObj.username')" prop="uname" + :label="$t('operatManage.operationLogObj.username')" > <el-input - v-model="form.uname" + v-model="sizeForm.uname" :placeholder="$t('operatManage.operationLogObj.pleaseInput')" /> </el-form-item> - <el-form-item - :label="$t('operatManage.operationLogObj.operationType')" prop="type" + :label="$t('operatManage.operationLogObj.operationType')" > <el-select clearable - v-model="form.type" + v-model="sizeForm.type" :placeholder="$t('operatManage.operationLogObj.pleaseSelect')" > <el-option @@ -68,12 +67,11 @@ <el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" - v-model="form.start" + v-model="sizeForm.start" style="width: 100%" type="datetime" :placeholder="$t('operatManage.operationLogObj.optionDate')" - > - </el-date-picker> + ></el-date-picker> </el-form-item> <el-form-item prop="end" @@ -82,25 +80,26 @@ <el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" - v-model="form.end" + v-model="sizeForm.end" style="width: 100%" type="datetime" :placeholder="$t('operatManage.operationLogObj.optionDate')" > </el-date-picker> </el-form-item> + <el-form-item> <el-button @click="onSubmit" icon="el-icon-search" style="background: #409eff; border: 1px solid #409eff; color: white" - >{{ $t('operatManage.operationLogObj.inquire') }}</el-button + >{{ $t("operatManage.operationLogObj.inquire") }}</el-button > <el-button - @click="onEmpty('formData3')" - type="info" + @click="onEmpty('sizeForm')" icon="el-icon-delete" - >{{ $t('operatManage.operationLogObj.empty') }}</el-button + type="info" + >{{ $t("operatManage.operationLogObj.empty") }}</el-button > </el-form-item> </el-form> @@ -181,8 +180,8 @@ </template> <script> -import MyBread from '../../components/MyBread.vue'; -import { operateSelectByPageAndCount } from '../../api/api'; +import MyBread from "../../components/MyBread.vue"; +import { operateSelectByPageAndCount } from "../../api/api"; export default { //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� components: { @@ -192,7 +191,12 @@ data() { return { currentPage4: 1, - form: {}, + sizeForm: { + uname: "", + start: null, + end: null, + type: [], + }, tableData: [], listData: { pageIndex: 1, @@ -204,7 +208,7 @@ methods: { //鏍煎紡鍖栨椂闂� add0(m) { - return m < 10 ? '0' + m : m; + return m < 10 ? "0" + m : m; }, //鏍煎紡鍖栨椂闂� format(shijianchuo) { @@ -217,7 +221,7 @@ var mm = time.getMinutes(); var s = time.getSeconds(); return ( - y + '-' + this.add0(m) + '-' + this.add0(d) + y + "-" + this.add0(m) + "-" + this.add0(d) // " " + // this.add0(h) + // ":" + @@ -239,25 +243,25 @@ let data; switch (row[column.property]) { case 0: - data = '鍏跺畠'; + data = "鍏跺畠"; break; case 1: - data = '鏌ョ湅'; + data = "鏌ョ湅"; break; case 2: - data = '鏂板'; + data = "鏂板"; break; case 3: - data = '淇敼'; + data = "淇敼"; break; case 4: - data = '鍒犻櫎'; + data = "鍒犻櫎"; break; case 5: - data = '涓婁紶'; + data = "涓婁紶"; break; case 6: - data = '涓嬭浇'; + data = "涓嬭浇"; break; } return data; @@ -270,22 +274,20 @@ this.listData.pageIndex = val; this.getList(); }, - onEmpty(formData1) { - this.$refs[formData1].resetFields(); //閲嶇疆琛ㄥ崟鏁版嵁 - // this.form = {} - this.form.start = null; - this.form.end = null; - }, onSubmit() { - this.listData = { ...this.listData, ...this.form }; + this.listData = { ...this.listData, ...this.sizeForm }; // console.log(this.listData) this.getList(); }, + onEmpty(formData1) { + this.$refs[formData1].resetFields(); //閲嶇疆琛ㄥ崟鏁版嵁 + }, + async getList() { const data = await operateSelectByPageAndCount(this.listData); if (data.code != 200) { - return this.$message.error('鍒楄〃璋冪敤澶辫触'); + return this.$message.error("鍒楄〃璋冪敤澶辫触"); } this.tableData = data.result; this.count = data.count; -- Gitblit v1.9.3