/* Layout */
import Layout from '@/layout'

const goodsRouter = {
  path: '/goods',
  component: Layout,
  redirect: '/goods/list',
  name: 'Goods',
  meta: { title: '商品管理', icon: 'el-icon-goods' },
  alwaysShow: true,
  children: [
    {
      path: 'list',
      name: 'List',
      component: () => import('@/views/goods/list'),
      meta: { title: '商品列表', icon: 'el-icon-shopping-bag-2' }
    },
    {
      path: 'category',
      name: 'Category',
      component: () => import('@/views/goods/category'),
      meta: { title: '商品分类', icon: 'ma-goods-category' },
      hidden: true
    },
    {
      path: 'category/edit/:id(\\d+)',
      name: 'EditCategory',
      component: () => import('@/views/goods/category-edit'),
      meta: { title: '编辑分类', noCache: true, activeMenu: '/goods/category' },
      hidden: true
    },
    {
      path: 'category/create',
      name: 'CreateCategory',
      component: () => import('@/views/goods/category-create'),
      meta: { title: '添加分类', noCache: true, activeMenu: '/goods/category' },
      hidden: true
    },
    {
      path: 'list/select/:type(\\d+)',
      name: 'SelectProduct',
      component: () => import('@/views/goods/list-select'),
      meta: { title: '添加商品', noCache: true, activeMenu: '/goods/list' },
      hidden: true
    }
  ]
}

export default goodsRouter
