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 form from "./form"; |
||||
export * as valueChooser from "./valuechooser"; |
||||
export * as treeValueChooser from "./treevaluechooser"; |
||||
export { AllValueMultiTextValueCombo } from "./allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; |
||||
|
||||
// Object.assign(BI, {
|
||||
// ...allvaluechooser,
|
||||
// ...form,
|
||||
// ...valueChooser,
|
||||
// ......treeValueChooser,
|
||||
// AllValueMultiTextValueCombo,
|
||||
// });
|
||||
|
||||
// export * from "./allvaluechooser";
|
||||
// export * from "./form";
|
||||
// export * from "./valuechooser";
|
||||
// export * from "./treevaluechooser";
|
||||
// export {
|
||||
// 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 @@
|
||||
/** |
||||
* 简单的树面板, 适用于数据量少的情况 |
||||
* |
||||
* Created by GUY on 2015/10/29. |
||||
* @class BI.TreeValueChooserPane |
||||
* @extends BI.AbstractTreeValueChooser |
||||
*/ |
||||
BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { |
||||
import { shortcut, extend, emptyFn, createWidget, bind, isNotNull } from "@/core"; |
||||
import { AbstractTreeValueChooser } from "./abstract.treevaluechooser"; |
||||
import { MultiSelectTree } from "@/widget/multiselecttree/multiselecttree"; |
||||
import { MultiSelectTreePopup } from "@/widget/multiselecttree/multiselecttree.popup"; |
||||
|
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this, arguments), { |
||||
@shortcut() |
||||
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", |
||||
items: null, |
||||
itemsCreator: BI.emptyFn, |
||||
showLine: true |
||||
itemsCreator: emptyFn, |
||||
showLine: true, |
||||
}); |
||||
}, |
||||
} |
||||
|
||||
_init: function () { |
||||
BI.TreeValueChooserPane.superclass._init.apply(this, arguments); |
||||
var self = this, o = this.options; |
||||
this.pane = BI.createWidget({ |
||||
type: o.hideSearch ? "bi.multi_select_tree_popup" : "bi.multi_select_tree", |
||||
_init() { |
||||
super._init(...arguments); |
||||
const o = this.options; |
||||
this.pane = createWidget({ |
||||
type: o.hideSearch ? MultiSelectTreePopup.xtype : MultiSelectTree.xtype, |
||||
element: this, |
||||
showLine: o.showLine, |
||||
itemsCreator: BI.bind(this._itemsCreator, this) |
||||
itemsCreator: bind(this._itemsCreator, this), |
||||
}); |
||||
|
||||
this.pane.on(BI.MultiSelectTree.EVENT_CHANGE, function () { |
||||
self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE); |
||||
this.pane.on(MultiSelectTree.EVENT_CHANGE, () => { |
||||
this.fireEvent(TreeValueChooserPane.EVENT_CHANGE); |
||||
}); |
||||
if (BI.isNotNull(o.value)) { |
||||
var selectedValues = this.assertSelectedValue(o.value, o.items); |
||||
if (isNotNull(o.value)) { |
||||
const selectedValues = this.assertSelectedValue(o.value, o.items); |
||||
this.pane.setSelectedValue(selectedValues); |
||||
} |
||||
if (BI.isNotNull(o.items)) { |
||||
if (isNotNull(o.items)) { |
||||
this._initData(o.items); |
||||
this.pane.populate(); |
||||
} |
||||
}, |
||||
} |
||||
|
||||
setSelectedValue: function (v) { |
||||
setSelectedValue(v) { |
||||
this.pane.setSelectedValue(v); |
||||
}, |
||||
} |
||||
|
||||
setValue: function (v) { |
||||
setValue(v) { |
||||
this.pane.setValue(v); |
||||
}, |
||||
} |
||||
|
||||
getValue: function () { |
||||
getValue() { |
||||
return this.pane.getValue(); |
||||
}, |
||||
} |
||||
|
||||
getAllValue: function() { |
||||
getAllValue() { |
||||
return this.buildCompleteTree(this.pane.getValue()); |
||||
}, |
||||
} |
||||
|
||||
populate: function (items) { |
||||
if (BI.isNotNull(items)) { |
||||
populate(items) { |
||||
if (isNotNull(items)) { |
||||
this._initData(items); |
||||
} |
||||
this.pane.populate(); |
||||
} |
||||
}); |
||||
BI.TreeValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
BI.shortcut("bi.tree_value_chooser_pane", BI.TreeValueChooserPane); |
||||
} |
||||
|
Loading…
Reference in new issue