/*
 * @Author: your name
 * @Date: 2021-10-21 09:31:21
 * @LastEditTime: 2022-02-28 21:32:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Foshan4A\src\router\routes\routes-file-one.js
 */
import Layout from '@/layout'

//首页
const dashboardRoutes = {
  path: '/',
  component: Layout,
  redirect: '/dashboard',
  meta: { roles: ['dashboard'], title: '首页' },
  children: [{
    path: 'dashboard',
    name: 'Dashboard',
    component: () => import('@/views/dashboard/index'),
    meta: { title: '首页', icon: 'dashboard', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png', affix: true }
  }]
}

//权限管理
const authorityRoutes = {
  path: '/authority',
  component: Layout,
  meta: { roles: ['authority_menu'], title: '权限项管理', },
  children: [{
    path: '/authority',
    component: () => import('@/views/authorityManagement/index'),
    meta: { title: '权限管理', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' },
    children: [
      {
        path: '/authority',
        name: 'AuthorityHome',
        component: () => import('@/views/authorityManagement/components/authorityHome'),
        meta: { title: '权限项管理', roles: ['authority_page'], icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'appAdd',
        name: 'AuthorityAppAdd',
        component: () => import('@/views/authorityManagement/components/authorityAppAdd'),
        meta: { title: '新增应用', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'appEdit',
        name: 'AuthorityAppEdit',
        component: () => import('@/views/authorityManagement/components/authorityAppEdit'),
        meta: { title: '编辑应用', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'addPower',
        name: 'AuthorityPowerAdd',
        component: () => import('@/views/authorityManagement/components/authorityPowerAdd'),
        meta: { title: '新增权限项', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'editPower',
        name: 'AuthorityPowerEdit',
        component: () => import('@/views/authorityManagement/components/authorityPowerEdit'),
        meta: { title: '编辑权限项', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      }
    ]
  }]
}

//角色管理
const roleRoutes = {
  path: '/role',
  component: Layout,
  meta: { roles: ['role_menu'], title: '角色管理' },
  children: [{
    path: '/role',
    component: () => import('@/views/authorityManagement/components/authorityRole'),
    meta: { title: '角色管理', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' },
    children: [
      {
        path: '/role',
        name: 'AuthorityRoleHome',
        component: () => import('@/views/authorityManagement/components/authorityRoleHome'),
        meta: { title: '角色管理', roles: ['role_page'], icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'addRole',
        name: 'AuthorityRoleAdd',
        component: () => import('@/views/authorityManagement/components/authorityRoleAdd'),
        meta: { title: '新增角色', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      },
      {
        path: 'editRole',
        name: 'AuthorityRoleEdit',
        component: () => import('@/views/authorityManagement/components/authorityRoleEdit'),
        meta: { title: '编辑角色', icon: 'authority', imgstyle: 'ic_home_nav_defaul.png', imgstyleup: 'ic_home_nav_check.png' }
      }
    ]
  }]
}

export default [
  dashboardRoutes,
  authorityRoutes,
  roleRoutes
]