Browse Source

Pull request #2027: BI-90534 fix: 细化年月年季度check标红

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '68041d07cbb537166e26a6d45e5e1478c67b68e6':
  BI-90534 fix: 细化check标红
es6
windy 3 years ago
parent
commit
0fc4b473fd
  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, height: o.height,
validationChecker: function (v) { validationChecker: function (v) {
if (isYear) { 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(); 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, height: o.height,
validationChecker: function (v) { validationChecker: function (v) {
if(isYear) { 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(); var year = self.yearEditor.getValue();

Loading…
Cancel
Save