import Main from '@/components/main'
// import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  /* {
    path: '/webstatistics',
    name: 'webstatistics',
    meta: {
      title: '统计',
      hideInMenu: true
    },
    component: () => import('@/view/web/statistics/index.vue')
  }, */
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: 'home',
          notCache: false,
          icon: 'md-home'
        },
        component: () => import('@/view/home/home')
      }
    ]
  },
  {
    path: '/webuser',
    name: '用户管理',
    meta: {
      icon: 'md-person',
      title: '用户管理',
      access: ['admin'],
      showAlways: true
    },
    component: Main,
    children: [
      {
        path: 'grouplist',
        name: 'grouplist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'grouplist'
        },
        component: () => import('@/view/webuser/grouplist.vue')
      },
      {
        path: 'webuserlist',
        name: 'webuserlist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'webuserlist'
        },
        component: () => import('@/view/webuser/list.vue')
      },
      {
        path: 'usersetting',
        name: 'usersetting',
        meta: {
          icon: 'ios-settings',
          title: 'usersetting',
          hideInMenu: true
        },
        component: () => import('@/view/webuser/usersetting.vue')
      },
      {
        path: 'changepasswd',
        name: 'changepasswd',
        meta: {
          icon: 'ios-settings',
          title: 'changepasswd'
        },
        component: () => import('@/view/webuser/changepasswd.vue')
      }
    ]
  },
  {
    path: '/center',
    name: 'cateringcenter2',
    meta: {
      icon: 'ios-home-outline',
      title: 'cateringcenter',
      access: ['admin', 'meal'],
      showAlways: true
    },
    component: Main,
    children: [
      {
        path: 'centerlist2',
        name: 'centerlist2',
        meta: {
          icon: 'ios-menu-outline',
          title: 'centerlist2',
          access: ['admin']
        },
        component: () => import('@/view/center/centerlist.vue')
      }
    ]
  },
  {
    path: '/orderfood',
    name: 'orderfood',
    meta: {
      icon: 'ios-ionic',
      title: 'orderfood',
      access: ['admin', 'meal'],
      showAlways: true
    },
    component: Main,
    children: [
      {
        path: 'orderfoodlist',
        name: 'orderfoodlist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'orderfoodlist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/orderfood/orderfoodlist.vue')
      }
    ]
  },
  {
    path: '/meal',
    name: 'cateringcenter',
    meta: {
      icon: 'md-cog',
      title: 'cateringcenter',
      access: ['admin', 'meal'],
      showAlways: true
    },
    component: Main,
    children: [
      /* {
        path: 'centerlist',
        name: 'centerlist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'centerlist',
          access: ['admin']
        },
        component: () => import('@/view/meal/centerlist.vue')
      }, */
      // 暂不使用
      /* {
        path: 'editcenter',
        name: 'editcenter',
        meta: {
          icon: 'md-create',
          title: 'editcenter',
          access: ['admin'],
          hideInMenu: true
        },
        component: () => import('@/view/meal/centerlist.vue')
      }, */
      {
        path: 'meallist',
        name: 'meallist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'meallist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/meal/meallist.vue')
      },
      {
        path: 'editmeal',
        name: 'editmeal',
        meta: {
          icon: 'ios-menu-outline',
          title: 'editmeal',
          access: ['admin', 'meal'],
          hideInMenu: true
        },
        component: () => import('@/view/meal/editmeal.vue')
      },
      {
        path: 'editcooks',
        name: 'editcooks',
        meta: {
          icon: 'md-create',
          title: 'editcooks',
          access: ['admin', 'meal'],
          hideInMenu: true
        },
        component: () => import('@/view/meal/editcooks.vue')
      },
      {
        path: 'mealcooklist',
        name: 'mealcooklist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'mealcooklist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/meal/mealcooklist.vue')
      },
      {
        path: 'cooklist',
        name: 'cooklist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'cooklist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/meal/cookslist.vue')
      }
    ]
  },
  {
    path: '/visit',
    name: 'visitmanage',
    meta: {
      icon: 'md-happy',
      title: 'visitmanage',
      access: ['admin', 'meal'],
      showAlways: true
    },
    component: Main,
    children: [
      {
        path: 'visitinsert',
        name: 'visitinsert',
        meta: {
          icon: 'ios-menu-outline',
          title: 'visitinsert',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/visit/visitinsert.vue')
      },
      {
        path: 'visitlist',
        name: 'visitlist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'visitlist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/visit/visitlist.vue')
      }
    ]
  },
  {
    path: '/houseserver',
    name: 'houseserver',
    meta: {
      icon: 'ios-flower',
      title: 'houseserver',
      access: ['admin', 'meal'],
      showAlways: true
    },
    component: Main,
    children: [
      {
        path: 'houseservertypelist',
        name: 'houseservertypelist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'houseservertypelist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/visit/visitinsert.vue')
      },
      {
        path: 'houseserverlist',
        name: 'houseserverlist',
        meta: {
          icon: 'ios-menu-outline',
          title: 'houseserverlist',
          access: ['admin', 'meal']
        },
        component: () => import('@/view/visit/visitinsert.vue')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
