Browse Source

Merge remote-tracking branch 'origin/master'

master
guy 7 years ago
parent
commit
44d55cdf9e
  1. 2
      demo/js/widget/multiselect/demo.multi_select_combo.js
  2. 2
      demo/js/widget/timeinterval/demo.time_interval.js
  3. 2
      demo/version.js
  4. 30
      dist/_fineui.min.js
  5. 121
      dist/bundle.js
  6. 28
      dist/bundle.min.js
  7. 4
      dist/case.js
  8. 2
      dist/config.js
  9. 4
      dist/demo.js
  10. 30
      dist/fineui.min.js
  11. 115
      dist/widget.js
  12. 528
      package-lock.json
  13. 2
      public/js/index.js
  14. 4
      src/case/combo/bubblecombo/popup.bubble.js
  15. 4
      src/widget/date/calendar/picker.date.js
  16. 41
      src/widget/dynamicdate/dynamicdate.trigger.js
  17. 45
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  18. 2
      src/widget/multiselect/multiselect..insert.combo.js
  19. 11
      src/widget/yearmonth/combo.yearmonth.js
  20. 12
      src/widget/yearquarter/combo.yearquarter.js
  21. 2
      ui/js/index.js

2
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -9,7 +9,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_combo",
type: "bi.multi_select_insert_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
value: {

2
demo/js/widget/timeinterval/demo.time_interval.js

@ -28,7 +28,7 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
type: 1,
value: {
year: 2018,
month: 0,
month: 1,
day: 12
}
}

2
demo/version.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",

30
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

121
dist/bundle.js vendored

@ -77537,7 +77537,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}]
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
});
},
_init: function () {
@ -77547,7 +77547,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this;
var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) {
BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt);
}else{
@ -87722,7 +87722,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25
});
this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) {
if (self._month === 1) {
self.setValue({
year: self.year.getValue() - 1,
month: 12
@ -87746,7 +87746,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
});
this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) {
if (self._month === 12) {
self.setValue({
year: self.year.getValue() + 1,
month: 0
@ -91313,9 +91313,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -91328,30 +91329,40 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
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.year)) {
if(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) && 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"));
if(BI.isNotNull(obj.quarter)) {
if(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) && 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"));
if(BI.isNotNull(obj.month)) {
if(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) && 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"));
if(BI.isNotNull(obj.week)) {
if(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) && 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"));
if(BI.isNotNull(obj.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -91387,7 +91398,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
this.editor.setValue("");
this.setTitle("");
} else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day;
var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
this.setTitle(dateStr);
@ -92208,9 +92219,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -92222,25 +92234,41 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) {
var value = "";
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);
var endText = "";
if(BI.isNotNull(obj.year)) {
if(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) && 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.quarter)) {
if(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) && 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.month)) {
if(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) && 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.week)) {
if(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) && 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.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -97169,7 +97197,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
// 标记正在请求数据
this.requesting = false;
@ -108823,6 +108851,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger",
min: o.min,
@ -108846,11 +108875,17 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
});
@ -109778,6 +109813,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger",
min: o.min,
@ -109797,10 +109833,19 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({
type: "bi.combo",
@ -112411,7 +112456,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",

28
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/case.js vendored

@ -5087,7 +5087,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}]
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
});
},
_init: function () {
@ -5097,7 +5097,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this;
var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) {
BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt);
}else{

2
dist/config.js vendored

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",

4
dist/demo.js vendored

@ -12712,7 +12712,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_combo",
type: "bi.multi_select_insert_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
value: {
@ -14304,7 +14304,7 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
type: 1,
value: {
year: 2018,
month: 0,
month: 1,
day: 12
}
}

30
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

115
dist/widget.js vendored

@ -570,7 +570,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25
});
this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) {
if (self._month === 1) {
self.setValue({
year: self.year.getValue() - 1,
month: 12
@ -594,7 +594,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
});
this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) {
if (self._month === 12) {
self.setValue({
year: self.year.getValue() + 1,
month: 0
@ -4161,9 +4161,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -4176,30 +4177,40 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
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.year)) {
if(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) && 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"));
if(BI.isNotNull(obj.quarter)) {
if(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) && 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"));
if(BI.isNotNull(obj.month)) {
if(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) && 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"));
if(BI.isNotNull(obj.week)) {
if(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) && 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"));
if(BI.isNotNull(obj.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -4235,7 +4246,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
this.editor.setValue("");
this.setTitle("");
} else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day;
var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
this.setTitle(dateStr);
@ -5056,9 +5067,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -5070,25 +5082,41 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) {
var value = "";
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);
var endText = "";
if(BI.isNotNull(obj.year)) {
if(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) && 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.quarter)) {
if(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) && 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.month)) {
if(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) && 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.week)) {
if(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) && 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.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -10017,7 +10045,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
// 标记正在请求数据
this.requesting = false;
@ -21671,6 +21699,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger",
min: o.min,
@ -21694,11 +21723,17 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
});
@ -22626,6 +22661,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger",
min: o.min,
@ -22645,10 +22681,19 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({
type: "bi.combo",

528
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
public/js/index.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",

4
src/case/combo/bubblecombo/popup.bubble.js

@ -82,7 +82,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}]
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
});
},
_init: function () {
@ -92,7 +92,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this;
var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) {
BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt);
}else{

4
src/widget/date/calendar/picker.date.js

@ -26,7 +26,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25
});
this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) {
if (self._month === 1) {
self.setValue({
year: self.year.getValue() - 1,
month: 12
@ -50,7 +50,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
});
this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) {
if (self._month === 12) {
self.setValue({
year: self.year.getValue() + 1,
month: 0

41
src/widget/dynamicdate/dynamicdate.trigger.js

@ -133,9 +133,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -148,30 +149,40 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
var endText = "";
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.year)) {
if(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) && 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"));
if(BI.isNotNull(obj.quarter)) {
if(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) && 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"));
if(BI.isNotNull(obj.month)) {
if(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) && 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"));
if(BI.isNotNull(obj.week)) {
if(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) && 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"));
if(BI.isNotNull(obj.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -207,7 +218,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
this.editor.setValue("");
this.setTitle("");
} else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day;
var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
this.setTitle(dateStr);

45
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -135,9 +135,10 @@ 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 ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max;
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date, text) {
@ -149,25 +150,41 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
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);
var endText = "";
if(BI.isNotNull(obj.year)) {
if(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) && 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.quarter)) {
if(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) && 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.month)) {
if(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) && 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.week)) {
if(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) && 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.day)) {
if(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) && 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;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {

2
src/widget/multiselect/multiselect..insert.combo.js

@ -23,7 +23,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
// 标记正在请求数据
this.requesting = false;

11
src/widget/yearmonth/combo.yearmonth.js

@ -12,6 +12,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger",
min: o.min,
@ -35,11 +36,17 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
});

12
src/widget/yearquarter/combo.yearquarter.js

@ -12,6 +12,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger",
min: o.min,
@ -31,10 +32,19 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
if (self.combo.isViewVisible()) {
return;
}
self.storeValue = self.trigger.getValue();
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({
type: "bi.combo",

2
ui/js/index.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",

Loading…
Cancel
Save