fay 7 years ago
parent
commit
c7fc741dea
  1. 5
      src/widget/month/trigger.month.js
  2. 8
      src/widget/year/trigger.year.js
  3. 6
      src/widget/yearmonth/trigger.yearmonth.js
  4. 6
      src/widget/yearquarter/trigger.yearquarter.js

5
src/widget/month/trigger.month.js

@ -8,8 +8,7 @@
BI.MonthTrigger = BI.inherit(BI.Trigger, { BI.MonthTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2
errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
}, },
_defaultConfig: function () { _defaultConfig: function () {
@ -33,7 +32,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap, hgap: c.hgap,
vgap: c.vgap, vgap: c.vgap,
allowBlank: true, allowBlank: true,
errorText: c.errorText errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
}); });
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.MonthTrigger.EVENT_FOCUS); self.fireEvent(BI.MonthTrigger.EVENT_FOCUS);

8
src/widget/year/trigger.year.js

@ -1,9 +1,7 @@
BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
}, },
_defaultConfig: function () { _defaultConfig: function () {
@ -31,7 +29,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
watermark: BI.i18nText("BI-Basic_Unrestricted"), watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true, allowBlank: true,
errorText: function (v) { errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text");
} }
}); });
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
@ -105,7 +103,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
this.editor.setValue(dateStr); this.editor.setValue(dateStr);
this.setTitle(BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr)); this.setTitle(BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr));
}, },
setValue: function (v) { setValue: function (v) {
var type, value; var type, value;
var date = BI.getDate(); var date = BI.getDate();

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

@ -1,9 +1,7 @@
BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
}, },
props: { props: {
@ -72,7 +70,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
}, },
watermark: BI.i18nText("BI-Basic_Unrestricted"), watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function (v) { errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text");
}, },
hgap: c.hgap, hgap: c.hgap,
vgap: c.vgap, vgap: c.vgap,

6
src/widget/yearquarter/trigger.yearquarter.js

@ -1,9 +1,7 @@
BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
}, },
props: { props: {
@ -71,7 +69,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
return false; return false;
}, },
errorText: function (v) { errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text");
}, },
watermark: BI.i18nText("BI-Basic_Unrestricted"), watermark: BI.i18nText("BI-Basic_Unrestricted"),
hgap: c.hgap, hgap: c.hgap,

Loading…
Cancel
Save