classTreeNode{ constructor(id,parentId,name,children=[]){ this.id=id; this.parentId=parentId; this.name=name; this.children=children; } //添加子节点 addChildren(node){ this.children.push(node); } //删除子节点 deleteChildren(nodeId){ this.children=this.children.filter(child=>child.id!nodeId); } } classT...