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.

68 lines
2.2 KiB

import { shortcut, Widget, deepClone } from "@/core";
import { Msg } from "@/base";
import { TreeView } from "@/case";
@shortcut()
export class MultiTreeCombo extends Widget {
static xtype = "demo.multi_tree_combo";
props = { baseCls: "" };
render() {
const self = this;
const items = deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [
{
type: "bi.multi_tree_combo",
ref(_ref) {
self.tree = _ref;
},
itemsCreator(options, callback) {
console.log(options);
// 根据不同的类型处理相应的结果
switch (options.type) {
case TreeView.REQ_TYPE_INIT_DATA:
break;
case TreeView.REQ_TYPE_ADJUST_DATA:
break;
case TreeView.REQ_TYPE_SELECT_DATA:
break;
case TreeView.REQ_TYPE_GET_SELECTED_DATA:
break;
default:
break;
}
callback({
items,
});
},
width: 300,
value: {
根目录: {},
},
listeners: [
{
eventName: "EVENT_CONFIRM",
action() {
console.log("EVENT_CONFIRM", this.getValue());
},
}
],
},
{
type: "bi.button",
text: "getValue",
handler() {
Msg.toast(JSON.stringify(self.tree.getValue()));
},
width: 300,
}
],
vgap: 20,
7 years ago
};
}
}