|
|
|
@ -36,8 +36,20 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.htape", |
|
|
|
|
type: "bi.combo", |
|
|
|
|
cls: (opts.simple ? "bi-border-bottom" : "bi-border") + " bi-border-radius bi-focus-shadow", |
|
|
|
|
destroyWhenHide: true, |
|
|
|
|
container: opts.container, |
|
|
|
|
ref: function () { |
|
|
|
|
self.combo = this; |
|
|
|
|
}, |
|
|
|
|
toggle: false, |
|
|
|
|
isNeedAdjustHeight: opts.isNeedAdjustHeight, |
|
|
|
|
isNeedAdjustWidth: opts.isNeedAdjustWidth, |
|
|
|
|
el: { |
|
|
|
|
type: "bi.horizontal_fill", |
|
|
|
|
columnSize: [opts.height - border, "fill"], |
|
|
|
|
height: opts.height - border, |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.icon_button", |
|
|
|
@ -48,22 +60,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.changeIcon = this; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
width: opts.height - border |
|
|
|
|
}, { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.combo", |
|
|
|
|
cls: "bi-focus-shadow", |
|
|
|
|
destroyWhenHide: true, |
|
|
|
|
container: opts.container, |
|
|
|
|
ref: function () { |
|
|
|
|
self.combo = this; |
|
|
|
|
}, |
|
|
|
|
toggle: false, |
|
|
|
|
isNeedAdjustHeight: opts.isNeedAdjustHeight, |
|
|
|
|
isNeedAdjustWidth: opts.isNeedAdjustWidth, |
|
|
|
|
el: { |
|
|
|
|
type: "bi.dynamic_date_time_trigger", |
|
|
|
|
simple: opts.simple, |
|
|
|
|
min: opts.minDate, |
|
|
|
@ -71,6 +68,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
allowEdit: opts.allowEdit, |
|
|
|
|
watermark: opts.watermark, |
|
|
|
|
format: opts.format, |
|
|
|
|
iconWidth: opts.height - border, |
|
|
|
|
height: opts.height - border, |
|
|
|
|
value: opts.value, |
|
|
|
|
ref: function () { |
|
|
|
@ -120,13 +118,13 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
month: date.getMonth() + 1 |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
self.comboWrapper.element.addClass("error"); |
|
|
|
|
self.combo.element.addClass("error"); |
|
|
|
|
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.DynamicDateTimeTrigger.EVENT_VALID, |
|
|
|
|
action: function () { |
|
|
|
|
self.comboWrapper.element.removeClass("error"); |
|
|
|
|
self.combo.element.removeClass("error"); |
|
|
|
|
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
@ -153,6 +151,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
adjustLength: this.constants.comboAdjustHeight, |
|
|
|
|
popup: { |
|
|
|
@ -215,7 +214,6 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
stopPropagation: false |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, |
|
|
|
@ -226,42 +224,10 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW); |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
// DEC-4250 和复选下拉一样,点击不收起
|
|
|
|
|
hideChecker: function (e) { |
|
|
|
|
return self.triggerBtn.element.find(e.target).length === 0; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.icon_button", |
|
|
|
|
cls: "bi-trigger-icon-button date-font", |
|
|
|
|
width: opts.height - border, |
|
|
|
|
height: opts.height - border, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.IconButton.EVENT_CHANGE, |
|
|
|
|
action: function () { |
|
|
|
|
if (self.combo.isViewVisible()) { |
|
|
|
|
// self.combo.hideView();
|
|
|
|
|
} else { |
|
|
|
|
self.combo.showView(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
ref: function () { |
|
|
|
|
self.triggerBtn = this; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
right: 0 |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.comboWrapper = _ref; |
|
|
|
|
} |
|
|
|
|
// // DEC-4250 和复选下拉一样,点击不收起
|
|
|
|
|
// hideChecker: function (e) {
|
|
|
|
|
// return self.triggerBtn.element.find(e.target).length === 0;
|
|
|
|
|
// }
|
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
left: 0, |
|
|
|
@ -284,12 +250,12 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
|
|
|
|
|
switch (type) { |
|
|
|
|
case BI.DynamicDateTimeCombo.Dynamic: |
|
|
|
|
this.changeIcon.setVisible(true); |
|
|
|
|
this.comboWrapper.attr("items")[0].width = o.height - this.options.simple ? 1 : 2; |
|
|
|
|
this.comboWrapper.resize(); |
|
|
|
|
// this.comboWrapper.attr("items")[0].width = o.height - (this.options.simple ? 1 : 2);
|
|
|
|
|
// this.comboWrapper.resize();
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
this.comboWrapper.attr("items")[0].width = 0; |
|
|
|
|
this.comboWrapper.resize(); |
|
|
|
|
// this.comboWrapper.attr("items")[0].width = 0;
|
|
|
|
|
// this.comboWrapper.resize();
|
|
|
|
|
this.changeIcon.setVisible(false); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|