From 15fa5d77c474858a4681f8ae1a5c9c4134b6c7cf Mon Sep 17 00:00:00 2001 From: qianming Date: Wed, 1 Nov 2023 13:46:34 +0800 Subject: [PATCH] =?UTF-8?q?feat--=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=99=A8=E5=A2=9E=E5=8A=A0=E7=AD=9B=E9=80=89=E7=BB=B4=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/widget/form/widgetFormTime.vue | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetFormTime.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetFormTime.vue index 837480a1..88ffb2fc 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetFormTime.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetFormTime.vue @@ -20,6 +20,7 @@ import { targetWidgetLinkageLogic, } from "@/views/bigscreenDesigner/designer/linkageLogic"; import miment from 'miment' + export default { name: "WidgetFormTime", props: { @@ -37,7 +38,7 @@ export default { optionsData: {}, optionsSetup: {}, //日期时间快捷选项 - datetimeRangePickerOptions:{ + datetimeRangePickerOptions: { shortcuts: [{ text: '今天', onClick(picker) { @@ -45,20 +46,20 @@ export default { const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); picker.$emit('pick', [start, end]); } - },{ + }, { text: '昨天', onClick(picker) { - const start=new Date(new Date(new Date().getTime()-24*60*60*1000).setHours(0, 0, 0, 0)); - const end=new Date(new Date(new Date().getTime()-24*60*60*1000).setHours(23, 59, 59, 999)); + const start = new Date(new Date(new Date().getTime() - 24 * 60 * 60 * 1000).setHours(0, 0, 0, 0)); + const end = new Date(new Date(new Date().getTime() - 24 * 60 * 60 * 1000).setHours(23, 59, 59, 999)); picker.$emit('pick', [start, end]); } - },{ + }, { text: '最近一周', onClick(picker) { const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); - const start = new Date(new Date(new Date().getTime()+24*60*60*1000)); + const start = new Date(new Date(new Date().getTime() + 24 * 60 * 60 * 1000)); start.setTime(miment().add(-6, 'DD').stamp()); - new Date(start.setHours(0,0,0,0)); + new Date(start.setHours(0, 0, 0, 0)); picker.$emit('pick', [start, end]); } }, { @@ -67,7 +68,7 @@ export default { const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); const start = new Date(); start.setTime(miment().add(-1, 'MM').stamp()); - new Date(start.setHours(0,0,0,0)); + new Date(start.setHours(0, 0, 0, 0)); picker.$emit('pick', [start, end]); } }, { @@ -76,7 +77,25 @@ export default { const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); const start = new Date(); start.setTime(miment().add(-3, 'MM').stamp()); - new Date(start.setHours(0,0,0,0)); + new Date(start.setHours(0, 0, 0, 0)); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近半年', + onClick(picker) { + const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); + const start = new Date(); + start.setTime(miment().add(-6, 'MM').stamp()); + new Date(start.setHours(0, 0, 0, 0)); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一年', + onClick(picker) { + const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999)); + const start = new Date(); + start.setTime(miment().add(-1, 'YY').stamp()); + new Date(start.setHours(0, 0, 0, 0)); picker.$emit('pick', [start, end]); } }], @@ -144,6 +163,7 @@ export default { height: 100%; background: inherit; color: inherit; + &::placeholder { color: inherit; }