import { DEFAULT_LAYOUT } from '@/router/constants'
import { Base as Api, Role } from '@/enums/api'
import { AppRouteRecordRaw } from '../types'

const Base: AppRouteRecordRaw = {
  path: '/base',
  name: 'Base',
  component: DEFAULT_LAYOUT,
  meta: {
    title: '系统管理',
    icon: 'icon-relation',
    iSize: 22,
    requiresAuth: true,
    order: 4
  },
  children: [
    {
      path: 'region',
      name: 'Region',
      component: () => import('@/views/base/region/index.vue'),
      meta: {
        title: '区域管理',
        permissions: [Api.CFG_ORG_TREE],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'org',
      name: 'Organization',
      component: () => import('@/views/base/org/index.vue'),
      meta: {
        title: '部门管理',
        permissions: [Api.CFG_ORG_TREE],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'role',
      name: 'Role',
      component: () => import('@/views/account/role/index.vue'),
      meta: {
        // icon: 'iot-role',
        title: '角色管理',
        permissions: [Role.SYSTEM_ROLE_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'staff',
      name: 'Staff',
      component: () => import('@/views/base/staff/index.vue'),
      meta: {
        title: '员工管理',
        permissions: [Api.CFG_STAFF_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    }
  ]
}

export default Base
