Browse Source

merge

master
windy 7 years ago
parent
commit
3d94090e4a
  1. 8
      bi/core.js
  2. 201
      bi/widget.js
  3. 209
      dist/bundle.js
  4. 8
      dist/core.js
  5. 3
      dist/demo.js
  6. 201
      dist/widget.js
  7. 8
      src/core/proto/date.js
  8. 34
      src/widget/multidate/abstract.multidate.datepane.js
  9. 67
      src/widget/multidate/multidate.combo.js
  10. 8
      src/widget/multidate/multidate.day.js
  11. 10
      src/widget/multidate/multidate.month.js
  12. 56
      src/widget/multidate/multidate.popup.js
  13. 10
      src/widget/multidate/multidate.quarter.js
  14. 6
      src/widget/multidate/multidate.week.js
  15. 10
      src/widget/multidate/multidate.year.js

8
bi/core.js

@ -6161,6 +6161,14 @@ Date.prototype.getMonthDays = function (month) {
} }
}; };
/**
* 获取每月的最后一天
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */ /** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () { Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);

201
bi/widget.js

@ -6570,39 +6570,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var valueObject = this.getValue(); var valueObject = this.getValue();
var type = valueObject.type, value = valueObject.value; var type = valueObject.type, value = valueObject.value;
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value); return new Date().getOffsetDate(-1 * value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value); return new Date().getOffsetDate(value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date(); return new Date();
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value); return new Date().getBeforeMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value); return new Date().getAfterMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1); return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate()); return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value); return new Date().getBeforeMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value); return new Date().getAfterMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate(); return new Date().getQuarterStartDate();
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate(); return new Date().getQuarterEndDate();
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value); return new Date().getOffsetDate(-7 * value);
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value); return new Date().getOffsetDate(7 * value);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1); return new Date(new Date().getFullYear(), 0, 1);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31); return new Date(new Date().getFullYear(), 11, 31);
} }
} }
@ -6793,23 +6793,23 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
type = v.type type = v.type
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.changeIcon.setVisible(true); this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30; this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.resize(); this.comboWrapper.resize();
@ -6855,6 +6855,39 @@ BI.extend(BI.MultiDateCombo, {
MULTI_DATE_WEEK_CARD: 5, MULTI_DATE_WEEK_CARD: 5,
MULTI_DATE_DAY_CARD: 6 MULTI_DATE_DAY_CARD: 6
}); });
BI.extend(BI.MultiDateCombo, {
DATE_TYPE: {
MULTI_DATE_YEAR_PREV: 1,
MULTI_DATE_YEAR_AFTER: 2,
MULTI_DATE_YEAR_BEGIN: 3,
MULTI_DATE_YEAR_END: 4,
MULTI_DATE_MONTH_PREV: 5,
MULTI_DATE_MONTH_AFTER: 6,
MULTI_DATE_MONTH_BEGIN: 7,
MULTI_DATE_MONTH_END: 8,
MULTI_DATE_QUARTER_PREV: 9,
MULTI_DATE_QUARTER_AFTER: 10,
MULTI_DATE_QUARTER_BEGIN: 11,
MULTI_DATE_QUARTER_END: 12,
MULTI_DATE_WEEK_PREV: 13,
MULTI_DATE_WEEK_AFTER: 14,
MULTI_DATE_DAY_PREV: 15,
MULTI_DATE_DAY_AFTER: 16,
MULTI_DATE_DAY_TODAY: 17,
MULTI_DATE_PARAM: 18,
MULTI_DATE_CALENDAR: 19,
YEAR_QUARTER: 20,
YEAR_MONTH: 21,
YEAR_WEEK: 22,
YEAR_DAY: 23,
MONTH_WEEK: 24,
MONTH_DAY: 25,
YEAR: 26,
SAME_PERIOD: 27,
LAST_SAME_PERIOD: 28
}
});
/** /**
* 普通控件 * 普通控件
* *
@ -6878,22 +6911,22 @@ BI.DayCard = BI.inherit(BI.MultiDateCard, {
isEditorExist: true, isEditorExist: true,
selected: true, selected: true,
text: BI.i18nText("BI-Multi_Date_Day_Prev"), text: BI.i18nText("BI-Multi_Date_Day_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Day_Next"), text: BI.i18nText("BI-Multi_Date_Day_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY,
text: BI.i18nText("BI-Multi_Date_Today") text: BI.i18nText("BI-Multi_Date_Today")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_DAY_PREV return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
} }
}); });
BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -6919,28 +6952,28 @@ BI.MonthCard = BI.inherit(BI.MultiDateCard, {
return [{ return [{
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV,
text: BI.i18nText("BI-Multi_Date_Month_Prev") text: BI.i18nText("BI-Multi_Date_Month_Prev")
}, },
{ {
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER,
text: BI.i18nText("BI-Multi_Date_Month_Next") text: BI.i18nText("BI-Multi_Date_Month_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_Begin") text: BI.i18nText("BI-Multi_Date_Month_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_End") text: BI.i18nText("BI-Multi_Date_Month_End")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV;
} }
}); });
BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7166,52 +7199,52 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
var self = this, date; var self = this, date;
var type, value; var type, value;
if (BI.isNotNull(v)) { if (BI.isNotNull(v)) {
type = v.type || BICst.DATE_TYPE.MULTI_DATE_CALENDAR; type = v.type || BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_CALENDAR;
value = v.value; value = v.value;
if (BI.isNull(value)) { if (BI.isNull(value)) {
value = v; value = v;
} }
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
this.dateTab.setSelect(BICst.MULTI_DATE_YEAR_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YEAR_CARD);
this.year.setValue({type: type, value: value}); this.year.setValue({type: type, value: value});
this.cur = BICst.MULTI_DATE_YEAR_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_YEAR_CARD;
self._setInnerValue(this.year); self._setInnerValue(this.year);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
this.dateTab.setSelect(BICst.MULTI_DATE_QUARTER_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD);
this.cur = BICst.MULTI_DATE_QUARTER_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD;
this.quarter.setValue({type: type, value: value}); this.quarter.setValue({type: type, value: value});
self._setInnerValue(this.quarter); self._setInnerValue(this.quarter);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
this.dateTab.setSelect(BICst.MULTI_DATE_MONTH_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_MONTH_CARD);
this.cur = BICst.MULTI_DATE_MONTH_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_MONTH_CARD;
this.month.setValue({type: type, value: value}); this.month.setValue({type: type, value: value});
self._setInnerValue(this.month); self._setInnerValue(this.month);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
this.dateTab.setSelect(BICst.MULTI_DATE_WEEK_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_WEEK_CARD);
this.cur = BICst.MULTI_DATE_WEEK_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_WEEK_CARD;
this.week.setValue({type: type, value: value}); this.week.setValue({type: type, value: value});
self._setInnerValue(this.week); self._setInnerValue(this.week);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.dateTab.setSelect(BICst.MULTI_DATE_DAY_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_DAY_CARD);
this.cur = BICst.MULTI_DATE_DAY_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_DAY_CARD;
this.day.setValue({type: type, value: value}); this.day.setValue({type: type, value: value});
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
@ -7278,29 +7311,29 @@ BI.QuarterCard = BI.inherit(BI.MultiDateCard, {
dateConfig: function () { dateConfig: function () {
return [{ return [{
selected: true, selected: true,
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Prev") text: BI.i18nText("BI-Multi_Date_Quarter_Prev")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Next") text: BI.i18nText("BI-Multi_Date_Quarter_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_Begin") text: BI.i18nText("BI-Multi_Date_Quarter_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_End") text: BI.i18nText("BI-Multi_Date_Quarter_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV;
} }
}); });
BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7453,17 +7486,17 @@ BI.WeekCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Prev"), text: BI.i18nText("BI-Multi_Date_Week_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Next"), text: BI.i18nText("BI-Multi_Date_Week_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV;
} }
}); });
BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7490,27 +7523,27 @@ BI.YearCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Prev"), text: BI.i18nText("BI-Multi_Date_Year_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Next"), text: BI.i18nText("BI-Multi_Date_Year_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN,
text: BI.i18nText("BI-Multi_Date_Year_Begin") text: BI.i18nText("BI-Multi_Date_Year_Begin")
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END,
text: BI.i18nText("BI-Multi_Date_Year_End") text: BI.i18nText("BI-Multi_Date_Year_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV;
} }
}); });
BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE";

209
dist/bundle.js vendored

@ -23744,6 +23744,14 @@ Date.prototype.getMonthDays = function (month) {
} }
}; };
/**
* 获取每月的最后一天
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */ /** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () { Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
@ -83646,39 +83654,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var valueObject = this.getValue(); var valueObject = this.getValue();
var type = valueObject.type, value = valueObject.value; var type = valueObject.type, value = valueObject.value;
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value); return new Date().getOffsetDate(-1 * value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value); return new Date().getOffsetDate(value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date(); return new Date();
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value); return new Date().getBeforeMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value); return new Date().getAfterMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1); return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate()); return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value); return new Date().getBeforeMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value); return new Date().getAfterMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate(); return new Date().getQuarterStartDate();
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate(); return new Date().getQuarterEndDate();
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value); return new Date().getOffsetDate(-7 * value);
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value); return new Date().getOffsetDate(7 * value);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1); return new Date(new Date().getFullYear(), 0, 1);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31); return new Date(new Date().getFullYear(), 11, 31);
} }
} }
@ -83869,23 +83877,23 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
type = v.type type = v.type
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.changeIcon.setVisible(true); this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30; this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.resize(); this.comboWrapper.resize();
@ -83931,6 +83939,39 @@ BI.extend(BI.MultiDateCombo, {
MULTI_DATE_WEEK_CARD: 5, MULTI_DATE_WEEK_CARD: 5,
MULTI_DATE_DAY_CARD: 6 MULTI_DATE_DAY_CARD: 6
}); });
BI.extend(BI.MultiDateCombo, {
DATE_TYPE: {
MULTI_DATE_YEAR_PREV: 1,
MULTI_DATE_YEAR_AFTER: 2,
MULTI_DATE_YEAR_BEGIN: 3,
MULTI_DATE_YEAR_END: 4,
MULTI_DATE_MONTH_PREV: 5,
MULTI_DATE_MONTH_AFTER: 6,
MULTI_DATE_MONTH_BEGIN: 7,
MULTI_DATE_MONTH_END: 8,
MULTI_DATE_QUARTER_PREV: 9,
MULTI_DATE_QUARTER_AFTER: 10,
MULTI_DATE_QUARTER_BEGIN: 11,
MULTI_DATE_QUARTER_END: 12,
MULTI_DATE_WEEK_PREV: 13,
MULTI_DATE_WEEK_AFTER: 14,
MULTI_DATE_DAY_PREV: 15,
MULTI_DATE_DAY_AFTER: 16,
MULTI_DATE_DAY_TODAY: 17,
MULTI_DATE_PARAM: 18,
MULTI_DATE_CALENDAR: 19,
YEAR_QUARTER: 20,
YEAR_MONTH: 21,
YEAR_WEEK: 22,
YEAR_DAY: 23,
MONTH_WEEK: 24,
MONTH_DAY: 25,
YEAR: 26,
SAME_PERIOD: 27,
LAST_SAME_PERIOD: 28
}
});
/** /**
* 普通控件 * 普通控件
* *
@ -83954,22 +83995,22 @@ BI.DayCard = BI.inherit(BI.MultiDateCard, {
isEditorExist: true, isEditorExist: true,
selected: true, selected: true,
text: BI.i18nText("BI-Multi_Date_Day_Prev"), text: BI.i18nText("BI-Multi_Date_Day_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Day_Next"), text: BI.i18nText("BI-Multi_Date_Day_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY,
text: BI.i18nText("BI-Multi_Date_Today") text: BI.i18nText("BI-Multi_Date_Today")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_DAY_PREV return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
} }
}); });
BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -83995,28 +84036,28 @@ BI.MonthCard = BI.inherit(BI.MultiDateCard, {
return [{ return [{
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV,
text: BI.i18nText("BI-Multi_Date_Month_Prev") text: BI.i18nText("BI-Multi_Date_Month_Prev")
}, },
{ {
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER,
text: BI.i18nText("BI-Multi_Date_Month_Next") text: BI.i18nText("BI-Multi_Date_Month_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_Begin") text: BI.i18nText("BI-Multi_Date_Month_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_End") text: BI.i18nText("BI-Multi_Date_Month_End")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV;
} }
}); });
BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -84242,52 +84283,52 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
var self = this, date; var self = this, date;
var type, value; var type, value;
if (BI.isNotNull(v)) { if (BI.isNotNull(v)) {
type = v.type || BICst.DATE_TYPE.MULTI_DATE_CALENDAR; type = v.type || BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_CALENDAR;
value = v.value; value = v.value;
if (BI.isNull(value)) { if (BI.isNull(value)) {
value = v; value = v;
} }
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
this.dateTab.setSelect(BICst.MULTI_DATE_YEAR_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YEAR_CARD);
this.year.setValue({type: type, value: value}); this.year.setValue({type: type, value: value});
this.cur = BICst.MULTI_DATE_YEAR_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_YEAR_CARD;
self._setInnerValue(this.year); self._setInnerValue(this.year);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
this.dateTab.setSelect(BICst.MULTI_DATE_QUARTER_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD);
this.cur = BICst.MULTI_DATE_QUARTER_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD;
this.quarter.setValue({type: type, value: value}); this.quarter.setValue({type: type, value: value});
self._setInnerValue(this.quarter); self._setInnerValue(this.quarter);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
this.dateTab.setSelect(BICst.MULTI_DATE_MONTH_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_MONTH_CARD);
this.cur = BICst.MULTI_DATE_MONTH_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_MONTH_CARD;
this.month.setValue({type: type, value: value}); this.month.setValue({type: type, value: value});
self._setInnerValue(this.month); self._setInnerValue(this.month);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
this.dateTab.setSelect(BICst.MULTI_DATE_WEEK_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_WEEK_CARD);
this.cur = BICst.MULTI_DATE_WEEK_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_WEEK_CARD;
this.week.setValue({type: type, value: value}); this.week.setValue({type: type, value: value});
self._setInnerValue(this.week); self._setInnerValue(this.week);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.dateTab.setSelect(BICst.MULTI_DATE_DAY_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_DAY_CARD);
this.cur = BICst.MULTI_DATE_DAY_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_DAY_CARD;
this.day.setValue({type: type, value: value}); this.day.setValue({type: type, value: value});
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
@ -84354,29 +84395,29 @@ BI.QuarterCard = BI.inherit(BI.MultiDateCard, {
dateConfig: function () { dateConfig: function () {
return [{ return [{
selected: true, selected: true,
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Prev") text: BI.i18nText("BI-Multi_Date_Quarter_Prev")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Next") text: BI.i18nText("BI-Multi_Date_Quarter_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_Begin") text: BI.i18nText("BI-Multi_Date_Quarter_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_End") text: BI.i18nText("BI-Multi_Date_Quarter_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV;
} }
}); });
BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -84529,17 +84570,17 @@ BI.WeekCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Prev"), text: BI.i18nText("BI-Multi_Date_Week_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Next"), text: BI.i18nText("BI-Multi_Date_Week_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV;
} }
}); });
BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -84566,27 +84607,27 @@ BI.YearCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Prev"), text: BI.i18nText("BI-Multi_Date_Year_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Next"), text: BI.i18nText("BI-Multi_Date_Year_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN,
text: BI.i18nText("BI-Multi_Date_Year_Begin") text: BI.i18nText("BI-Multi_Date_Year_Begin")
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END,
text: BI.i18nText("BI-Multi_Date_Year_End") text: BI.i18nText("BI-Multi_Date_Year_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV;
} }
}); });
BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE";

8
dist/core.js vendored

@ -23693,6 +23693,14 @@ Date.prototype.getMonthDays = function (month) {
} }
}; };
/**
* 获取每月的最后一天
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */ /** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () { Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);

3
dist/demo.js vendored

@ -7691,8 +7691,7 @@ Demo.FileManager = BI.inherit(BI.Widget, {
}, },
height: 24, height: 24,
width: 150, width: 150,
errorText: "hahah", errorText: "hahah"
step: 0.5
}); });
filemanager.on(BI.FineTuningNumberEditor.EVENT_CHANGE, function () { filemanager.on(BI.FineTuningNumberEditor.EVENT_CHANGE, function () {
if(BI.parseFloat(this.getValue()) < 1){ if(BI.parseFloat(this.getValue()) < 1){

201
dist/widget.js vendored

@ -6570,39 +6570,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var valueObject = this.getValue(); var valueObject = this.getValue();
var type = valueObject.type, value = valueObject.value; var type = valueObject.type, value = valueObject.value;
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value); return new Date().getOffsetDate(-1 * value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value); return new Date().getOffsetDate(value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date(); return new Date();
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value); return new Date().getBeforeMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value); return new Date().getAfterMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1); return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate()); return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value); return new Date().getBeforeMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value); return new Date().getAfterMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate(); return new Date().getQuarterStartDate();
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate(); return new Date().getQuarterEndDate();
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value); return new Date().getOffsetDate(-7 * value);
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value); return new Date().getOffsetDate(7 * value);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1); return new Date(new Date().getFullYear(), 0, 1);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31); return new Date(new Date().getFullYear(), 11, 31);
} }
} }
@ -6793,23 +6793,23 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
type = v.type type = v.type
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.changeIcon.setVisible(true); this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30; this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.resize(); this.comboWrapper.resize();
@ -6855,6 +6855,39 @@ BI.extend(BI.MultiDateCombo, {
MULTI_DATE_WEEK_CARD: 5, MULTI_DATE_WEEK_CARD: 5,
MULTI_DATE_DAY_CARD: 6 MULTI_DATE_DAY_CARD: 6
}); });
BI.extend(BI.MultiDateCombo, {
DATE_TYPE: {
MULTI_DATE_YEAR_PREV: 1,
MULTI_DATE_YEAR_AFTER: 2,
MULTI_DATE_YEAR_BEGIN: 3,
MULTI_DATE_YEAR_END: 4,
MULTI_DATE_MONTH_PREV: 5,
MULTI_DATE_MONTH_AFTER: 6,
MULTI_DATE_MONTH_BEGIN: 7,
MULTI_DATE_MONTH_END: 8,
MULTI_DATE_QUARTER_PREV: 9,
MULTI_DATE_QUARTER_AFTER: 10,
MULTI_DATE_QUARTER_BEGIN: 11,
MULTI_DATE_QUARTER_END: 12,
MULTI_DATE_WEEK_PREV: 13,
MULTI_DATE_WEEK_AFTER: 14,
MULTI_DATE_DAY_PREV: 15,
MULTI_DATE_DAY_AFTER: 16,
MULTI_DATE_DAY_TODAY: 17,
MULTI_DATE_PARAM: 18,
MULTI_DATE_CALENDAR: 19,
YEAR_QUARTER: 20,
YEAR_MONTH: 21,
YEAR_WEEK: 22,
YEAR_DAY: 23,
MONTH_WEEK: 24,
MONTH_DAY: 25,
YEAR: 26,
SAME_PERIOD: 27,
LAST_SAME_PERIOD: 28
}
});
/** /**
* 普通控件 * 普通控件
* *
@ -6878,22 +6911,22 @@ BI.DayCard = BI.inherit(BI.MultiDateCard, {
isEditorExist: true, isEditorExist: true,
selected: true, selected: true,
text: BI.i18nText("BI-Multi_Date_Day_Prev"), text: BI.i18nText("BI-Multi_Date_Day_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Day_Next"), text: BI.i18nText("BI-Multi_Date_Day_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY,
text: BI.i18nText("BI-Multi_Date_Today") text: BI.i18nText("BI-Multi_Date_Today")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_DAY_PREV return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
} }
}); });
BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -6919,28 +6952,28 @@ BI.MonthCard = BI.inherit(BI.MultiDateCard, {
return [{ return [{
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV,
text: BI.i18nText("BI-Multi_Date_Month_Prev") text: BI.i18nText("BI-Multi_Date_Month_Prev")
}, },
{ {
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER,
text: BI.i18nText("BI-Multi_Date_Month_Next") text: BI.i18nText("BI-Multi_Date_Month_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_Begin") text: BI.i18nText("BI-Multi_Date_Month_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_End") text: BI.i18nText("BI-Multi_Date_Month_End")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV;
} }
}); });
BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7166,52 +7199,52 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
var self = this, date; var self = this, date;
var type, value; var type, value;
if (BI.isNotNull(v)) { if (BI.isNotNull(v)) {
type = v.type || BICst.DATE_TYPE.MULTI_DATE_CALENDAR; type = v.type || BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_CALENDAR;
value = v.value; value = v.value;
if (BI.isNull(value)) { if (BI.isNull(value)) {
value = v; value = v;
} }
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
this.dateTab.setSelect(BICst.MULTI_DATE_YEAR_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YEAR_CARD);
this.year.setValue({type: type, value: value}); this.year.setValue({type: type, value: value});
this.cur = BICst.MULTI_DATE_YEAR_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_YEAR_CARD;
self._setInnerValue(this.year); self._setInnerValue(this.year);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
this.dateTab.setSelect(BICst.MULTI_DATE_QUARTER_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD);
this.cur = BICst.MULTI_DATE_QUARTER_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD;
this.quarter.setValue({type: type, value: value}); this.quarter.setValue({type: type, value: value});
self._setInnerValue(this.quarter); self._setInnerValue(this.quarter);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
this.dateTab.setSelect(BICst.MULTI_DATE_MONTH_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_MONTH_CARD);
this.cur = BICst.MULTI_DATE_MONTH_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_MONTH_CARD;
this.month.setValue({type: type, value: value}); this.month.setValue({type: type, value: value});
self._setInnerValue(this.month); self._setInnerValue(this.month);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
this.dateTab.setSelect(BICst.MULTI_DATE_WEEK_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_WEEK_CARD);
this.cur = BICst.MULTI_DATE_WEEK_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_WEEK_CARD;
this.week.setValue({type: type, value: value}); this.week.setValue({type: type, value: value});
self._setInnerValue(this.week); self._setInnerValue(this.week);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.dateTab.setSelect(BICst.MULTI_DATE_DAY_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_DAY_CARD);
this.cur = BICst.MULTI_DATE_DAY_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_DAY_CARD;
this.day.setValue({type: type, value: value}); this.day.setValue({type: type, value: value});
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
@ -7278,29 +7311,29 @@ BI.QuarterCard = BI.inherit(BI.MultiDateCard, {
dateConfig: function () { dateConfig: function () {
return [{ return [{
selected: true, selected: true,
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Prev") text: BI.i18nText("BI-Multi_Date_Quarter_Prev")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Next") text: BI.i18nText("BI-Multi_Date_Quarter_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_Begin") text: BI.i18nText("BI-Multi_Date_Quarter_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_End") text: BI.i18nText("BI-Multi_Date_Quarter_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV;
} }
}); });
BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7453,17 +7486,17 @@ BI.WeekCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Prev"), text: BI.i18nText("BI-Multi_Date_Week_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Next"), text: BI.i18nText("BI-Multi_Date_Week_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV;
} }
}); });
BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE";
@ -7490,27 +7523,27 @@ BI.YearCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Prev"), text: BI.i18nText("BI-Multi_Date_Year_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Next"), text: BI.i18nText("BI-Multi_Date_Year_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN,
text: BI.i18nText("BI-Multi_Date_Year_Begin") text: BI.i18nText("BI-Multi_Date_Year_Begin")
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END,
text: BI.i18nText("BI-Multi_Date_Year_End") text: BI.i18nText("BI-Multi_Date_Year_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV;
} }
}); });
BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE";

8
src/core/proto/date.js

@ -86,6 +86,14 @@ Date.prototype.getMonthDays = function (month) {
} }
}; };
/**
* 获取每月的最后一天
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */ /** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () { Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);

34
src/widget/multidate/abstract.multidate.datepane.js

@ -111,39 +111,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var valueObject = this.getValue(); var valueObject = this.getValue();
var type = valueObject.type, value = valueObject.value; var type = valueObject.type, value = valueObject.value;
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value); return new Date().getOffsetDate(-1 * value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value); return new Date().getOffsetDate(value);
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date(); return new Date();
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value); return new Date().getBeforeMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value); return new Date().getAfterMultiMonth(value);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1); return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate()); return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value); return new Date().getBeforeMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value); return new Date().getAfterMulQuarter(value);
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate(); return new Date().getQuarterStartDate();
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate(); return new Date().getQuarterEndDate();
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value); return new Date().getOffsetDate(-7 * value);
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value); return new Date().getOffsetDate(7 * value);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate()); return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1); return new Date(new Date().getFullYear(), 0, 1);
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31); return new Date(new Date().getFullYear(), 11, 31);
} }
} }

67
src/widget/multidate/multidate.combo.js

@ -183,23 +183,23 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
type = v.type type = v.type
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.changeIcon.setVisible(true); this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30; this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.resize(); this.comboWrapper.resize();
@ -245,3 +245,36 @@ BI.extend(BI.MultiDateCombo, {
MULTI_DATE_WEEK_CARD: 5, MULTI_DATE_WEEK_CARD: 5,
MULTI_DATE_DAY_CARD: 6 MULTI_DATE_DAY_CARD: 6
}); });
BI.extend(BI.MultiDateCombo, {
DATE_TYPE: {
MULTI_DATE_YEAR_PREV: 1,
MULTI_DATE_YEAR_AFTER: 2,
MULTI_DATE_YEAR_BEGIN: 3,
MULTI_DATE_YEAR_END: 4,
MULTI_DATE_MONTH_PREV: 5,
MULTI_DATE_MONTH_AFTER: 6,
MULTI_DATE_MONTH_BEGIN: 7,
MULTI_DATE_MONTH_END: 8,
MULTI_DATE_QUARTER_PREV: 9,
MULTI_DATE_QUARTER_AFTER: 10,
MULTI_DATE_QUARTER_BEGIN: 11,
MULTI_DATE_QUARTER_END: 12,
MULTI_DATE_WEEK_PREV: 13,
MULTI_DATE_WEEK_AFTER: 14,
MULTI_DATE_DAY_PREV: 15,
MULTI_DATE_DAY_AFTER: 16,
MULTI_DATE_DAY_TODAY: 17,
MULTI_DATE_PARAM: 18,
MULTI_DATE_CALENDAR: 19,
YEAR_QUARTER: 20,
YEAR_MONTH: 21,
YEAR_WEEK: 22,
YEAR_DAY: 23,
MONTH_WEEK: 24,
MONTH_DAY: 25,
YEAR: 26,
SAME_PERIOD: 27,
LAST_SAME_PERIOD: 28
}
});

8
src/widget/multidate/multidate.day.js

@ -21,22 +21,22 @@ BI.DayCard = BI.inherit(BI.MultiDateCard, {
isEditorExist: true, isEditorExist: true,
selected: true, selected: true,
text: BI.i18nText("BI-Multi_Date_Day_Prev"), text: BI.i18nText("BI-Multi_Date_Day_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Day_Next"), text: BI.i18nText("BI-Multi_Date_Day_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY,
text: BI.i18nText("BI-Multi_Date_Today") text: BI.i18nText("BI-Multi_Date_Today")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_DAY_PREV return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV
} }
}); });
BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.DayCard.EVENT_CHANGE = "EVENT_CHANGE";

10
src/widget/multidate/multidate.month.js

@ -19,28 +19,28 @@ BI.MonthCard = BI.inherit(BI.MultiDateCard, {
return [{ return [{
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV,
text: BI.i18nText("BI-Multi_Date_Month_Prev") text: BI.i18nText("BI-Multi_Date_Month_Prev")
}, },
{ {
isEditorExist: true, isEditorExist: true,
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER,
text: BI.i18nText("BI-Multi_Date_Month_Next") text: BI.i18nText("BI-Multi_Date_Month_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_Begin") text: BI.i18nText("BI-Multi_Date_Month_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_MONTH_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Month_End") text: BI.i18nText("BI-Multi_Date_Month_End")
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV;
} }
}); });
BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.MonthCard.EVENT_CHANGE = "EVENT_CHANGE";

56
src/widget/multidate/multidate.popup.js

@ -219,52 +219,52 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
var self = this, date; var self = this, date;
var type, value; var type, value;
if (BI.isNotNull(v)) { if (BI.isNotNull(v)) {
type = v.type || BICst.DATE_TYPE.MULTI_DATE_CALENDAR; type = v.type || BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_CALENDAR;
value = v.value; value = v.value;
if (BI.isNull(value)) { if (BI.isNull(value)) {
value = v; value = v;
} }
} }
switch (type) { switch (type) {
case BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_YEAR_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
this.dateTab.setSelect(BICst.MULTI_DATE_YEAR_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YEAR_CARD);
this.year.setValue({type: type, value: value}); this.year.setValue({type: type, value: value});
this.cur = BICst.MULTI_DATE_YEAR_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_YEAR_CARD;
self._setInnerValue(this.year); self._setInnerValue(this.year);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_QUARTER_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
this.dateTab.setSelect(BICst.MULTI_DATE_QUARTER_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD);
this.cur = BICst.MULTI_DATE_QUARTER_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_QUARTER_CARD;
this.quarter.setValue({type: type, value: value}); this.quarter.setValue({type: type, value: value});
self._setInnerValue(this.quarter); self._setInnerValue(this.quarter);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_MONTH_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_BEGIN: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
case BICst.DATE_TYPE.MULTI_DATE_MONTH_END: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
this.dateTab.setSelect(BICst.MULTI_DATE_MONTH_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_MONTH_CARD);
this.cur = BICst.MULTI_DATE_MONTH_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_MONTH_CARD;
this.month.setValue({type: type, value: value}); this.month.setValue({type: type, value: value});
self._setInnerValue(this.month); self._setInnerValue(this.month);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
case BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
this.dateTab.setSelect(BICst.MULTI_DATE_WEEK_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_WEEK_CARD);
this.cur = BICst.MULTI_DATE_WEEK_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_WEEK_CARD;
this.week.setValue({type: type, value: value}); this.week.setValue({type: type, value: value});
self._setInnerValue(this.week); self._setInnerValue(this.week);
break; break;
case BICst.DATE_TYPE.MULTI_DATE_DAY_PREV: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
case BICst.DATE_TYPE.MULTI_DATE_DAY_AFTER: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
case BICst.DATE_TYPE.MULTI_DATE_DAY_TODAY: case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
this.dateTab.setSelect(BICst.MULTI_DATE_DAY_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_DAY_CARD);
this.cur = BICst.MULTI_DATE_DAY_CARD; this.cur = BI.MultiDateCombo.MULTI_DATE_DAY_CARD;
this.day.setValue({type: type, value: value}); this.day.setValue({type: type, value: value});
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;

10
src/widget/multidate/multidate.quarter.js

@ -19,29 +19,29 @@ BI.QuarterCard = BI.inherit(BI.MultiDateCard, {
dateConfig: function () { dateConfig: function () {
return [{ return [{
selected: true, selected: true,
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Prev") text: BI.i18nText("BI-Multi_Date_Quarter_Prev")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_AFTER, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Quarter_Next") text: BI.i18nText("BI-Multi_Date_Quarter_Next")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_Begin") text: BI.i18nText("BI-Multi_Date_Quarter_Begin")
}, },
{ {
value: BICst.DATE_TYPE.MULTI_DATE_QUARTER_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END,
isEditorExist: false, isEditorExist: false,
text: BI.i18nText("BI-Multi_Date_Quarter_End") text: BI.i18nText("BI-Multi_Date_Quarter_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_QUARTER_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV;
} }
}); });
BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.QuarterCard.EVENT_CHANGE = "EVENT_CHANGE";

6
src/widget/multidate/multidate.week.js

@ -20,17 +20,17 @@ BI.WeekCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Prev"), text: BI.i18nText("BI-Multi_Date_Week_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Week_Next"), text: BI.i18nText("BI-Multi_Date_Week_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_WEEK_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER
}]; }];
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_WEEK_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV;
} }
}); });
BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.WeekCard.EVENT_CHANGE = "EVENT_CHANGE";

10
src/widget/multidate/multidate.year.js

@ -20,27 +20,27 @@ BI.YearCard = BI.inherit(BI.MultiDateCard, {
selected: true, selected: true,
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Prev"), text: BI.i18nText("BI-Multi_Date_Year_Prev"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV
}, },
{ {
isEditorExist: true, isEditorExist: true,
text: BI.i18nText("BI-Multi_Date_Year_Next"), text: BI.i18nText("BI-Multi_Date_Year_Next"),
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_AFTER value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_BEGIN, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN,
text: BI.i18nText("BI-Multi_Date_Year_Begin") text: BI.i18nText("BI-Multi_Date_Year_Begin")
}, },
{ {
isEditorExist: false, isEditorExist: false,
value: BICst.DATE_TYPE.MULTI_DATE_YEAR_END, value: BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END,
text: BI.i18nText("BI-Multi_Date_Year_End") text: BI.i18nText("BI-Multi_Date_Year_End")
}] }]
}, },
defaultSelectedItem: function () { defaultSelectedItem: function () {
return BICst.DATE_TYPE.MULTI_DATE_YEAR_PREV; return BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV;
} }
}); });
BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearCard.EVENT_CHANGE = "EVENT_CHANGE";

Loading…
Cancel
Save