|
|
|
@ -80423,12 +80423,14 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
|
|
|
|
|
props: { |
|
|
|
|
baseCls: "bi-time-combo bi-border bi-border-radius", |
|
|
|
|
width: 78, |
|
|
|
|
height: 22 |
|
|
|
|
height: 22, |
|
|
|
|
format: "", |
|
|
|
|
allowEdit: false |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this, opts = this.options; |
|
|
|
|
|
|
|
|
|
this.storeTriggerValue = ""; |
|
|
|
|
this.storeValue = opts.value; |
|
|
|
|
|
|
|
|
|
var popup = { |
|
|
|
@ -80471,10 +80473,74 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
|
|
|
|
|
isNeedAdjustWidth: false, |
|
|
|
|
el: { |
|
|
|
|
type: "bi.time_trigger", |
|
|
|
|
allowEdit: opts.allowEdit, |
|
|
|
|
format: opts.format, |
|
|
|
|
value: opts.value, |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.trigger = _ref; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: "EVENT_KEY_DOWN", |
|
|
|
|
action: function () { |
|
|
|
|
if (self.combo.isViewVisible()) { |
|
|
|
|
self.combo.hideView(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_STOP", |
|
|
|
|
action: function () { |
|
|
|
|
if (!self.combo.isViewVisible()) { |
|
|
|
|
self.combo.showView(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_FOCUS", |
|
|
|
|
action: function () { |
|
|
|
|
self.storeTriggerValue = self.trigger.getKey(); |
|
|
|
|
if (!self.combo.isViewVisible()) { |
|
|
|
|
self.combo.showView(); |
|
|
|
|
} |
|
|
|
|
self.fireEvent("EVENT_FOCUS"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_ERROR", |
|
|
|
|
action: function () { |
|
|
|
|
var date = BI.getDate(); |
|
|
|
|
self.storeValue = { |
|
|
|
|
hour: date.getHours(), |
|
|
|
|
minute: date.getMinutes(), |
|
|
|
|
second: date.getSeconds() |
|
|
|
|
}; |
|
|
|
|
self.fireEvent("EVENT_ERROR"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_VALID", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_VALID"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_CHANGE", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_CHANGE"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_CONFIRM", |
|
|
|
|
action: function () { |
|
|
|
|
if (self.combo.isViewVisible()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var dateStore = self.storeTriggerValue; |
|
|
|
|
var dateObj = self.trigger.getKey(); |
|
|
|
|
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { |
|
|
|
|
self.storeValue = self.trigger.getValue(); |
|
|
|
|
self.setValue(self.trigger.getValue()); |
|
|
|
|
} else if (BI.isEmptyString(dateObj)) { |
|
|
|
|
self.storeValue = null; |
|
|
|
|
self.trigger.setValue(); |
|
|
|
|
} |
|
|
|
|
self.fireEvent("EVENT_CONFIRM"); |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
adjustLength: this.constants.comboAdjustHeight, |
|
|
|
|
popup: { |
|
|
|
@ -80498,7 +80564,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
|
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
right: 22, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
@ -80558,42 +80624,164 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
|
|
|
|
|
BI.shortcut("bi.time_combo", BI.TimeCombo); |
|
|
|
|
})();!(function () { |
|
|
|
|
BI.TimeTrigger = BI.inherit(BI.Trigger, { |
|
|
|
|
|
|
|
|
|
_const: { |
|
|
|
|
COMPARE_FORMAT: "%H:%M:%S", |
|
|
|
|
COMPLETE_COMPARE_FORMAT: "%Y-%M-%d %H:%M:%S", |
|
|
|
|
FORMAT_ARRAY: [ |
|
|
|
|
"%H:%M:%S", // HH:mm:ss
|
|
|
|
|
"%I:%M:%S", // hh:mm:ss
|
|
|
|
|
"%l:%M:%S", // h:mm:ss
|
|
|
|
|
"%k:%M:%S", // H:mm:ss
|
|
|
|
|
"%l:%M:%S %p", // h:mm:ss a
|
|
|
|
|
"%l:%M:%S %P", // h:mm:ss a
|
|
|
|
|
"%l:%M", // h:mm
|
|
|
|
|
"%k:%M", // H:mm
|
|
|
|
|
"%I:%M", // hh:mm
|
|
|
|
|
"%H:%M", // HH:mm
|
|
|
|
|
"%M:%S" // mm:ss
|
|
|
|
|
], |
|
|
|
|
DEFAULT_DATE_STRING: "2000-01-01" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
extraCls: "bi-time-trigger", |
|
|
|
|
height: 22, |
|
|
|
|
width: 80, |
|
|
|
|
value: {} |
|
|
|
|
value: {}, |
|
|
|
|
format: "", |
|
|
|
|
allowEdit: false |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
this.storeTriggerValue = ""; |
|
|
|
|
this.storeValue = o.value; |
|
|
|
|
return { |
|
|
|
|
type: "bi.htape", |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.label", |
|
|
|
|
title: function () { |
|
|
|
|
return self.text.getText(); |
|
|
|
|
}, |
|
|
|
|
textAlign: "left", |
|
|
|
|
type: "bi.sign_editor", |
|
|
|
|
height: o.height, |
|
|
|
|
width: o.width, |
|
|
|
|
text: this._formatValue(o.value), |
|
|
|
|
validationChecker: function (v) { |
|
|
|
|
return self._dateCheck(v); |
|
|
|
|
}, |
|
|
|
|
quitChecker: function () { |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.text = _ref; |
|
|
|
|
} |
|
|
|
|
self.editor = _ref; |
|
|
|
|
}, |
|
|
|
|
value: this._formatValue(o.value), |
|
|
|
|
hgap: 4, |
|
|
|
|
allowBlank: true, |
|
|
|
|
watermark: BI.i18nText("BI-Basic_Unrestricted"), |
|
|
|
|
title: BI.bind(this._getTitle, this), |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: "EVENT_KEY_DOWN", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_KEY_DOWN"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_FOCUS", |
|
|
|
|
action: function () { |
|
|
|
|
self.storeTriggerValue = self.getKey(); |
|
|
|
|
self.fireEvent("EVENT_FOCUS"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_STOP", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_STOP"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_VALID", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_VALID"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_ERROR", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_ERROR"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_CONFIRM", |
|
|
|
|
action: function () { |
|
|
|
|
var value = self.editor.getValue(); |
|
|
|
|
if (BI.isNotNull(value)) { |
|
|
|
|
self.editor.setState(value); |
|
|
|
|
} |
|
|
|
|
if (BI.isNotEmptyString(value) && !BI.isEqual(self.storeTriggerValue, self.getKey())) { |
|
|
|
|
var date = value.match(/\d+/g); |
|
|
|
|
self.storeValue = { |
|
|
|
|
hour: date[0] | 0, |
|
|
|
|
minute: date[1] | 0, |
|
|
|
|
second: date[2] | 0 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
self.fireEvent("EVENT_CONFIRM"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_START", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_START"); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: "EVENT_CHANGE", |
|
|
|
|
action: function () { |
|
|
|
|
self.fireEvent("EVENT_CHANGE"); |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
hgap: 4 |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.text", |
|
|
|
|
invisible: o.allowEdit, |
|
|
|
|
cls: "show-text", |
|
|
|
|
title: BI.bind(this._getTitle, this), |
|
|
|
|
hgap: 4 |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.text.setText(this._formatValue(v)); |
|
|
|
|
_dateCheck: function (date) { |
|
|
|
|
var c = this._const; |
|
|
|
|
return BI.any(c.FORMAT_ARRAY, function (idx, format) { |
|
|
|
|
return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING + " " + date, c.COMPLETE_COMPARE_FORMAT), format) === date; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getTitle: function () { |
|
|
|
|
var storeValue = this.storeValue || {}; |
|
|
|
|
return BI.print(BI.getDate(storeValue.year, (storeValue.month - 1), storeValue.day), this._getFormatString()); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getFormatString: function () { |
|
|
|
|
return this.options.format || this._const.COMPARE_FORMAT; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_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"); |
|
|
|
|
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), this._getFormatString()) : BI.i18nText("BI-Basic_Unrestricted"); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getKey: function () { |
|
|
|
|
return this.editor.getValue(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.storeValue = v; |
|
|
|
|
this.editor.setValue(this._formatValue(v)); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return this.storeValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|