Browse Source

更新代码

research/test
Austin.Duan 3 years ago
parent
commit
f1e3174b45
  1. 8
      src/widget/dynamicdatetime/dynamicdatetime.combo.js

8
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -32,7 +32,6 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
var date = BI.getDate(); var date = BI.getDate();
this.storeValue = opts.value; this.storeValue = opts.value;
var border = opts.simple ? 1 : 2; var border = opts.simple ? 1 : 2;
var errorState = false;
return { return {
type: "bi.absolute", type: "bi.absolute",
@ -121,7 +120,6 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
} }
}; };
self.combo.element.addClass("error"); self.combo.element.addClass("error");
errorState = true;
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR);
} }
}, { }, {
@ -141,11 +139,10 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
action: function () { action: function () {
var dateStore = self.storeTriggerValue; var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey(); var dateObj = self.trigger.getKey();
if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore) && !errorState) { if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore)) {
return; 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.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue()); self.setValue(self.trigger.getValue());
} else if (BI.isEmptyString(dateObj)) { } else if (BI.isEmptyString(dateObj)) {
@ -154,7 +151,6 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
} }
self._checkDynamicValue(self.storeValue); self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
errorState = false;
} }
}] }]
}] }]

Loading…
Cancel
Save