Browse Source

Pull request #1692: BI-78828 为日期类型控件新增事件

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '8711cac992a9b114f2c5bf7111c9a2d2928d3bdb':
  BI-78828 为日期类型控件新增事件
master
windy 4 years ago
parent
commit
408050011d
  1. 1
      changelog.md
  2. 2
      src/widget/date/calendar/combo.year.date.js
  3. 7
      src/widget/date/calendar/picker.date.js
  4. 4
      src/widget/date/calendar/picker.year.js
  5. 5
      src/widget/date/calendar/popup.calendar.date.js
  6. 4
      src/widget/datepane/card.static.datepane.js
  7. 6
      src/widget/datepane/datepane.js
  8. 5
      src/widget/datetimepane/card.static.datetimepane.js
  9. 5
      src/widget/datetimepane/datetimepane.js
  10. 6
      src/widget/dynamicdate/dynamicdate.combo.js
  11. 6
      src/widget/dynamicdate/dynamicdate.popup.js
  12. 6
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  13. 9
      src/widget/dynamicdatetime/dynamicdatetime.popup.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-12) 2.0(2020-12)
- 日期选择控件为年月选择器子组件新增POPUP弹出前事件
- 文件上传控件新增API(setMaxFileLength)以动态设置最大上传文件数量 - 文件上传控件新增API(setMaxFileLength)以动态设置最大上传文件数量
- 复选下拉树显示查看已选效果改成和复选下拉列表一致 - 复选下拉树显示查看已选效果改成和复选下拉列表一致
- Pane系列提供small和big两种大小的加载动画 - Pane系列提供small和big两种大小的加载动画

2
src/widget/date/calendar/combo.year.date.js

@ -58,6 +58,7 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
// BI-22551 popup未初始化传入的behavior无效 // BI-22551 popup未初始化传入的behavior无效
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.doBehavior(); self.doBehavior();
self.fireEvent(BI.YearDateCombo.EVENT_BEFORE_POPUPVIEW);
}); });
}, },
@ -79,4 +80,5 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
} }
}); });
BI.YearDateCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearDateCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_date_combo", BI.YearDateCombo); BI.shortcut("bi.year_date_combo", BI.YearDateCombo);

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

@ -80,6 +80,9 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
self.fireEvent(BI.DatePicker.EVENT_CHANGE); self.fireEvent(BI.DatePicker.EVENT_CHANGE);
}); });
this.year.on(BI.YearDateCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
});
this.month = BI.createWidget({ this.month = BI.createWidget({
type: "bi.month_date_combo", type: "bi.month_date_combo",
behaviors: o.behaviors, behaviors: o.behaviors,
@ -92,6 +95,9 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
self.fireEvent(BI.DatePicker.EVENT_CHANGE); self.fireEvent(BI.DatePicker.EVENT_CHANGE);
}); });
this.month.on(BI.YearDateCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
});
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
@ -218,4 +224,5 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}, },
}); });
BI.DatePicker.EVENT_CHANGE = "EVENT_CHANGE"; BI.DatePicker.EVENT_CHANGE = "EVENT_CHANGE";
BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.date_picker", BI.DatePicker); BI.shortcut("bi.date_picker", BI.DatePicker);

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

@ -57,6 +57,9 @@ BI.YearPicker = BI.inherit(BI.Widget, {
self.setValue(self.year.getValue()); self.setValue(self.year.getValue());
self.fireEvent(BI.YearPicker.EVENT_CHANGE); self.fireEvent(BI.YearPicker.EVENT_CHANGE);
}); });
this.year.on(BI.YearDateCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearPicker.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
@ -126,4 +129,5 @@ BI.YearPicker = BI.inherit(BI.Widget, {
} }
}); });
BI.YearPicker.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearPicker.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearPicker.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_picker", BI.YearPicker); BI.shortcut("bi.year_picker", BI.YearPicker);

5
src/widget/date/calendar/popup.calendar.date.js

@ -76,6 +76,10 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)); self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
}); });
this.datePicker.on(BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW, function () {
self.fireEvent(BI.DateCalendarPopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
});
this.calendar.on(BI.Navigation.EVENT_CHANGE, function () { this.calendar.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedTime = self.calendar.getValue(); self.selectedTime = self.calendar.getValue();
self.setValue(self.selectedTime); self.setValue(self.selectedTime);
@ -144,4 +148,5 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
} }
}); });
BI.DateCalendarPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.DateCalendarPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DateCalendarPopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup); BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup);

