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