forked from fanruan/fineui
Browse Source
Merge in VISUAL/fineui from ~JOKER.WANG/fineui:es6 to es6 * commit '8aac9606ecea43bbeb6957e66c1f16517eee4e78': KERNEL-14109 refactor:componet/treevaluechooser文件es6化es6
Joker.Wang-王顺
2 years ago
11 changed files with 988 additions and 837 deletions
@ -1,18 +1,21 @@ |
|||||||
export * as allvaluechooser from "./allvaluechooser"; |
export * as allvaluechooser from "./allvaluechooser"; |
||||||
export * as form from "./form"; |
export * as form from "./form"; |
||||||
export * as valueChooser from "./valuechooser"; |
export * as valueChooser from "./valuechooser"; |
||||||
|
export * as treeValueChooser from "./treevaluechooser"; |
||||||
export { AllValueMultiTextValueCombo } from "./allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; |
export { AllValueMultiTextValueCombo } from "./allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; |
||||||
|
|
||||||
// Object.assign(BI, {
|
// Object.assign(BI, {
|
||||||
// ...allvaluechooser,
|
// ...allvaluechooser,
|
||||||
// ...form,
|
// ...form,
|
||||||
// ...valueChooser,
|
// ...valueChooser,
|
||||||
|
// ......treeValueChooser,
|
||||||
// AllValueMultiTextValueCombo,
|
// AllValueMultiTextValueCombo,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// export * from "./allvaluechooser";
|
// export * from "./allvaluechooser";
|
||||||
// export * from "./form";
|
// export * from "./form";
|
||||||
// export * from "./valuechooser";
|
// export * from "./valuechooser";
|
||||||
|
// export * from "./treevaluechooser";
|
||||||
// export {
|
// export {
|
||||||
// AllValueMultiTextValueCombo
|
// AllValueMultiTextValueCombo
|
||||||
// };
|
// };
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@ |
|||||||
|
export { AbstractTreeValueChooser } from "./abstract.treevaluechooser"; |
||||||
|
export { AbstractListTreeValueChooser } from "./abstract.treevaluechooser.list"; |
||||||
|
export { ListTreeValueChooserInsertCombo } from "./combo.listtreevaluechooser"; |
||||||
|
export { TreeValueChooserInsertCombo } from "./combo.treevaluechooser.insert"; |
||||||
|
export { TreeValueChooserCombo } from "./combo.treevaluechooser"; |
||||||
|
export { TreeValueChooserPane } from "./pane.treevaluechooser"; |
@ -1,66 +1,66 @@ |
|||||||
/** |
import { shortcut, extend, emptyFn, createWidget, bind, isNotNull } from "@/core"; |
||||||
* 简单的树面板, 适用于数据量少的情况 |
import { AbstractTreeValueChooser } from "./abstract.treevaluechooser"; |
||||||
* |
import { MultiSelectTree } from "@/widget/multiselecttree/multiselecttree"; |
||||||
* Created by GUY on 2015/10/29. |
import { MultiSelectTreePopup } from "@/widget/multiselecttree/multiselecttree.popup"; |
||||||
* @class BI.TreeValueChooserPane |
|
||||||
* @extends BI.AbstractTreeValueChooser |
|
||||||
*/ |
|
||||||
BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { |
|
||||||
|
|
||||||
_defaultConfig: function () { |
@shortcut() |
||||||
return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this, arguments), { |
export class TreeValueChooserPane extends AbstractTreeValueChooser { |
||||||
|
static xtype = "bi.tree_value_chooser_pane"; |
||||||
|
|
||||||
|
static EVENT_CHANGE = "EVENT_CHANGE"; |
||||||
|
|
||||||
|
_defaultConfig() { |
||||||
|
return extend(super._defaultConfig(...arguments), { |
||||||
baseCls: "bi-tree-value-chooser-pane", |
baseCls: "bi-tree-value-chooser-pane", |
||||||
items: null, |
items: null, |
||||||
itemsCreator: BI.emptyFn, |
itemsCreator: emptyFn, |
||||||
showLine: true |
showLine: true, |
||||||
}); |
}); |
||||||
}, |
} |
||||||
|
|
||||||
_init: function () { |
_init() { |
||||||
BI.TreeValueChooserPane.superclass._init.apply(this, arguments); |
super._init(...arguments); |
||||||
var self = this, o = this.options; |
const o = this.options; |
||||||
this.pane = BI.createWidget({ |
this.pane = createWidget({ |
||||||
type: o.hideSearch ? "bi.multi_select_tree_popup" : "bi.multi_select_tree", |
type: o.hideSearch ? MultiSelectTreePopup.xtype : MultiSelectTree.xtype, |
||||||
element: this, |
element: this, |
||||||
showLine: o.showLine, |
showLine: o.showLine, |
||||||
itemsCreator: BI.bind(this._itemsCreator, this) |
itemsCreator: bind(this._itemsCreator, this), |
||||||
}); |
}); |
||||||
|
|
||||||
this.pane.on(BI.MultiSelectTree.EVENT_CHANGE, function () { |
this.pane.on(MultiSelectTree.EVENT_CHANGE, () => { |
||||||
self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE); |
this.fireEvent(TreeValueChooserPane.EVENT_CHANGE); |
||||||
}); |
}); |
||||||
if (BI.isNotNull(o.value)) { |
if (isNotNull(o.value)) { |
||||||
var selectedValues = this.assertSelectedValue(o.value, o.items); |
const selectedValues = this.assertSelectedValue(o.value, o.items); |
||||||
this.pane.setSelectedValue(selectedValues); |
this.pane.setSelectedValue(selectedValues); |
||||||
} |
} |
||||||
if (BI.isNotNull(o.items)) { |
if (isNotNull(o.items)) { |
||||||
this._initData(o.items); |
this._initData(o.items); |
||||||
this.pane.populate(); |
this.pane.populate(); |
||||||
} |
} |
||||||
}, |
} |
||||||
|
|
||||||
setSelectedValue: function (v) { |
setSelectedValue(v) { |
||||||
this.pane.setSelectedValue(v); |
this.pane.setSelectedValue(v); |
||||||
}, |
} |
||||||
|
|
||||||
setValue: function (v) { |
setValue(v) { |
||||||
this.pane.setValue(v); |
this.pane.setValue(v); |
||||||
}, |
} |
||||||
|
|
||||||
getValue: function () { |
getValue() { |
||||||
return this.pane.getValue(); |
return this.pane.getValue(); |
||||||
}, |
} |
||||||
|
|
||||||
getAllValue: function() { |
getAllValue() { |
||||||
return this.buildCompleteTree(this.pane.getValue()); |
return this.buildCompleteTree(this.pane.getValue()); |
||||||
}, |
} |
||||||
|
|
||||||
populate: function (items) { |
populate(items) { |
||||||
if (BI.isNotNull(items)) { |
if (isNotNull(items)) { |
||||||
this._initData(items); |
this._initData(items); |
||||||
} |
} |
||||||
this.pane.populate(); |
this.pane.populate(); |
||||||
} |
} |
||||||
}); |
} |
||||||
BI.TreeValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE"; |
|
||||||
BI.shortcut("bi.tree_value_chooser_pane", BI.TreeValueChooserPane); |
|
||||||
|
Loading…
Reference in new issue