Browse Source

BI-90534 fix: 细化check标红

es6
windy 3 years ago
parent
commit
a8d64db949
  1. 6
      src/widget/yearmonth/trigger.yearmonth.js
  2. 8
      src/widget/yearquarter/trigger.yearquarter.js

6
src/widget/yearmonth/trigger.yearmonth.js

@ -67,7 +67,11 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
if (isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1, 1, o.min, o.max)[0]);
var month = self.monthEditor.getValue();
if(BI.isEmptyString(month)) {
month = parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? (BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1) : 1;
}
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, month, 1, o.min, o.max)[0]);
}
var year = self.yearEditor.getValue();

8
src/widget/yearquarter/trigger.yearquarter.js

@ -65,7 +65,13 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1, 1, o.min, o.max)[0]);
var month = self.quarterEditor.getValue();
if(BI.isEmptyString(month)) {
month = parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1;
} else {
month = (v - 1) * 3 + 1;
}
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, month, 1, o.min, o.max)[0]);
}
var year = self.yearEditor.getValue();

Loading…
Cancel
Save