fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.9 KiB

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";
@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: emptyFn,
showLine: true,
});
}
_init() {
super._init(...arguments);
const o = this.options;
this.pane = createWidget({
type: o.hideSearch ? MultiSelectTreePopup.xtype : MultiSelectTree.xtype,
element: this,
showLine: o.showLine,
itemsCreator: bind(this._itemsCreator, this),
});
this.pane.on(MultiSelectTree.EVENT_CHANGE, () => {
this.fireEvent(TreeValueChooserPane.EVENT_CHANGE);
});
if (isNotNull(o.value)) {
const selectedValues = this.assertSelectedValue(o.value, o.items);
this.pane.setSelectedValue(selectedValues);
3 years ago
}
if (isNotNull(o.items)) {
this._initData(o.items);
5 years ago
this.pane.populate();
}
}
setSelectedValue(v) {
8 years ago
this.pane.setSelectedValue(v);
}
8 years ago
setValue(v) {
this.pane.setValue(v);
}
getValue() {
return this.pane.getValue();
}
getAllValue() {
5 years ago
return this.buildCompleteTree(this.pane.getValue());
}
populate(items) {
if (isNotNull(items)) {
this._initData(items);
}
this.pane.populate();
}
}