Browse Source

JSY-25726 fix: 【冒烟】年季度/年月/年月区间筛选器,输入非法值后清空,设置框仍然标红

master
zsmj 2 years ago
parent
commit
e249a02bfb
  1. 24
      src/widget/yearmonth/combo.yearmonth.js
  2. 26
      src/widget/yearquarter/combo.yearquarter.js

24
src/widget/yearmonth/combo.yearmonth.js

@ -80,7 +80,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
}, },
listeners: [{ listeners: [
{
eventName: BI.DynamicYearMonthPopup.EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.EVENT_CHANGE,
action: function () { action: function () {
self.setValue(self.popup.getValue()); self.setValue(self.popup.getValue());
@ -91,6 +92,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
eventName: BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () { action: function () {
self.setValue(); self.setValue();
self.comboWrapper.element.removeClass("error");
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
} }
@ -98,7 +100,10 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({ type: BI.DynamicYearMonthCombo.Static, value: { year: date.getFullYear(), month: date.getMonth() + 1 } }); self.setValue({
type: BI.DynamicYearMonthCombo.Static,
value: { year: date.getFullYear(), month: date.getMonth() + 1 }
});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
@ -112,7 +117,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}], }
],
behaviors: o.behaviors, behaviors: o.behaviors,
min: o.minDate, min: o.minDate,
max: o.maxDate max: o.maxDate
@ -130,7 +136,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [
{
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: ["", "fill"], columnSize: ["", "fill"],
@ -138,7 +145,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.comboWrapper = this; self.comboWrapper = this;
}, },
items: [{ items: [
{
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font", cls: "bi-trigger-icon-button date-change-h-font",
@ -148,13 +156,15 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
self.changeIcon = this; self.changeIcon = this;
} }
} }
}, this.combo] }, this.combo
]
}, },
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}] }
]
}); });
this._checkDynamicValue(o.value); this._checkDynamicValue(o.value);
}, },

26
src/widget/yearquarter/combo.yearquarter.js

@ -1,6 +1,6 @@
BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
_consts:{ _consts: {
iconWidth: 24 iconWidth: 24
}, },
props: { props: {
@ -83,7 +83,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
}, },
listeners: [{ listeners: [
{
eventName: BI.DynamicYearQuarterPopup.EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.EVENT_CHANGE,
action: function () { action: function () {
self.setValue(self.popup.getValue()); self.setValue(self.popup.getValue());
@ -94,6 +95,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () { action: function () {
self.setValue(); self.setValue();
self.comboWrapper.element.removeClass("error");
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
} }
@ -101,7 +103,10 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({ type: BI.DynamicYearMonthCombo.Static, value: { year: date.getFullYear(), quarter: BI.getQuarter(date) } }); self.setValue({
type: BI.DynamicYearMonthCombo.Static,
value: { year: date.getFullYear(), quarter: BI.getQuarter(date) }
});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
@ -115,7 +120,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}], }
],
behaviors: o.behaviors, behaviors: o.behaviors,
min: o.minDate, min: o.minDate,
max: o.maxDate max: o.maxDate
@ -133,7 +139,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [
{
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: ["", "fill"], columnSize: ["", "fill"],
@ -141,7 +148,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
ref: function () { ref: function () {
self.comboWrapper = this; self.comboWrapper = this;
}, },
items: [{ items: [
{
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font", cls: "bi-trigger-icon-button date-change-h-font",
@ -151,13 +159,15 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
self.changeIcon = this; self.changeIcon = this;
} }
} }
}, this.combo] }, this.combo
]
}, },
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}] }
]
}); });
this._checkDynamicValue(o.value); this._checkDynamicValue(o.value);
}, },

Loading…
Cancel
Save