|
|
|
import { shortcut, Widget, createWidget } from "@/core";
|
|
|
|
|
|
|
|
@shortcut()
|
|
|
|
export class Func extends Widget {
|
|
|
|
static xtype = "demo.tree_view";
|
|
|
|
|
|
|
|
props = { baseCls: "demo-func" };
|
|
|
|
|
|
|
|
_createDefaultTree() {
|
|
|
|
const tree = createWidget({
|
|
|
|
type: "bi.tree_view",
|
|
|
|
});
|
|
|
|
tree.initTree([
|
|
|
|
{ id: 1, pId: 0, text: "test1", open: true },
|
|
|
|
{ id: 11, pId: 1, text: "test11" },
|
|
|
|
{ id: 12, pId: 1, text: "test12" },
|
|
|
|
{ id: 111, pId: 11, text: "test111" },
|
|
|
|
{ id: 2, pId: 0, text: "test2", open: true },
|
|
|
|
{ id: 21, pId: 2, text: "test21" },
|
|
|
|
{ id: 22, pId: 2, text: "test22" }
|
|
|
|
]);
|
|
|
|
|
|
|
|
return tree;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const self = this;
|
|
|
|
createWidget({
|
|
|
|
type: "bi.grid",
|
|
|
|
columns: 1,
|
|
|
|
rows: 1,
|
|
|
|
element: this,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
column: 0,
|
|
|
|
row: 0,
|
|
|
|
el: {
|
|
|
|
type: "bi.vtape",
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
el: this._createDefaultTree(),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
el: {
|
|
|
|
type: "bi.label",
|
|
|
|
text: "tree.initTree([{\"id\":1, \"pId\":0, \"text\":\"test1\", open:true},{\"id\":11, \"pId\":1, \"text\":\"test11\"},{\"id\":12, \"pId\":1, \"text\":\"test12\"},{\"id\":111, \"pId\":11, \"text\":\"test111\"}])",
|
|
|
|
whiteSpace: "normal",
|
|
|
|
},
|
|
|
|
height: 50,
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|