From 1d04746ae8a1c5d4c36e28a938decddb8c35c46d Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Fri, 13 Oct 2023 15:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E7=B1=BB=E5=9E=8B=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4(=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/faultType/index.vue | 111 +++++++++++++++++++-------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/src/views/device/faultType/index.vue b/src/views/device/faultType/index.vue index 47e7e0f..07dfef5 100644 --- a/src/views/device/faultType/index.vue +++ b/src/views/device/faultType/index.vue @@ -75,38 +75,50 @@ @keyup.enter.native="handleQuery" /> - - - - - - - - - - - - - - + + + + + + + + + + + + + + 搜索 重置 @@ -266,6 +278,34 @@ export default { dicts: ['device_fault_type'], data() { return { + // 日期范围选择快捷 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, // 遮罩层 loading: true, // 选中数组 @@ -300,7 +340,9 @@ export default { createBy: null, createTime: null, updateBy: null, - updateTime: null + updateTime: null, + createTimeArray: [], + updateTimeArray: [], }, // 表单参数 form: {}, @@ -355,6 +397,9 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + // 重置日期范围 + this.queryParams.createTimeArray = []; + this.queryParams.updateTimeArray = []; this.handleQuery(); }, // 多选框选中数据