|
@@ -91,12 +91,6 @@ export class Tree {
|
|
|
});
|
|
});
|
|
|
return rawData as TreeNode[];
|
|
return rawData as TreeNode[];
|
|
|
}
|
|
}
|
|
|
- /* genNodeContext(rawData: TreeRaw[]): TreeNode[] {
|
|
|
|
|
- rawData.forEach(item => {
|
|
|
|
|
- item.getCtx() = new NodeContext(item as TreeNode, this);
|
|
|
|
|
- });
|
|
|
|
|
- return rawData as TreeNode[];
|
|
|
|
|
- } */
|
|
|
|
|
|
|
|
|
|
// 生成映射表
|
|
// 生成映射表
|
|
|
private genMap(data: TreeNode[]): void {
|
|
private genMap(data: TreeNode[]): void {
|
|
@@ -309,12 +303,6 @@ export class Tree {
|
|
|
// 建立映射、插入数据
|
|
// 建立映射、插入数据
|
|
|
const nodes = this.genNodeContext(items);
|
|
const nodes = this.genNodeContext(items);
|
|
|
this.genMap(nodes);
|
|
this.genMap(nodes);
|
|
|
- /* nodes.forEach(node => {
|
|
|
|
|
- this.IDMap[node.ID] = node;
|
|
|
|
|
- (
|
|
|
|
|
- this.parentMap[node.parentID] || (this.parentMap[node.parentID] = [])
|
|
|
|
|
- ).push(node);
|
|
|
|
|
- }); */
|
|
|
|
|
this.rawData.push(...nodes);
|
|
this.rawData.push(...nodes);
|
|
|
// 排序
|
|
// 排序
|
|
|
this.reSortData(nodes);
|
|
this.reSortData(nodes);
|