From fc38bef5d15fb79282853e6b875bed4efa27c62d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 5 Aug 2022 04:33:13 -0400 Subject: [PATCH] =?UTF-8?q?perf(=E4=BB=AA=E8=A1=A8=E6=9D=BF-=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=8C=83=E5=9B=B4=E8=BF=87=E6=BB=A4=E5=99=A8):=20?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E9=80=89=E6=8B=A9=E5=90=8C=E4=B8=80=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filter/defaultValue/DeDateRangeDefault.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/panel/filter/defaultValue/DeDateRangeDefault.vue b/frontend/src/views/panel/filter/defaultValue/DeDateRangeDefault.vue index 9e72ba9ece..f5834ec7b2 100644 --- a/frontend/src/views/panel/filter/defaultValue/DeDateRangeDefault.vue +++ b/frontend/src/views/panel/filter/defaultValue/DeDateRangeDefault.vue @@ -179,7 +179,18 @@ export default { } }, computed: { - + isOneDay() { + const isDynamicDay = this.element.options.attrs.default.isDynamic && + this.element.options.attrs.default.dkey === 4 && + this.element.options.attrs.default.eDynamicInfill && + this.element.options.attrs.default.eDynamicInfill === 'day' + if (isDynamicDay) { + const widget = ApplicationContext.getService(this.element.serviceName) + const time = widget.dynamicDateFormNow(this.element) + return isDynamicDay && time[1] === time[0] + } + return false + }, isTimeWidget() { const widget = ApplicationContext.getService(this.element.serviceName) return widget.isTimeWidget && widget.isTimeWidget() @@ -234,7 +245,7 @@ export default { const widget = ApplicationContext.getService(this.element.serviceName) const time = widget.dynamicDateFormNow(this.element) this.dval = time - bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0])) + bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0] || this.isOneDay)) this.element.options.manualModify = false } }