|
|
@ -37303,7 +37303,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
var v = []; |
|
|
|
var v = []; |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
v = BI.concat(v, item.getValue()); |
|
|
|
v = BI.union(v, item.getValue()); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
@ -111219,35 +111219,11 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_VALID, function () { |
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_VALID, function () { |
|
|
|
BI.Bubbles.hide("error"); |
|
|
|
self._checkValid(); |
|
|
|
var smallDate = self.left.getKey(), bigDate = self.right.getKey(); |
|
|
|
|
|
|
|
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) { |
|
|
|
|
|
|
|
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")); |
|
|
|
|
|
|
|
self.element.addClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, { |
|
|
|
|
|
|
|
offsetStyle: "center" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self._clearTitle(); |
|
|
|
|
|
|
|
self.element.removeClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () { |
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () { |
|
|
|
BI.Bubbles.hide("error"); |
|
|
|
self._checkValid(); |
|
|
|
var smallDate = self.left.getKey(), bigDate = self.right.getKey(); |
|
|
|
|
|
|
|
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) { |
|
|
|
|
|
|
|
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")); |
|
|
|
|
|
|
|
self.element.addClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, { |
|
|
|
|
|
|
|
offsetStyle: "center" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self._clearTitle(); |
|
|
|
|
|
|
|
self.element.removeClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
@ -111285,8 +111261,17 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year |
|
|
|
// 判格式合法
|
|
|
|
// 判格式合法
|
|
|
|
_check: function (smallDate, bigDate) { |
|
|
|
_check: function (smallDate, bigDate) { |
|
|
|
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g); |
|
|
|
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g); |
|
|
|
var smallDate4Check = (smallObj[0] || "") + "-" + (smallObj[1] || 1); |
|
|
|
|
|
|
|
var bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1); |
|
|
|
var smallDate4Check = ""; |
|
|
|
|
|
|
|
if (BI.isNotNull(smallObj)) { |
|
|
|
|
|
|
|
smallDate4Check = (smallObj[0] || "") + "-" + (smallObj[1] || 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bigDate4Check = ""; |
|
|
|
|
|
|
|
if (BI.isNotNull(bigObj)) { |
|
|
|
|
|
|
|
bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate) && this._checkVoid({ |
|
|
|
return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate) && this._checkVoid({ |
|
|
|
year: smallObj[0], |
|
|
|
year: smallObj[0], |
|
|
|
month: smallObj[1], |
|
|
|
month: smallObj[1], |
|
|
@ -111309,10 +111294,29 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year |
|
|
|
_clearTitle: function () { |
|
|
|
_clearTitle: function () { |
|
|
|
this.setTitle(""); |
|
|
|
this.setTitle(""); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
_checkValid: function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BI.Bubbles.hide("error"); |
|
|
|
|
|
|
|
var smallDate = self.left.getKey(), bigDate = self.right.getKey(); |
|
|
|
|
|
|
|
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) { |
|
|
|
|
|
|
|
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")); |
|
|
|
|
|
|
|
self.element.addClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, { |
|
|
|
|
|
|
|
offsetStyle: "center" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self._clearTitle(); |
|
|
|
|
|
|
|
self.element.removeClass(self.constants.timeErrorCls); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
setValue: function (date) { |
|
|
|
setValue: function (date) { |
|
|
|
date = date || {}; |
|
|
|
date = date || {}; |
|
|
|
this.left.setValue(date.start); |
|
|
|
this.left.setValue(date.start); |
|
|
|
this.right.setValue(date.end); |
|
|
|
this.right.setValue(date.end); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._checkValid(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return {start: this.left.getValue(), end: this.right.getValue()}; |
|
|
|
return {start: this.left.getValue(), end: this.right.getValue()}; |
|
|
|