forked from fanruan/fineui
Browse Source
Merge in VISUAL/fineui from ~ZHENFEI.LI/fineui:es6 to es6 * commit '4eed1de4829ac8eb7bfee671db3a95acf93eb453': KERNEL-14093 refactor: widget/editor、numbereditor、numberinterval KERNEL-14092 refactor: widget/timeinterval 无JIRA任务 fix: this指向错误的bug 无JIRA任务 fix: 使用脚本漏掉的常量es6
Zhenfei.Li-李振飞
2 years ago
23 changed files with 1177 additions and 1077 deletions
@ -1,20 +1,20 @@
|
||||
/** |
||||
* 小号搜索框 |
||||
* Created by GUY on 2015/9/29. |
||||
* @class BI.SmallSearchEditor |
||||
* @extends BI.SearchEditor |
||||
*/ |
||||
BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { |
||||
_defaultConfig: function () { |
||||
var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); |
||||
return BI.extend(conf, { |
||||
baseCls: (conf.baseCls || "") + " bi-small-search-editor", |
||||
height: 20 |
||||
import { shortcut, extend } from "@/core"; |
||||
import { SearchEditor } from "./editor.search"; |
||||
|
||||
@shortcut() |
||||
export class SmallSearchEditor extends SearchEditor { |
||||
static xtype = "bi.small_search_editor" |
||||
|
||||
_defaultConfig() { |
||||
const conf = super._defaultConfig(...arguments); |
||||
|
||||
return extend(conf, { |
||||
baseCls: `${conf.baseCls || ""} bi-small-search-editor`, |
||||
height: 20, |
||||
}); |
||||
}, |
||||
} |
||||
|
||||
_init: function () { |
||||
BI.SmallSearchEditor.superclass._init.apply(this, arguments); |
||||
_init() { |
||||
super._init(...arguments); |
||||
} |
||||
} |
||||
}); |
||||
BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor); |
@ -1,20 +1,20 @@
|
||||
/** |
||||
* 小号搜索框 |
||||
* Created by GUY on 2015/9/29. |
||||
* @class BI.SmallTextEditor |
||||
* @extends BI.SearchEditor |
||||
*/ |
||||
BI.SmallTextEditor = BI.inherit(BI.TextEditor, { |
||||
_defaultConfig: function () { |
||||
var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); |
||||
return BI.extend(conf, { |
||||
baseCls: (conf.baseCls || "") + " bi-small-text-editor", |
||||
height: 20 |
||||
import { shortcut, extend } from "@/core"; |
||||
import { TextEditor } from "./editor.text"; |
||||
|
||||
@shortcut() |
||||
export class SmallTextEditor extends TextEditor { |
||||
static xtype = "bi.small_text_editor" |
||||
|
||||
_defaultConfig() { |
||||
const conf = super._defaultConfig(...arguments); |
||||
|
||||
return extend(conf, { |
||||
baseCls: `${conf.baseCls || ""} bi-small-text-editor`, |
||||
height: 20, |
||||
}); |
||||
}, |
||||
} |
||||
|
||||
_init: function () { |
||||
BI.SmallTextEditor.superclass._init.apply(this, arguments); |
||||
_init() { |
||||
super._init(...arguments); |
||||
} |
||||
} |
||||
}); |
||||
BI.shortcut("bi.small_text_editor", BI.SmallTextEditor); |
@ -0,0 +1,4 @@
|
||||
export { SearchEditor } from "./editor.search"; |
||||
export { SmallSearchEditor } from "./editor.search.small"; |
||||
export { TextEditor } from "./editor.text"; |
||||
export { SmallTextEditor } from "./editor.text.small"; |
@ -0,0 +1,3 @@
|
||||
export { DateInterval } from "./dateinterval"; |
||||
export { TimeInterval } from "./timeinterval"; |
||||
export { TimePeriods } from "./timeperiods"; |
@ -1,92 +1,90 @@
|
||||
/** |
||||
* 时间区间 |
||||
* qcc |
||||
* 2019/2/28 |
||||
*/ |
||||
import { shortcut, extend } from "@/core"; |
||||
import { Single, Label } from "@/base"; |
||||
import { TimeCombo } from "../time"; |
||||
|
||||
!(function () { |
||||
BI.TimePeriods = BI.inherit(BI.Single, { |
||||
constants: { |
||||
height: 24, |
||||
width: 24, |
||||
hgap: 15, |
||||
offset: -15 |
||||
}, |
||||
props: { |
||||
@shortcut() |
||||
export class TimePeriods extends Single { |
||||
static xtype = "bi.time_periods" |
||||
|
||||
props = { |
||||
extraCls: "bi-time-interval", |
||||
value: {} |
||||
}, |
||||
value: {}, |
||||
}; |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
static EVENT_CONFIRM = "EVENT_CONFIRM" |
||||
static EVENT_CHANGE = "EVENT_CHANGE" |
||||
|
||||
|
||||
render() { |
||||
const o = this.options; |
||||
|
||||
return { |
||||
type: "bi.horizontal_fill", |
||||
columnSize: ["fill", "", "fill"], |
||||
items: [{ |
||||
el: BI.extend({ |
||||
ref: function (_ref) { |
||||
self.left = _ref; |
||||
} |
||||
}, this._createCombo(o.value.start, o.watermark?.start)) |
||||
el: extend({ |
||||
ref: _ref => { |
||||
this.left = _ref; |
||||
}, |
||||
}, this._createCombo(o.value.start, o.watermark?.start)), |
||||
}, { |
||||
el: { |
||||
type: "bi.label", |
||||
type: Label.xtype, |
||||
height: o.height, |
||||
hgap: 5, |
||||
text: "-", |
||||
ref: function (_ref) { |
||||
self.label = _ref; |
||||
} |
||||
} |
||||
ref: _ref => { |
||||
this.label = _ref; |
||||
}, |
||||
}, |
||||
}, { |
||||
el: BI.extend({ |
||||
ref: function (_ref) { |
||||
self.right = _ref; |
||||
} |
||||
}, this._createCombo(o.value.end, o.watermark?.end)) |
||||
}] |
||||
}; |
||||
el: extend({ |
||||
ref: _ref => { |
||||
this.right = _ref; |
||||
}, |
||||
}, this._createCombo(o.value.end, o.watermark?.end)), |
||||
}], |
||||
}; |
||||
} |
||||
|
||||
_createCombo(v, watermark) { |
||||
const o = this.options; |
||||
|
||||
_createCombo: function (v, watermark) { |
||||
var self = this; |
||||
var o = this.options; |
||||
return { |
||||
type: "bi.time_combo", |
||||
type: TimeCombo.xtype, |
||||
value: v, |
||||
height: o.height, |
||||
watermark: watermark, |
||||
watermark, |
||||
listeners: [{ |
||||
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW, |
||||
action: function () { |
||||
self.left.hidePopupView(); |
||||
self.right.hidePopupView(); |
||||
} |
||||
eventName: TimeCombo.EVENT_BEFORE_POPUPVIEW, |
||||
action: () => { |
||||
this.left.hidePopupView(); |
||||
this.right.hidePopupView(); |
||||
}, |
||||
}, { |
||||
eventName: BI.TimeCombo.EVENT_CHANGE, |
||||
action: function () { |
||||
self.fireEvent(BI.TimePeriods.EVENT_CHANGE); |
||||
} |
||||
eventName: TimeCombo.EVENT_CHANGE, |
||||
action: () => { |
||||
this.fireEvent(TimePeriods.EVENT_CHANGE); |
||||
}, |
||||
}, { |
||||
eventName: BI.TimeCombo.EVENT_CONFIRM, |
||||
action: function () { |
||||
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM); |
||||
} |
||||
}] |
||||
}; |
||||
eventName: TimeCombo.EVENT_CONFIRM, |
||||
action: () => { |
||||
this.fireEvent(TimePeriods.EVENT_CONFIRM); |
||||
}, |
||||
}], |
||||
}; |
||||
} |
||||
|
||||
setValue: function (date) { |
||||
setValue(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); |
||||
})(); |
||||
|
||||
getValue() { |
||||
return { |
||||
start: this.left.getValue(), |
||||
end: this.right.getValue(), |
||||
}; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue