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.
 
 
 

76 lines
1.9 KiB

import { Listtreeview } from "./list/listtreeview";
import { each, shortcut, i18nText } from "@/core";
import $ from "jquery";
/**
* guy
* 异步树
* @class ListListDisplayTree
* @extends TreeView
*/
@shortcut()
export class ListDisplayTree extends Listtreeview {
static xtype = "bi.list_display_tree";
static EVENT_CHANGE = "EVENT_CHANGE";
props() {
return {
extraCls: "bi-list-display-tree",
};
}
// 配置属性
_configSetting() {
function beforeCollapse(treeId, treeNode) {
return false;
}
function getFont(treeId, node) {
return node.isLeaf ? {} : { color: "#999999" };
}
return {
view: {
selectedMulti: false,
dblClickExpand: false,
showIcon: false,
nameIsHTML: true,
showTitle: false,
fontCss: getFont,
},
data: {
key: {
title: "title",
name: "text",
},
simpleData: {
enable: true,
},
},
callback: {
beforeCollapse,
},
};
}
_dealWidthNodes(nodes) {
nodes = super._dealWidthNodes(...arguments);
each(nodes, (i, node) => {
node.isParent = node.isParent || node.parent;
if (node.text == null) {
if (node.count > 0) {
node.text = `${node.value}(${i18nText("BI-Basic_Altogether")}${node.count}${i18nText(
"BI-Basic_Count"
)})`;
}
}
});
return nodes;
}
initTree(nodes, setting) {
this.nodes = $.fn.zTree.init(this.tree.element, setting || this._configSetting(), nodes);
}
}