4
src/widget/datepane/card.static.datepane.js

@ -46,6 +46,9 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
self.calendar.setValue(self.selectedTime); self.calendar.setValue(self.selectedTime);
day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE); day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
}); });
this.datePicker.on(BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW, function () {
self.fireEvent(BI.StaticDatePaneCard.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
});
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
direction: "custom", direction: "custom",
@ -148,4 +151,5 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
} }
}); });
BI.StaticDatePaneCard.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW"
BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard); BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);

6
src/widget/datepane/datepane.js

@ -69,6 +69,11 @@ BI.DynamicDatePane = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE); self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE);
} }
}, {
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW",
action: function () {
self.fireEvent(BI.DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
}
}], }],
ref: function () { ref: function () {
self.ymd = this; self.ymd = this;
@ -148,6 +153,7 @@ BI.DynamicDatePane = BI.inherit(BI.Widget, {
}); });
BI.DynamicDatePane.EVENT_CHANGE = "EVENT_CHANGE"; BI.DynamicDatePane.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.dynamic_date_pane", BI.DynamicDatePane); BI.shortcut("bi.dynamic_date_pane", BI.DynamicDatePane);

5
src/widget/datetimepane/card.static.datetimepane.js

@ -44,6 +44,10 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE); day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
}); });
this.datePicker.on(BI.DatePicker.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW, function () {
self.fireEvent(BI.StaticDateTimePaneCard.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
});
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
direction: "custom", direction: "custom",
// logic: { // logic: {
@ -167,4 +171,5 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
} }
}); });
BI.StaticDateTimePaneCard.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.static_date_time_pane_card", BI.StaticDateTimePaneCard); BI.shortcut("bi.static_date_time_pane_card", BI.StaticDateTimePaneCard);

5
src/widget/datetimepane/datetimepane.js

@ -68,6 +68,11 @@ BI.DynamicDateTimePane = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent("EVENT_CHANGE"); self.fireEvent("EVENT_CHANGE");
} }
}, {
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW",
action: function () {
self.fireEvent("EVENT_BEFORE_YEAR_MONTH_POPUPVIEW");
}
}], }],
ref: function () { ref: function () {
self.ymd = this; self.ymd = this;

6
src/widget/dynamicdate/dynamicdate.combo.js

@ -179,6 +179,11 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}, {
eventName: BI.DynamicDatePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
}
}] }]
}, },
stopPropagation: false stopPropagation: false
@ -307,6 +312,7 @@ BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID"; BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.DynamicDateCombo.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.dynamic_date_combo", BI.DynamicDateCombo); BI.shortcut("bi.dynamic_date_combo", BI.DynamicDateCombo);

6
src/widget/dynamicdate/dynamicdate.popup.js

@ -117,6 +117,11 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE); self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE);
} }
}, {
eventName: BI.DateCalendarPopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW,
action: function () {
self.fireEvent(BI.DynamicDatePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
}
}], }],
ref: function () { ref: function () {
self.ymd = this; self.ymd = this;
@ -228,4 +233,5 @@ BI.DynamicDatePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE"; BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE"; BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE"; BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.DynamicDatePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup); BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);

6
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -187,6 +187,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
} }
}, {
eventName: BI.DynamicDateTimePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
}
}] }]
}, },
stopPropagation: false stopPropagation: false
@ -315,6 +320,7 @@ BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID"; BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.DynamicDateTimeCombo.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.dynamic_date_time_combo", BI.DynamicDateTimeCombo); BI.shortcut("bi.dynamic_date_time_combo", BI.DynamicDateTimeCombo);

9
src/widget/dynamicdatetime/dynamicdatetime.popup.js

@ -116,7 +116,13 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
max: self.options.max, max: self.options.max,
ref: function () { ref: function () {
self.ymd = this; self.ymd = this;
} },
listeners: [{
eventName: BI.DateCalendarPopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW,
action: function () {
self.fireEvent(BI.DynamicDateTimePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
}
}],
}, { }, {
el: { el: {
type: "bi.dynamic_date_time_select", type: "bi.dynamic_date_time_select",
@ -242,4 +248,5 @@ BI.DynamicDateTimePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE"; BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE"; BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE"; BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.DynamicDateTimePopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup); BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);
Loading…
Cancel
Save