import { RouteRecordRaw } from 'vue-router'
export const staticRouter: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('@/views/Index.vue'),
    // redirect: '/home',
    meta: {
      title: '起始页'
    },
    children: [
      {
        path: '/list',
        name: 'List',
        component: () => import('@/views/storehouse/List.vue'),
        meta: {
          title: '仓库列表'
        }
      },
      {
        path: '/classify',
        name: 'Classify',
        component: () => import('@/views/storehouse/Classify.vue'),
        meta: {
          title: '产品分类'
        }
      },
      {
        path: '/productionList',
        name: 'ProductionList',
        component: () => import('@/views/storehouse/ProductionList.vue'),
        meta: {
          title: '产品列表'
        }
      },
      {
        path: '/ioTNetworkCard',
        name: 'IoTNetworkCard',
        component: () => import('@/views/storehouse/IoTNetworkCard.vue'),
        meta: {
          title: '物联网卡'
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login.vue'),
    meta: {
      title: '登录'
    }
  }
]

export const errorRouter = [
  {
    path: '/404',
    name: '404',
    component: () => import('@/components/ErrorMessage/404.vue'),
    meta: {
      title: '404页面'
    }
  }
]

/**
 * notFoundRouter(找不到路由)
 */
export const notFoundRouter = {
  path: '/:pathMatch(.*)*',
  name: 'notFound',
  redirect: { name: '404' }
}
