From e6d27bba6ae508e57fbca9149c858adf7b15148d Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Thu, 9 Jun 2022 09:49:03 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-73071=20fix:=20=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E8=AE=B0=E5=BD=95datetime=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=89=8D=E6=98=AF=E5=90=A6=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E8=BF=87error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdatetime/dynamicdatetime.combo.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 1b8a58243..281ac0957 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -32,6 +32,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { var date = BI.getDate(); this.storeValue = opts.value; var border = opts.simple ? 1 : 2; + var errorState = false; return { type: "bi.absolute", @@ -120,6 +121,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { } }; self.combo.element.addClass("error"); + errorState = true; self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR); } }, { @@ -138,10 +140,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { action: function () { var dateStore = self.storeTriggerValue; var dateObj = self.trigger.getKey(); - if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore)) { + if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore) && !errorState) { return; } - if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { + if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore) + || BI.isEqual(dateObj, dateStore) && errorState) { self.storeValue = self.trigger.getValue(); self.setValue(self.trigger.getValue()); } else if (BI.isEmptyString(dateObj)) { @@ -150,6 +153,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { } self._checkDynamicValue(self.storeValue); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); + errorState = false; } }] }]