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.

99 lines
3.4 KiB

import { shortcut, Widget, isNull } from "@/core";
import { TreeView } from "@/case";
8 years ago
@shortcut()
export class Func extends Widget {
static xtype = "demo.part_tree";
props = { baseCls: "demo-func" };
mounted() {
6 years ago
this.partTree.stroke({
keyword: "1",
6 years ago
});
}
render() {
const self = this;
6 years ago
return {
type: "bi.vtape",
items: [
{
type: "bi.label",
height: 50,
text: "先初始化一份数据,然后再异步获取数据的树",
6 years ago
},
{
type: "bi.part_tree",
ref(_ref) {
self.partTree = _ref;
},
paras: {
selectedValues: { 1: {}, 2: { 1: {} } },
},
itemsCreator(op, callback) {
if (op.type === TreeView.REQ_TYPE_INIT_DATA) {
callback({
items: [
{
id: "1",
text: 1,
isParent: true,
open: true,
},
{
id: "11",
pId: "1",
text: 11,
isParent: true,
open: true,
},
{
id: "111",
pId: "11",
text: 111,
isParent: true,
},
{
id: "2",
text: 2,
},
{
id: "3",
text: 3,
}
],
hasNext: isNull(op.id),
});
return;
}
6 years ago
callback({
items: [
{
id: `${op.id || ""}1`,
pId: op.id,
text: 1,
isParent: true,
},
{
id: `${op.id || ""}2`,
pId: op.id,
text: 2,
},
{
id: `${op.id || ""}3`,
pId: op.id,
text: 3,
}
],
hasNext: isNull(op.id),
6 years ago
});
},
6 years ago
}
],
6 years ago
};
8 years ago
}
}