|
|
|
/**
|
|
|
|
* 季度展示面板
|
|
|
|
*
|
|
|
|
* Created by GUY on 2015/9/2.
|
|
|
|
* @class BI.QuarterPopup
|
|
|
|
* @extends BI.Trigger
|
|
|
|
*/
|
|
|
|
BI.QuarterPopup = BI.inherit(BI.Widget, {
|
|
|
|
|
|
|
|
_defaultConfig: function () {
|
|
|
|
return BI.extend(BI.QuarterPopup.superclass._defaultConfig.apply(this, arguments), {
|
|
|
|
baseCls: "bi-quarter-popup",
|
|
|
|
behaviors: {}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
_init: function () {
|
|
|
|
BI.QuarterPopup.superclass._init.apply(this, arguments);
|
|
|
|
var self = this, o = this.options;
|
|
|
|
|
|
|
|
var items = [{
|
|
|
|
text: BI.Date._QN[1],
|
|
|
|
value: 1
|
|
|
|
}, {
|
|
|
|
text: BI.Date._QN[2],
|
|
|
|
value: 2
|
|
|
|
}, {
|
|
|
|
text: BI.Date._QN[3],
|
|
|
|
value: 3
|
|
|
|
}, {
|
|
|
|
text: BI.Date._QN[4],
|
|
|
|
value: 4
|
|
|
|
}];
|
|
|
|
items = BI.map(items, function (j, item) {
|
|
|
|
return BI.extend(item, {
|
|
|
|
type: "bi.text_item",
|
|
|
|
cls: "bi-list-item-active",
|
|
|
|
textAlign: "left",
|
|
|
|
whiteSpace: "nowrap",
|
|
|
|
once: false,
|
|
|
|
forceSelected: true,
|
|
|
|
height: 25
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.quarter = BI.createWidget({
|
|
|
|
type: "bi.button_group",
|
|
|
|
element: this,
|
|
|
|
behaviors: o.behaviors,
|
|
|
|
items: BI.createItems(items, {}),
|
|
|
|
layouts: [{
|
|
|
|
type: "bi.vertical"
|
|
|
|
}],
|
|
|
|
value: o.value
|
|
|
|
});
|
|
|
|
|
|
|
|
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
|
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
|
|
|
|
if (type === BI.Events.CLICK) {
|
|
|
|
self.fireEvent(BI.MonthPopup.EVENT_CHANGE);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
getValue: function () {
|
|
|
|
return this.quarter.getValue()[0];
|
|
|
|
},
|
|
|
|
|
|
|
|
setValue: function (v) {
|
|
|
|
this.quarter.setValue([v]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
BI.QuarterPopup.EVENT_CHANGE = "EVENT_CHANGE";
|
|
|
|
BI.shortcut("bi.quarter_popup", BI.QuarterPopup);
|