Browse Source

KERNEL-6836 时间类型控件不做操作收起不发送confirm事件

es6
windy 4 years ago
parent
commit
629519097a
  1. 1
      changelog.md
  2. 6
      src/widget/dynamicdate/dynamicdate.combo.js
  3. 6
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  4. 7
      src/widget/yearmonth/combo.yearmonth.js
  5. 7
      src/widget/yearquarter/combo.yearquarter.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2021-01) 2.0(2021-01)
- 日期类型控件不操作下拉面板收起不发Confirm事件
- 日期类型控件全系列可设置是否显示动态日期 - 日期类型控件全系列可设置是否显示动态日期
- 日期类型控件全系列可设置最大最小日期 - 日期类型控件全系列可设置最大最小日期
- 调整了combo的popup显示位置计算逻辑 - 调整了combo的popup显示位置计算逻辑

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

@ -114,11 +114,11 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
}, { }, {
eventName: BI.DynamicDateTrigger.EVENT_CONFIRM, eventName: BI.DynamicDateTrigger.EVENT_CONFIRM,
action: function () { action: function () {
if (self.combo.isViewVisible()) {
return;
}
var dateStore = self.storeTriggerValue; var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey(); var dateObj = self.trigger.getKey();
if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore)) {
return;
}
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue()); self.setValue(self.trigger.getValue());

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

@ -119,11 +119,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}, { }, {
eventName: BI.DynamicDateTimeTrigger.EVENT_CONFIRM, eventName: BI.DynamicDateTimeTrigger.EVENT_CONFIRM,
action: function () { action: function () {
if (self.combo.isViewVisible()) {
return;
}
var dateStore = self.storeTriggerValue; var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey(); var dateObj = self.trigger.getKey();
if (self.combo.isViewVisible() || BI.isEqual(dateObj, dateStore)) {
return;
}
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue()); self.setValue(self.trigger.getValue());

7
src/widget/yearmonth/combo.yearmonth.js

@ -38,12 +38,11 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID);
}); });
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM, function () { this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM, function () {
// 没看出来干啥的,先去掉
// if (self.combo.isViewVisible()) {
// return;
// }
var dateStore = self.storeTriggerValue; var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey(); var dateObj = self.trigger.getKey();
if (BI.isEqual(dateObj, dateStore)) {
return;
}
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue()); self.setValue(self.trigger.getValue());

7
src/widget/yearquarter/combo.yearquarter.js

@ -34,12 +34,11 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
self.combo.isViewVisible() && self.combo.hideView(); self.combo.isViewVisible() && self.combo.hideView();
}); });
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM, function () { this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM, function () {
// 没看出来干啥的,先去掉
// if (self.combo.isViewVisible()) {
// return;
// }
var dateStore = self.storeTriggerValue; var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey(); var dateObj = self.trigger.getKey();
if (BI.isEqual(dateObj, dateStore)) {
return;
}
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue()); self.setValue(self.trigger.getValue());

Loading…
Cancel
Save