import Index from 'layout/index/index'
export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
      hideInMenu: true
    },
    // 登录界面
    component: resolve => require(['layout/login/login'], resolve) 
  },
  {
    path: '/',
    name: 'layout',
    redirect: '/enterprise',
    meta: {
      title: '',
      hideInMenu: false
    },
    // 外层视图layout
    component: Index,
    children: [
      {
      path: '/enterprise',
      name: 'enterprise',
      meta: {
        title: '企业信息',
        icon: 'nav_enterprise'
      },
      component: resolve => require(['views/enterprise'], resolve) 
    }, 
    {
      path: '/activity',
      name: 'activity',
      meta: {
        title: '展会管理',
        icon: 'nav_system'
      },
      component: resolve => require(['views/industry'], resolve),
      children: [
        {
          path: 'home',
          name: 'home',
          meta: {
            title: '首页管理',
            noKeepAlive: true
          },
          component: resolve => require(['views/activity/homeAdmin'], resolve),
        },
        {
          path: 'edit',
          name: 'actEdit',
          meta: {
            title: '展会概况'
          },
          component: resolve => require(['views/activity/activityEdit'], resolve),
        },
        {
          path: 'enterpriseList',
          name: 'enterpriseList',
          meta: {
            title: '展商名录',
            noKeepAlive: true
          },
          component: resolve => require(['views/activity/enterpriseList'], resolve),
        },
        {
          path: 'industry',
          name: 'industry',
          meta: {
            title: '企业行业',
            noKeepAlive: true
          },
          component: resolve => require(['views/industry/list'], resolve),
        },
      ]
    },
    {
      path: '/system',
      name: 'system',
      meta: {
        title: '用户信息',
        icon: 'nav_user',
        // 不需要缓存路由组件
        noKeepAlive: true
        // access: ['admin']
      },
      // 用户管理
      component: resolve => require(['views/system'], resolve),
      children: [
        {
          path: 'user',
          name: 'system',
          meta: {
            title: '管理员信息',
            noKeepAlive: true
          },
          component: resolve => require(['views/system/user/list'], resolve),
        },
        {
          path: 'commentator',
          name: 'commentator',
          meta: {
            title: '讲解员信息',
            noKeepAlive: true
          },
          component: resolve => require(['views/system/commentator/list'], resolve),
        },
        {
          path: 'user/create',
          name: 'system',
          meta: {
            title: '添加用户',
            hideInMenu: true
          },
          component: resolve => require(['views/system/user/list'], resolve),
        }
      ]
    }
  ]
  }
]
