/*
 * @Author: your name
 * @Date: 2022-01-06 10:05:44
 * @LastEditTime: 2022-03-14 11:43:37
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \src\router\routes\routes-file-five.js
 */
import Layout from '@/layout'

const accountGroupType = PLATFROM_CONFIG.accountGroupType

const accountGroupRoutes = {
  path: '/accountGroup',
  component: Layout,
  meta: { roles: ['group_menu'], title: `${accountGroupType}管理` },
  children: [
    {
      path: '/accountGroup',
      component: () => import('@/views/accountGroupManagement/index'),
      meta: {
        title: `${accountGroupType}管理`
      },
      children: [
        {
          path: '/accountGroup',
          name: 'accountGroupHome',
          component: () => import('@/views/accountGroupManagement/components/accountGroupHome'),
          meta: {
            title: `${accountGroupType}管理`,
            roles: ['group_page']
          }
        },
        {
          path: 'Add',
          name: 'accountGroupAdd',
          component: () => import('@/views/accountGroupManagement/components/accountGroupEdit'),
          meta: {
            title: `新增${accountGroupType}`
          }
        },
        {
          path: 'Edit',
          name: 'accountGroupEdit',
          component: () => import('@/views/accountGroupManagement/components/accountGroupEdit'),
          meta: {
            title: `编辑${accountGroupType}`,
            doesGroupExist: true
          }
        }
      ]
    }
  ]
}

const accountRoutes = {
  path: '/account',
  component: Layout,
  meta: { roles: ['account_menu'], title: '账号管理' },
  children: [
    {
      path: '/account',
      name: '',
      component: () => import('@/views/accountManagement'),
      meta: {
        title: '账号管理'
      },
      children: [
        {
          path: '/account',
          name: 'accountHome',
          component: () => import('@/views/accountManagement/components/accountHome'),
          meta: {
            title: '账号管理',
            roles: ['account_page']
          }
        },
        {
          path: 'accountAdd',
          name: 'accountAdd',
          component: () => import('@/views/accountManagement/components/accountEdit'),
          meta: {
            title: '新增账号'
          }
        },
        {
          path: 'accountEdit',
          name: 'accountEdit',
          component: () => import('@/views/accountManagement/components/accountEdit'),
          meta: {
            title: '编辑账号',
            doesAccountExist: true
          }
        }
      ]
    }
  ]
}

export default [accountGroupRoutes, accountRoutes]
