Browse Source

Merge pull request #349 in FUI/fineui from ~WINDY/fui:master to master

* commit '6b82b320b7d63c62c5500f56a21ab2b545b2c8e8':
  update
  BI-18028
  update
  update
  BI-18614
  BI-18606
  BI-18625
  BI-18326 && BI-18585
es6
guy 7 years ago
parent
commit
45afb83c26
  1. 26
      dist/_fineui.min.js
  2. 94
      dist/bundle.js
  3. 26
      dist/bundle.min.js
  4. 26
      dist/fineui.min.js
  5. 94
      dist/widget.js
  6. 20
      src/widget/downlist/popup.downlist.js
  7. 1
      src/widget/dynamicdate/dynamicdate.combo.js
  8. 2
      src/widget/dynamicdate/dynamicdate.popup.js
  9. 25
      src/widget/dynamicdate/dynamicdate.trigger.js
  10. 1
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  11. 2
      src/widget/dynamicdatetime/dynamicdatetime.popup.js
  12. 24
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  13. 1
      src/widget/year/combo.year.js
  14. 2
      src/widget/year/trigger.year.js
  15. 1
      src/widget/yearmonth/combo.yearmonth.js
  16. 6
      src/widget/yearmonth/trigger.yearmonth.js
  17. 1
      src/widget/yearquarter/combo.yearquarter.js
  18. 2
      src/widget/yearquarter/popup.yearquarter.js
  19. 6
      src/widget/yearquarter/trigger.yearquarter.js

26
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

94
dist/bundle.js vendored

