/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const userRouter = {
  path: '/user',
  component: Layout,
  redirect: '/user/club',
  alwaysShow: true, // will always show the root menu
  name: 'userSetting', // name必须和后台配置一致，不然匹配不到
  meta: { title: '用户管理', icon: 'user' },
  children: [
    {
      path: 'record',
      component: () => import('@/views/index'),
      redirect: '/user/record/list',
      name: 'UserRecordMenu',
      meta: { title: '用户行为记录', icon: 'international' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/user/record/list'),
          name: 'RecordList',
          meta: { title: '用户行为记录', activeMenu: '/user/record' }
        },
        {
          path: 'detail',
          hidden: true,
          component: () => import('@/views/user/record/detail-list.vue'),
          name: 'RecordDtails',
          meta: { title: '查看详情', activeMenu: '/user/record/' }
        }
      ]
    },
    {
      path: 'club',
      name: 'UserClubMenu',
      redirect: '/user/club/list',
      alwaysShow: true,
      component: () => import('@/views/index'),
      meta: { title: '机构管理' },
      children: [
        {
          path: 'list',
          name: 'ClubList',
          component: () => import('@/views/user/club/list'),
          meta: { title: '机构列表' }
        }
      ]
    },
    {
      path: 'supplier',
      name: 'UserSupplierMenu',
      redirect: '/user/supplier/list',
      alwaysShow: true,
      component: () => import('@/views/index'),
      meta: { title: '供应商管理', useDefault: true },
      children: [
        {
          path: 'list',
          name: 'SupplierAllList',
          component: () => import('@/views/user/supplier/list'),
          meta: { title: '供应商列表' }
        }
      ]
    }
  ]
}
export default userRouter
