From c1dd39fb66c04f1b4307cb68fa291b2e8e0fbf4a Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Tue, 18 Oct 2022 17:38:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=A5=E5=91=8Abox=20time=20limit=20?= =?UTF-8?q?=E4=B8=BA=20customize=20=E6=97=B6=E5=A2=9E=E5=8A=A0=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rightBox/report/ReportBox.vue | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue index c7c1ece9..45664ed7 100644 --- a/src/components/rightBox/report/ReportBox.vue +++ b/src/components/rightBox/report/ReportBox.vue @@ -431,6 +431,36 @@ export default { } } }, + 'editObject.config.startTime': { + handler (n) { + const nowDate = new Date().getTime() + const starDate = new Date(this.editObject.config.startTime) + const endData = new Date(this.editObject.config.endTime) + if (this.editObject.config.endTime !== null && this.editObject.config.startTime !== null) { + if (starDate.getTime() > endData.getTime()) { + this.editObject.config.startTime = '' + } + } + if (this.editObject.config.startTime !== null && starDate.getTime() > nowDate) { + this.editObject.config.startTime = '' + } + } + }, + 'editObject.config.endTime': { + handler (n) { + const nowDate = new Date().getTime() + const starDate = new Date(this.editObject.config.startTime) + const endData = new Date(this.editObject.config.endTime) + if (this.editObject.config.endTime !== null && this.editObject.config.startTime !== null) { + if (starDate.getTime() > endData.getTime()) { + this.editObject.config.endTime = '' + } + } + if (this.editObject.config.startTime !== null && endData.getTime() > nowDate) { + this.editObject.config.endTime = '' + } + } + }, object: { deep: true, immediate: true,