import { uniqueId } from 'lodash'

/**
 * @description 给菜单数据补充上 path 字段
 * @description https://github.com/d2-projects/d2-admin/issues/209
 * @param {Array} menu 原始的菜单数据
 */
function supplementPath (menu) {
  return menu.map(e => ({
    ...e,
    path: e.path || uniqueId('d2-menu-empty-'),
    ...e.children ? {
      children: supplementPath(e.children)
    } : {}
  }))
}

export const menuHeader = supplementPath([
  { path: '/index', title: '首页', icon: 'home' },
  
 
  {
    title: '仓房展示',
    icon: 'university',
    children: [
      { path: '/warehouseTravel', title: '仓内遨游' },
      { path: '/warehouseInfo', title: '仓房信息' },
     
    ]
  },
  { path: '/alarmRecord', title: '报警记录', icon: 'file-text' },
  { path: '/dataQuery', title: '数据查询', icon: 'pie-chart' },
  {
    title: '系统管理',
    icon: 'th-large',
    children: [
      { path: '/organization', title: '组织机构' },
      { path: '/userManagement', title: '用户管理' },
      { path: '/roleManagement', title: '角色管理' },
      { path: '/announcementManagement', title: '公告管理' },
      { path: '/operationLog', title: '操作日志' },
     
    ]
  },
  {
    title: '参数设置',
    icon: 'cog',
    children: [
      { path: '/hardwareParame', title: '硬件参数' },
      { path: '/scanParame', title: '扫描参数' },
      { path: '/alarmParame', title: '报警参数' },
      { path: '/dataDictionary', title: '数据字典' },
    
     
    ]
  },
])

