Browse Source

DEC-6698 feat: 时间区间控件

es6
qcc 5 years ago
parent
commit
245b375a67
  1. 25
      demo/js/widget/timeinterval/demo.time_interval.js
  2. 3
      demo/version.js
  3. 11
      dist/bundle.css
  4. 408
      dist/bundle.ie.js
  5. 408
      dist/bundle.js
  6. 3
      dist/config.js
  7. 25
      dist/demo.js
  8. 11
      dist/fineui.css
  9. 408
      dist/fineui.ie.js
  10. 408
      dist/fineui.js
  11. 411
      dist/fineui_without_jquery_polyfill.js
  12. 11
      dist/resource.css
  13. 408
      dist/widget.js
  14. 11
      public/css/font.css
  15. 1
      src/less/lib/font.less
  16. 1
      src/less/resource/font.less
  17. 99
      src/widget/time/datetime.popup.js
  18. 152
      src/widget/time/time.combo.js
  19. 40
      src/widget/time/time.trigger.js
  20. 119
      src/widget/timeinterval/timeperiods.js
  21. 11
      ui/css/font.css
  22. 3
      ui/js/fineui.i18n.js

25
demo/js/widget/timeinterval/demo.time_interval.js

@ -71,6 +71,31 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}, {
type: "bi.time_periods",
value: {
start: {
hour: 7,
minute: 23,
second: 14
},
end: {
hour: 23,
minute: 34,
second: 32
}
},
ref: function (_ref) {
self.periods = _ref;
},
width: 180
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.periods.getValue()));
},
width: 300
}],
vgap: 20
};

3
demo/version.js

@ -170,5 +170,6 @@ BI.i18n = {
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_No_Select": "不选"
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};

11
dist/bundle.css vendored

@ -4716,6 +4716,17 @@ textarea::-webkit-scrollbar-thumb:hover {
content: "\e733";
color: inherit;
}
.time-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}
.time-font .b-font:before {
content: "\e6b1";
color: inherit;
}
.time-font.disabled .b-font:before {
content: "\e6b1";
color: inherit;
}
.date-change-h-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}

408
dist/bundle.ie.js vendored

@ -78272,7 +78272,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -78631,6 +78919,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.

408
dist/bundle.js vendored

@ -78676,7 +78676,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -79035,6 +79323,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.

3
dist/config.js vendored

@ -170,5 +170,6 @@ BI.i18n = {
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_No_Select": "不选"
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};

25
dist/demo.js vendored

@ -9985,6 +9985,31 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}, {
type: "bi.time_periods",
value: {
start: {
hour: 7,
minute: 23,
second: 14
},
end: {
hour: 23,
minute: 34,
second: 32
}
},
ref: function (_ref) {
self.periods = _ref;
},
width: 180
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.periods.getValue()));
},
width: 300
}],
vgap: 20
};

11
dist/fineui.css vendored

@ -4716,6 +4716,17 @@ textarea::-webkit-scrollbar-thumb:hover {
content: "\e733";
color: inherit;
}
.time-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}
.time-font .b-font:before {
content: "\e6b1";
color: inherit;
}
.time-font.disabled .b-font:before {
content: "\e6b1";
color: inherit;
}
.date-change-h-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}

408
dist/fineui.ie.js vendored

@ -78517,7 +78517,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -78876,6 +79164,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.

408
dist/fineui.js vendored

@ -78921,7 +78921,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -79280,6 +79568,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.

411
dist/fineui_without_jquery_polyfill.js vendored

@ -61716,7 +61716,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -62075,6 +62363,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.
@ -66329,5 +66735,6 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_No_Select": "不选"
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};BI.resourceURL = "file?path=/com/fr/web/ui/resource";

11
dist/resource.css vendored

@ -555,6 +555,17 @@ textarea::-webkit-scrollbar-thumb:hover {
content: "\e733";
color: inherit;
}
.time-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}
.time-font .b-font:before {
content: "\e6b1";
color: inherit;
}
.time-font.disabled .b-font:before {
content: "\e6b1";
color: inherit;
}
.date-change-h-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}

408
dist/widget.js vendored

@ -19231,7 +19231,295 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);/**
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
@ -19590,6 +19878,124 @@ BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.

11
public/css/font.css

@ -140,6 +140,17 @@
content: "\e733";
color: inherit;
}
.time-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}
.time-font .b-font:before {
content: "\e6b1";
color: inherit;
}
.time-font.disabled .b-font:before {
content: "\e6b1";
color: inherit;
}
.date-change-h-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}

1
src/less/lib/font.less

@ -4,6 +4,7 @@
@font-search: "e6dc";
@font-date: "e733";
@font-time: "e6b1";
@font-right-triangle: "e70c";
@font-copy: "e6bd";
@font-check-mark: "e6cf";

1
src/less/resource/font.less

@ -32,6 +32,7 @@
.font(search-font, @font-search);
.font(date-font, @font-date);
.font(time-font, @font-time);
.font-hover(date-change-h-font, @font-change);
//子菜单选中

99
src/widget/time/datetime.popup.js

@ -0,0 +1,99 @@
!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
forceCenter: true,
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (v) {
var value = v;
if (BI.isNull(value)) {
var date = BI.getDate();
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();

152
src/widget/time/time.combo.js

@ -0,0 +1,152 @@
/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius",
width: 80,
height: 22
},
render: function () {
var self = this, opts = this.options;
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CANCEL);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
}
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();

40
src/widget/time/time.trigger.js

@ -0,0 +1,40 @@
!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-time-trigger",
height: 22,
width: 80,
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
text: this._formatValue(o.value),
ref: function (_ref) {
self.text = _ref;
}
},
hgap: 4
}]
};
},
setValue: function (v) {
this.text.setText(this._formatValue(v));
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), "%H:%M:%S") : BI.i18nText("BI-Basic_Unrestricted");
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();

119
src/widget/timeinterval/timeperiods.js

@ -0,0 +1,119 @@
/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();

11
ui/css/font.css

@ -140,6 +140,17 @@
content: "\e733";
color: inherit;
}
.time-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}
.time-font .b-font:before {
content: "\e6b1";
color: inherit;
}
.time-font.disabled .b-font:before {
content: "\e6b1";
color: inherit;
}
.date-change-h-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '');
}

3
ui/js/fineui.i18n.js

@ -169,5 +169,6 @@ BI.i18n = {
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_No_Select": "不选"
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};
Loading…
Cancel
Save