nex_basse/frontend/test-perm-node.tsx

32 lines
819 B
TypeScript

// Quick structure check - verifying PermNodeView component logic
const testNode = {
perm_id: 1,
parent_id: null,
name: "系统管理",
perm_type: "menu",
level: 0,
children: [
{
perm_id: 2,
parent_id: 1,
name: "用户管理",
perm_type: "menu",
level: 1,
children: [
{
perm_id: 3,
parent_id: 2,
name: "查看用户",
perm_type: "button",
level: 2,
children: undefined
}
]
}
]
};
console.log("✓ Parent node:", testNode.name, "has", testNode.children.length, "children");
console.log("✓ Child node:", testNode.children[0].name, "has", testNode.children[0].children.length, "children");
console.log("✓ Leaf node:", testNode.children[0].children[0].name, "has no children");