Browse Source
# Conflicts: # src/component/treevaluechooser/combo.treevaluechooser.insert.js # src/widget/multitree/multi.tree.combo.jses6
Treecat
2 years ago
11 changed files with 958 additions and 796 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