SOURCE

var arr = [
    {
        "id": 1000,
        "parentId": -1,
        "weight": 1,
        "name": "工作台",
        "path": "/",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "",
        "icon": "icon_workbench",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "工作台",
        "children": [
            {
                "id": 1100,
                "parentId": 1000,
                "weight": 1,
                "name": "工作台",
                "path": "dashboard",
                "component": "@/views/dashboard/index",
                "hidden": false,
                "routerName": "工作台",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 14:33:36",
                "title": "工作台"
            }
        ]
    },
    {
        "id": 2000,
        "parentId": -1,
        "weight": 2,
        "name": "机器人",
        "path": "/robot",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Robot",
        "icon": "icon_robot",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "机器人",
        "children": [
            {
                "id": 2100,
                "parentId": 2000,
                "weight": 1,
                "name": "机器人列表",
                "path": "list",
                "component": "@/views/robot/index",
                "hidden": false,
                "routerName": "Robot-List",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-01 14:58:49",
                "title": "机器人列表",
                "children": [
                    {
                        "id": 2101,
                        "parentId": 2100,
                        "weight": 1,
                        "name": "新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_add",
                        "updateTime": "2022-08-03 14:21:50",
                        "title": ""
                    },
                    {
                        "id": 2102,
                        "parentId": 2100,
                        "weight": 2,
                        "name": "设置",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_edit",
                        "updateTime": "2022-08-08 14:12:21",
                        "title": ""
                    },
                    {
                        "id": 2104,
                        "parentId": 2100,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_del",
                        "updateTime": "2022-08-08 14:28:26",
                        "title": ""
                    }
                ]
            },
            {
                "id": 2200,
                "parentId": 2000,
                "weight": 2,
                "name": "设备管理",
                "path": "/robot/manager/:id?",
                "component": "@/views/robot/manager/index",
                "hidden": false,
                "routerName": "Robot-Manager",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-11 14:46:47",
                "title": "设备管理",
                "children": [
                    {
                        "id": 2201,
                        "parentId": 2200,
                        "weight": 1,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "device_edit",
                        "updateTime": "2022-08-03 14:25:58",
                        "title": ""
                    }
                ]
            }
        ]
    },
    {
        "id": 4000,
        "parentId": -1,
        "weight": 3,
        "name": "技能",
        "path": "/skill",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Skill",
        "icon": "nested",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "技能",
        "children": [
            {
                "id": 4100,
                "parentId": 4000,
                "weight": 1,
                "name": "技能列表",
                "path": "list",
                "component": "@/views/skill/index",
                "hidden": false,
                "routerName": "Skill-List",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-02 10:42:42",
                "title": "技能列表",
                "children": [
                    {
                        "id": 4101,
                        "parentId": 4100,
                        "weight": 1,
                        "name": "新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "skill_add",
                        "updateTime": "2022-08-03 14:27:13",
                        "title": ""
                    },
                    {
                        "id": 4102,
                        "parentId": 4100,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "skill_edit",
                        "updateTime": "2022-08-03 14:30:57",
                        "title": ""
                    },
                    {
                        "id": 4103,
                        "parentId": 4100,
                        "weight": 3,
                        "name": "图形编辑器",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "skill_design",
                        "updateTime": "2022-08-10 13:50:50",
                        "title": ""
                    },
                    {
                        "id": 4104,
                        "parentId": 4100,
                        "weight": 4,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "skill_del",
                        "updateTime": "2022-08-02 10:46:47",
                        "title": ""
                    }
                ]
            }
        ]
    },
    {
        "id": 8000,
        "parentId": -1,
        "weight": 6,
        "name": "流程管理",
        "path": "/template",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Template",
        "icon": "process-manage",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "流程管理",
        "children": [
            {
                "id": 8100,
                "parentId": 8000,
                "weight": 1,
                "name": "模板管理",
                "path": "/template/list",
                "component": "@/views/template/index",
                "hidden": false,
                "routerName": "Template-List",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-02 14:28:22",
                "title": "模板管理",
                "children": [
                    {
                        "id": 8101,
                        "parentId": 8100,
                        "weight": 1,
                        "name": "新建模板",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_template_add",
                        "updateTime": "2022-08-02 14:33:00",
                        "title": ""
                    },
                    {
                        "id": 8102,
                        "parentId": 8100,
                        "weight": 2,
                        "name": "删除模板",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_template_del",
                        "updateTime": "2022-08-02 14:33:21",
                        "title": ""
                    },
                    {
                        "id": 8103,
                        "parentId": 8100,
                        "weight": 3,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_template_edit",
                        "updateTime": "2022-08-02 14:34:18",
                        "title": ""
                    },
                    {
                        "id": 8104,
                        "parentId": 8100,
                        "weight": 4,
                        "name": "流程设计",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_template_design",
                        "updateTime": "2022-08-03 15:17:10",
                        "title": ""
                    }
                ]
            },
            {
                "id": 8200,
                "parentId": 8000,
                "weight": 2,
                "name": "流程模板",
                "path": "/template/processtem",
                "component": "@/views/template/processtemplate",
                "hidden": false,
                "routerName": "Process-Template",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-09 14:36:27",
                "title": "流程模板",
                "children": [
                    {
                        "id": 8201,
                        "parentId": 8200,
                        "weight": 1,
                        "name": "发布模板",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_publish",
                        "updateTime": "2022-08-03 15:08:40",
                        "title": ""
                    }
                ]
            },
            {
                "id": 8300,
                "parentId": 8000,
                "weight": 3,
                "name": "发布流程",
                "path": "/release",
                "component": "@/views/process/release",
                "hidden": false,
                "routerName": "Template-Design",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-09 15:01:31",
                "title": "发布流程"
            }
        ]
    },
    {
        "id": 9000,
        "parentId": -1,
        "weight": 7,
        "name": "流程处理",
        "path": "/process",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Process",
        "icon": "process-deal",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "流程处理",
        "children": [
            {
                "id": 9100,
                "parentId": 9000,
                "weight": 1,
                "name": "待办流程",
                "path": "list",
                "component": "@/views/process/index",
                "hidden": false,
                "routerName": "Process-List",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-02 15:25:11",
                "title": "待办流程",
                "children": [
                    {
                        "id": 9101,
                        "parentId": 9100,
                        "weight": 1,
                        "name": "处理",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_todo_handle",
                        "updateTime": "2022-08-03 15:12:34",
                        "title": ""
                    },
                    {
                        "id": 9102,
                        "parentId": 9100,
                        "weight": 2,
                        "name": "终止",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_todo_stop",
                        "updateTime": "2022-08-03 15:12:40",
                        "title": ""
                    }
                ]
            },
            {
                "id": 9200,
                "parentId": 9000,
                "weight": 2,
                "name": "已办流程",
                "path": "/process/done",
                "component": "@/views/process/done",
                "hidden": false,
                "routerName": "Done-Process",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 14:10:06",
                "title": "已办流程"
            },
            {
                "id": 9300,
                "parentId": 9000,
                "weight": 3,
                "name": "我的流程",
                "path": "/process/my",
                "component": "@/views/process/my",
                "hidden": false,
                "routerName": "My-Process",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 14:10:07",
                "title": "我的流程",
                "children": [
                    {
                        "id": 9302,
                        "parentId": 9300,
                        "weight": 1,
                        "name": "终止",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "process_stop",
                        "updateTime": "2022-08-02 17:19:03",
                        "title": ""
                    }
                ]
            }
        ]
    },
    {
        "id": 10000,
        "parentId": -1,
        "weight": 8,
        "name": "项目",
        "path": "/project",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Project",
        "icon": "icon_project",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "项目",
        "children": [
            {
                "id": 10100,
                "parentId": 10000,
                "weight": 1,
                "name": "项目列表",
                "path": "list",
                "component": "@/views/project/index",
                "hidden": false,
                "routerName": "Project-List",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-02 17:28:52",
                "title": "项目列表",
                "children": [
                    {
                        "id": 10101,
                        "parentId": 10100,
                        "weight": 1,
                        "name": "新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "project_add",
                        "updateTime": "2022-08-03 15:13:19",
                        "title": ""
                    },
                    {
                        "id": 10102,
                        "parentId": 10100,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "project_edit",
                        "updateTime": "2022-08-03 15:14:30",
                        "title": ""
                    },
                    {
                        "id": 10103,
                        "parentId": 10100,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "project_del",
                        "updateTime": "2022-08-03 11:06:26",
                        "title": ""
                    }
                ]
            }
        ]
    },
    {
        "id": 11000,
        "parentId": -1,
        "weight": 9,
        "name": "任务",
        "path": "/task",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Task",
        "icon": "icon_task",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "任务",
        "children": [
            {
                "id": 11100,
                "parentId": 11000,
                "weight": 1,
                "name": "任务调度列表",
                "path": "dispatch",
                "component": "@/views/task/dispatch/index",
                "hidden": false,
                "routerName": "Task-Dispatch",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 10:03:12",
                "title": "任务调度列表",
                "children": [
                    {
                        "id": 11101,
                        "parentId": 11100,
                        "weight": 1,
                        "name": "新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "dispatch_add",
                        "updateTime": "2022-08-03 15:15:25",
                        "title": ""
                    },
                    {
                        "id": 11102,
                        "parentId": 11100,
                        "weight": 2,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "dispatch_del",
                        "updateTime": "2022-08-03 10:06:08",
                        "title": ""
                    },
                    {
                        "id": 11103,
                        "parentId": 11100,
                        "weight": 3,
                        "name": "启动",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "dispatch_task_start",
                        "updateTime": "2022-08-03 10:06:08",
                        "title": ""
                    },
                    {
                        "id": 11104,
                        "parentId": 11100,
                        "weight": 4,
                        "name": "终止",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "dispatch_task_stop",
                        "updateTime": "2022-08-03 10:06:09",
                        "title": ""
                    },
                    {
                        "id": 11105,
                        "parentId": 11100,
                        "weight": 5,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "dispatch_edit",
                        "updateTime": "2022-08-03 15:15:56",
                        "title": ""
                    }
                ]
            },
            {
                "id": 11200,
                "parentId": 11000,
                "weight": 2,
                "name": "任务执行列表",
                "path": "/task/execute/:id",
                "component": "@/views/task/execute/index",
                "hidden": false,
                "routerName": "Task-Execute",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 10:11:03",
                "title": "任务执行列表"
            }
        ]
    },
    {
        "id": 12000,
        "parentId": -1,
        "weight": 10,
        "name": "监控",
        "path": "/monitor",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Monitor",
        "icon": "icon_monitor",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "监控",
        "children": [
            {
                "id": 12100,
                "parentId": 12000,
                "weight": 1,
                "name": "设备运行状态",
                "path": "list",
                "component": "@/views/monitor/index",
                "hidden": false,
                "routerName": "Monitor-list",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 13:55:01",
                "title": "设备运行状态"
            }
        ]
    },
    {
        "id": 13000,
        "parentId": -1,
        "weight": 11,
        "name": "报表",
        "path": "/report",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "",
        "icon": "icon_report",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "报表",
        "children": [
            {
                "id": 13100,
                "parentId": 13000,
                "weight": 1,
                "name": "机器人统计",
                "path": "robot",
                "component": "@/views/report/robot",
                "hidden": false,
                "routerName": "Report-robot",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 10:55:11",
                "title": "机器人统计",
                "children": [
                    {
                        "id": 13101,
                        "parentId": 13100,
                        "weight": 1,
                        "name": "导出",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "statistics_robot_export",
                        "updateTime": "2022-08-03 10:55:08",
                        "title": ""
                    }
                ]
            },
            {
                "id": 13200,
                "parentId": 13000,
                "weight": 1,
                "name": "设备使用统计",
                "path": "list",
                "component": "@/views/report/index",
                "hidden": false,
                "routerName": "Report-list",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 11:35:32",
                "title": "设备使用统计",
                "children": [
                    {
                        "id": 13201,
                        "parentId": 13200,
                        "weight": 1,
                        "name": "导出",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "statistics_device_export",
                        "updateTime": "2022-08-03 10:55:02",
                        "title": ""
                    }
                ]
            },
            {
                "id": 13300,
                "parentId": 13000,
                "weight": 1,
                "name": "技能统计",
                "path": "kill",
                "component": "@/views/report/kill",
                "hidden": false,
                "routerName": "Report-kill",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-09 16:33:26",
                "title": "技能统计",
                "children": [
                    {
                        "id": 13301,
                        "parentId": 13300,
                        "weight": 1,
                        "name": "导出",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "statistics_skill_export",
                        "updateTime": "2022-08-03 10:54:55",
                        "title": ""
                    }
                ]
            },
            {
                "id": 13500,
                "parentId": 13000,
                "weight": 1,
                "name": "调度任务统计",
                "path": "dispatch",
                "component": "@/views/report/dispatch",
                "hidden": false,
                "routerName": "Report-dispatch",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 11:34:46",
                "title": "调度任务统计",
                "children": [
                    {
                        "id": 13501,
                        "parentId": 13500,
                        "weight": 1,
                        "name": "导出",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "statistics_dispatch_task_export",
                        "updateTime": "2022-08-03 10:54:43",
                        "title": ""
                    }
                ]
            },
            {
                "id": 13600,
                "parentId": 13000,
                "weight": 1,
                "name": "执行任务统计",
                "path": "execute",
                "component": "@/views/report/execute",
                "hidden": false,
                "routerName": "Report-execute",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 11:34:33",
                "title": "执行任务统计",
                "children": [
                    {
                        "id": 13601,
                        "parentId": 13600,
                        "weight": 1,
                        "name": "导出",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "statistics_execute_task_export",
                        "updateTime": "2022-08-03 10:54:36",
                        "title": ""
                    }
                ]
            }
        ]
    },
    {
        "id": 15000,
        "parentId": -1,
        "weight": 12,
        "name": "设置",
        "path": "/setting",
        "component": "@/layout/index",
        "hidden": false,
        "routerName": "Setting",
        "icon": "set",
        "menuType": 0,
        "permission": "",
        "updateTime": "2022-08-04 10:23:13",
        "title": "设置",
        "children": [
            {
                "id": 15100,
                "parentId": 15000,
                "weight": 1,
                "name": "企业",
                "path": "enterprise",
                "component": "@/views/setting/enterprise",
                "hidden": false,
                "routerName": "Enterprise",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 13:49:05",
                "title": "企业",
                "children": [
                    {
                        "id": 15101,
                        "parentId": 15100,
                        "weight": 1,
                        "name": "保存",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "enterprise_save",
                        "updateTime": "2022-08-04 13:50:26",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15200,
                "parentId": 15000,
                "weight": 2,
                "name": "部门",
                "path": "department",
                "component": "@/views/setting/department",
                "hidden": false,
                "routerName": "Department",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 14:21:02",
                "title": "部门",
                "children": [
                    {
                        "id": 15201,
                        "parentId": 15200,
                        "weight": 1,
                        "name": "添加",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "depart_add",
                        "updateTime": "2022-08-04 13:50:46",
                        "title": ""
                    },
                    {
                        "id": 15202,
                        "parentId": 15200,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "depart_edit",
                        "updateTime": "2022-08-04 13:50:47",
                        "title": ""
                    },
                    {
                        "id": 15203,
                        "parentId": 15200,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "depart_del",
                        "updateTime": "2022-08-04 13:50:48",
                        "title": ""
                    },
                    {
                        "id": 15204,
                        "parentId": 15200,
                        "weight": 4,
                        "name": "上移",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "depart_up",
                        "updateTime": "2022-08-04 13:50:49",
                        "title": ""
                    },
                    {
                        "id": 15205,
                        "parentId": 15200,
                        "weight": 5,
                        "name": "下移",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "depart_down",
                        "updateTime": "2022-08-04 13:50:51",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15300,
                "parentId": 15000,
                "weight": 3,
                "name": "角色",
                "path": "role",
                "component": "@/views/setting/role",
                "hidden": false,
                "routerName": "Role",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 14:21:13",
                "title": "角色",
                "children": [
                    {
                        "id": 15301,
                        "parentId": 15300,
                        "weight": 1,
                        "name": "新增",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "role_add",
                        "updateTime": "2022-08-04 13:50:52",
                        "title": ""
                    },
                    {
                        "id": 15302,
                        "parentId": 15300,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "role_edit",
                        "updateTime": "2022-08-04 13:50:53",
                        "title": ""
                    },
                    {
                        "id": 15303,
                        "parentId": 15300,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "role_del",
                        "updateTime": "2022-08-04 13:50:55",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15400,
                "parentId": 15000,
                "weight": 4,
                "name": "用户",
                "path": "user",
                "component": "@/views/setting/user",
                "hidden": false,
                "routerName": "User",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-03 14:21:32",
                "title": "用户",
                "children": [
                    {
                        "id": 15401,
                        "parentId": 15400,
                        "weight": 1,
                        "name": "新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "user_add",
                        "updateTime": "2022-08-04 13:51:09",
                        "title": ""
                    },
                    {
                        "id": 15402,
                        "parentId": 15400,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "user_edit",
                        "updateTime": "2022-08-04 13:51:10",
                        "title": ""
                    },
                    {
                        "id": 15403,
                        "parentId": 15400,
                        "weight": 3,
                        "name": "签退",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "user_sign_out",
                        "updateTime": "2022-08-04 13:51:12",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15900,
                "parentId": 15000,
                "weight": 5,
                "name": "菜单管理",
                "path": "menuManage",
                "component": "@/views/setting/menuManage",
                "hidden": false,
                "routerName": "menuManage",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 16:10:09",
                "title": "菜单管理"
            },
            {
                "id": 15500,
                "parentId": 15000,
                "weight": 6,
                "name": "操作日志",
                "path": "log",
                "component": "@/views/setting/log",
                "hidden": false,
                "routerName": "Log",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 15:41:42",
                "title": "操作日志"
            },
            {
                "id": 15600,
                "parentId": 15000,
                "weight": 7,
                "name": "表单管理",
                "path": "formManage",
                "component": "@/views/formManage/index",
                "hidden": false,
                "routerName": "formManage",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-05 09:45:12",
                "title": "表单管理",
                "children": [
                    {
                        "id": 15601,
                        "parentId": 15600,
                        "weight": 1,
                        "name": "自定义表单",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_custom_add",
                        "updateTime": "2022-08-04 13:51:16",
                        "title": ""
                    },
                    {
                        "id": 15602,
                        "parentId": 15600,
                        "weight": 2,
                        "name": "导入表单",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_import",
                        "updateTime": "2022-08-04 13:51:20",
                        "title": ""
                    },
                    {
                        "id": 15603,
                        "parentId": 15600,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_del",
                        "updateTime": "2022-08-04 13:51:20",
                        "title": ""
                    },
                    {
                        "id": 15604,
                        "parentId": 15600,
                        "weight": 4,
                        "name": "分类新建",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_classify_add",
                        "updateTime": "2022-08-04 13:51:21",
                        "title": ""
                    },
                    {
                        "id": 15605,
                        "parentId": 15600,
                        "weight": 5,
                        "name": "分类修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_classify_edit",
                        "updateTime": "2022-08-04 13:51:22",
                        "title": ""
                    },
                    {
                        "id": 15606,
                        "parentId": 15600,
                        "weight": 6,
                        "name": "分类删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "form_classify_del",
                        "updateTime": "2022-08-04 13:51:23",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15700,
                "parentId": 15000,
                "weight": 8,
                "name": "资源管理",
                "path": "resource",
                "component": "@/views/setting/resourceManage",
                "hidden": false,
                "routerName": "Resource",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 15:41:45",
                "title": "资源管理",
                "children": [
                    {
                        "id": 15701,
                        "parentId": 15700,
                        "weight": 1,
                        "name": "添加",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "resource_add",
                        "updateTime": "2022-08-04 13:51:27",
                        "title": ""
                    },
                    {
                        "id": 15702,
                        "parentId": 15700,
                        "weight": 2,
                        "name": "编辑",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "resource_edit",
                        "updateTime": "2022-08-04 13:51:31",
                        "title": ""
                    },
                    {
                        "id": 15703,
                        "parentId": 15700,
                        "weight": 3,
                        "name": "批量删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "resource_batch_del",
                        "updateTime": "2022-08-04 13:51:32",
                        "title": ""
                    },
                    {
                        "id": 15704,
                        "parentId": 15700,
                        "weight": 4,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "resource_del",
                        "updateTime": "2022-08-04 13:51:36",
                        "title": ""
                    }
                ]
            },
            {
                "id": 15800,
                "parentId": 15000,
                "weight": 9,
                "name": "机器人组",
                "path": "system",
                "component": "@/views/setting/system",
                "hidden": false,
                "routerName": "System",
                "icon": "",
                "menuType": 0,
                "permission": "",
                "updateTime": "2022-08-04 15:41:46",
                "title": "机器人组",
                "children": [
                    {
                        "id": 15801,
                        "parentId": 15800,
                        "weight": 1,
                        "name": "添加",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_group_add",
                        "updateTime": "2022-08-04 13:51:37",
                        "title": ""
                    },
                    {
                        "id": 15802,
                        "parentId": 15800,
                        "weight": 2,
                        "name": "修改",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_group_edit",
                        "updateTime": "2022-08-04 13:51:38",
                        "title": ""
                    },
                    {
                        "id": 15803,
                        "parentId": 15800,
                        "weight": 3,
                        "name": "删除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_group_del",
                        "updateTime": "2022-08-04 13:51:39",
                        "title": ""
                    },
                    {
                        "id": 15804,
                        "parentId": 15800,
                        "weight": 4,
                        "name": "成员添加",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_group_member_add",
                        "updateTime": "2022-08-04 13:51:39",
                        "title": ""
                    },
                    {
                        "id": 15805,
                        "parentId": 15800,
                        "weight": 5,
                        "name": "成员移除",
                        "path": "",
                        "component": "",
                        "hidden": true,
                        "routerName": "",
                        "icon": "",
                        "menuType": 1,
                        "permission": "robot_group_member_del",
                        "updateTime": "2022-08-04 13:51:42",
                        "title": ""
                    }
                ]
            }
        ]
    }
]; function getPathById(arr, id, callback) {

    for (let i = 0; i < arr.length; i++) {
        let catalog = arr[i]
        //定义变量保存当前结果路径
        let temppath = [];
        try {
            function getNodePath(node) {
                temppath.push(node.id);

                //找到符合条件的节点,通过throw终止掉递归
                if (node.id === id) {
                    throw ('GOT IT!');
                }
                if (node.children && node.children.length > 0) {
                    for (let i = 0; i < node.children.length; i++) {
                        getNodePath(node.children[i]);
                    }
                    //当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
                    temppath.pop();
                } else {
                    //找到叶子节点时,删除路径当中的该叶子节点
                    temppath.pop();
                }
            }
            getNodePath(catalog);
        } catch (e) {
            let result = temppath;
            callback(result);
        }
    }
};
    getPathById(arr, 2104, (res) => { console.log(res) })
console 命令行工具 X clear

                    
>
console