import Layout from '@/layout'

const webPageRouter = {
  path: '/web',
  component: Layout,
  redirect: '/web/page',
  alwaysShow: true, // will always show the root menu
  name: 'WebSetting', // name必须和后台配置一致，不然匹配不到
  meta: { title: '网页设置', icon: 'component' },
  children: [
    {
      path: 'page',
      component: () => import('@/views/index'),
      redirect: '/web/page/list',
      name: 'WebPages',
      meta: { title: '页面管理', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/web/page/list.vue'),
          name: 'WebPageList',
          meta: { title: '页面列表', activeMenu: '/web/page' }
        },
        {
          path: 'edit',
          hidden: true,
          component: () => import('@/views/web/page/form.vue'),
          name: 'WebPageEdit',
          meta: { title: '编辑页面', noCache: true, activeMenu: '/web/page' }
        },
        {
          path: 'add',
          hidden: true,
          component: () => import('@/views/web/page/form.vue'),
          name: 'WebPageEdit',
          meta: { title: '添加页面', noCache: true, activeMenu: '/web/page' }
        }
      ]
    },
    {
      path: 'help',
      component: () => import('@/views/index'),
      redirect: '/web/help/list',
      name: 'HelpPages',
      meta: { title: '帮助页设置', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/web/help/list.vue'),
          name: 'HelpPageList',
          meta: { title: '帮助页', activeMenu: '/web/help' }
        },
        {
          path: 'edit',
          hidden: true,
          component: () => import('@/views/web/help/form.vue'),
          name: 'HelpPageEdit',
          meta: { title: '编辑帮助页', noCache: true, activeMenu: '/web/help' }
        },
        {
          path: 'add',
          hidden: true,
          component: () => import('@/views/web/help/form.vue'),
          name: 'HelpPageEdit',
          meta: { title: '添加帮助页', noCache: true, activeMenu: '/web/help' }
        }
      ]
    }
  ]
}
export default webPageRouter