@ -89946,7 +89946,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = [];
this.childValueMap = {};
this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items);
this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({
type: "bi.button_tree",
items: BI.createItems(children,
@ -89996,7 +89997,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) {
var self = this, result = [];
// 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) {
BI.each(items, function (i, it) {
var item_done = {
type: "bi.down_list_group",
items: []
@ -90115,9 +90116,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
_checkValues: function (values) {
var self = this, o = this.options;
var value = [];
BI.each(o.items, function (idx, itemGroup) {
BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
@ -90150,17 +90150,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
self.childValueMap = {};
self.fatherValueMap = {};
self.singleValues = [];
var children = self._createChildren(items);
this.items = BI.deepClone(items);
this.childValueMap = {};
this.fatherValueMap = {};
this.singleValues = [];
var children = this._createChildren(this.items);
var popupItem = BI.createItems(children,
{}, {
adjustLength: -2
}
);
self.popup.populate(popupItem);
this.popup.populate(popupItem);
},
setValue: function (valueItem) {
@ -90693,6 +90693,7 @@ BI.extend(BI.DynamicDateCard, {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}]
@ -91081,7 +91082,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self._setInnerValue();
@ -91167,7 +91168,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -91187,9 +91189,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -91281,6 +91283,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
}
break;
case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) {
this.editor.setValue(v + "-");
}
@ -91296,7 +91299,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -91309,27 +91313,27 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value + endText;
@ -91510,6 +91514,7 @@ BI.shortcut("bi.dynamic_date_trigger", BI.DynamicDateTrigger);BI.DynamicDateTime
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}]
@ -91799,7 +91804,7 @@ BI.extend(BI.DynamicDateTimeCombo, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self.timeSelect.setValue();
@ -92056,7 +92061,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -92076,9 +92082,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -92188,7 +92194,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -92200,22 +92207,22 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -108131,6 +108138,7 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.storeValue = null;
self.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
});
@ -108546,7 +108554,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -108824,6 +108832,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
@ -109225,7 +109234,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -109307,10 +109316,10 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -109766,6 +109775,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
@ -109959,7 +109969,7 @@ BI.extend(BI.DynamicYearQuarterCombo, {
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x");
date = date.print("%Y-%Q");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
@ -110146,7 +110156,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -110226,10 +110236,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

26
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

26
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

94
dist/widget.js vendored

@ -2809,7 +2809,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = [];
this.childValueMap = {};
this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items);
this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({
type: "bi.button_tree",
items: BI.createItems(children,
@ -2859,7 +2860,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) {
var self = this, result = [];
// 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) {
BI.each(items, function (i, it) {
var item_done = {
type: "bi.down_list_group",
items: []
@ -2978,9 +2979,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
_checkValues: function (values) {
var self = this, o = this.options;
var value = [];
BI.each(o.items, function (idx, itemGroup) {
BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
@ -3013,17 +3013,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
self.childValueMap = {};
self.fatherValueMap = {};
self.singleValues = [];
var children = self._createChildren(items);
this.items = BI.deepClone(items);
this.childValueMap = {};
this.fatherValueMap = {};
this.singleValues = [];
var children = this._createChildren(this.items);
var popupItem = BI.createItems(children,
{}, {
adjustLength: -2
}
);
self.popup.populate(popupItem);
this.popup.populate(popupItem);
},
setValue: function (valueItem) {
@ -3556,6 +3556,7 @@ BI.extend(BI.DynamicDateCard, {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}]
@ -3944,7 +3945,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self._setInnerValue();
@ -4030,7 +4031,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -4050,9 +4052,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -4144,6 +4146,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
}
break;
case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) {
this.editor.setValue(v + "-");
}
@ -4159,7 +4162,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -4172,27 +4176,27 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value + endText;
@ -4373,6 +4377,7 @@ BI.shortcut("bi.dynamic_date_trigger", BI.DynamicDateTrigger);BI.DynamicDateTime
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}]
@ -4662,7 +4667,7 @@ BI.extend(BI.DynamicDateTimeCombo, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self.timeSelect.setValue();
@ -4919,7 +4924,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -4939,9 +4945,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -5051,7 +5057,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -5063,22 +5070,22 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -20994,6 +21001,7 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.storeValue = null;
self.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
});
@ -21409,7 +21417,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -21687,6 +21695,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
@ -22088,7 +22097,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -22170,10 +22179,10 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
@ -22629,6 +22638,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
@ -22822,7 +22832,7 @@ BI.extend(BI.DynamicYearQuarterCombo, {
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x");
date = date.print("%Y-%Q");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
@ -23009,7 +23019,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -23089,10 +23099,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

20
src/widget/downlist/popup.downlist.js

@ -26,7 +26,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = [];
this.childValueMap = {};
this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items);
this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({
type: "bi.button_tree",
items: BI.createItems(children,
@ -76,7 +77,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) {
var self = this, result = [];
// 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) {
BI.each(items, function (i, it) {
var item_done = {
type: "bi.down_list_group",
items: []
@ -195,9 +196,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
_checkValues: function (values) {
var self = this, o = this.options;
var value = [];
BI.each(o.items, function (idx, itemGroup) {
BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
@ -230,17 +230,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
self.childValueMap = {};
self.fatherValueMap = {};
self.singleValues = [];
var children = self._createChildren(items);
this.items = BI.deepClone(items);
this.childValueMap = {};
this.fatherValueMap = {};
this.singleValues = [];
var children = this._createChildren(this.items);
var popupItem = BI.createItems(children,
{}, {
adjustLength: -2
}
);
self.popup.populate(popupItem);
this.popup.populate(popupItem);
},
setValue: function (valueItem) {

1
src/widget/dynamicdate/dynamicdate.combo.js

@ -113,6 +113,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}]

2
src/widget/dynamicdate/dynamicdate.popup.js

@ -132,7 +132,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self._setInnerValue();

25
src/widget/dynamicdate/dynamicdate.trigger.js

@ -3,7 +3,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -23,9 +24,9 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -117,6 +118,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
}
break;
case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) {
this.editor.setValue(v + "-");
}
@ -132,7 +134,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -145,27 +148,27 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value + endText;

1
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -113,6 +113,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}]

2
src/widget/dynamicdatetime/dynamicdatetime.popup.js

@ -143,7 +143,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
month: date.getMonth() + 1,
day: date.getDate()
});
self.timeSelect.setValue();

24
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -3,7 +3,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 7
yearMonthLength: 6,
yearFullMonthLength: 7
},
props: {
@ -23,9 +24,9 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
@ -135,7 +136,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max;
return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -147,22 +149,22 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
if(BI.isNotNull(obj.week) && BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
if(BI.isNotNull(obj.day) && BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

1
src/widget/year/combo.year.js

@ -41,6 +41,7 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
self.storeValue = null;
self.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
});

2
src/widget/year/trigger.year.js

@ -91,7 +91,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

1
src/widget/yearmonth/combo.yearmonth.js

@ -36,6 +36,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {

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

@ -63,7 +63,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -145,10 +145,10 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

1
src/widget/yearquarter/combo.yearquarter.js

@ -32,6 +32,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
return;
}
self.storeValue = self.trigger.getValue();
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});

2
src/widget/yearquarter/popup.yearquarter.js

@ -74,7 +74,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x");
date = date.print("%Y-%Q");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}

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

@ -63,7 +63,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -143,10 +143,10 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;

Loading…
Cancel
Save