import type { Route } from '@/global'

const Layout = () => import('@/layouts/index.vue')

const routes: Route.recordRaw[] = [
  {
    path: '/sys',
    component: Layout,
    redirect: '/sys/area',
    name: 'System',
    meta: {
      title: '系统管理',
      icon: 'ep:key',
      auth: '/system',
    },
    children: [
      {
        path: '/area',
        component: Layout,
        redirect: '/area/list',
        name: 'AreaManage',
        meta: {
          title: '区域管理',
          icon: 'ep:key',
          auth: '/sys/area',
        },
        children: [
          {
            path: 'list',
            name: 'AreaList',
            component: () => import('@/views/system/area/listArea.vue'),
            meta: {
              title: '区域管理',
              auth: '/sys/area',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/area',
            },
          },
        ],
      },
      {
        path: '/resource',
        component: Layout,
        redirect: '/resource/list',
        name: 'ResourceManage',
        meta: {
          title: '资源管理',
          icon: 'ep:key',
          auth: '/sys/resource',
        },
        children: [
          {
            path: 'list',
            name: 'ResourceList',
            component: () => import('@/views/system/resource/listResource.vue'),
            meta: {
              title: '资源管理',
              auth: '/sys/resource',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/resource',
            },
          },
        ],
      },
      {
        path: '/dept',
        component: Layout,
        redirect: '/dept/list',
        name: 'DeptManage',
        meta: {
          title: '组织管理',
          icon: 'ep:key',
          auth: '/sys/dept',
        },
        children: [
          {
            path: 'list',
            name: 'DeptList',
            component: () => import('@/views/system/dept/listDept.vue'),
            meta: {
              title: '组织管理',
              auth: '/sys/dept',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/dept',
            },
          },
        ],
      },
      {
        path: '/role',
        component: Layout,
        redirect: '/role/list',
        name: 'RoleManage',
        meta: {
          title: '角色管理',
          icon: 'ep:key',
          auth: '/sys/role',
        },
        children: [
          {
            path: 'list',
            name: 'RoleList',
            component: () => import('@/views/system/role/listRole.vue'),
            meta: {
              title: '角色管理',
              auth: '/sys/role',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/role',
            },
          },
        ],
      },
      {
        path: '/user',
        component: Layout,
        redirect: '/user/list',
        name: 'UserManage',
        meta: {
          title: '用户管理',
          icon: 'ep:key',
          auth: '/sys/mgr',
        },
        children: [
          {
            path: 'list',
            name: 'UserList',
            component: () => import('@/views/system/user/listUser.vue'),
            meta: {
              title: '用户管理',
              auth: '/sys/mgr',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/user',
            },
          },
        ],
      },
      {
        path: '/dict',
        component: Layout,
        redirect: '/dict/list',
        name: 'DictManage',
        meta: {
          title: '字典管理',
          icon: 'ep:key',
          auth: '/sys/dict',
        },
        children: [
          {
            path: 'list',
            name: 'DictList',
            component: () => import('@/views/system/dict/listDict.vue'),
            meta: {
              title: '字典管理',
              auth: '/sys/dict',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/dict',
            },
          },
        ],
      },
      {
        path: '/businessLog',
        component: Layout,
        redirect: '/businessLog/list',
        name: 'BusinessLog',
        meta: {
          title: '业务日志',
          icon: 'ep:key',
          auth: '/sys/log/biz/list',
        },
        children: [
          {
            path: 'list',
            name: 'BusinessList',
            component: () => import('@/views/system/log/listLog.vue'),
            meta: {
              title: '业务日志',
              auth: '/sys/log/biz/list',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/businessLog',
            },
          },
        ],
      },
      {
        path: '/error',
        component: Layout,
        redirect: '/error/list',
        name: 'ErrorLog',
        meta: {
          title: '异常日志',
          icon: 'ep:key',
          auth: '/sys/log/error/list',
        },
        children: [
          {
            path: 'list',
            name: 'ErrorList',
            component: () => import('@/views/system/log/listErrorLog.vue'),
            meta: {
              title: '异常日志',
              auth: '/sys/log/error/list',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/error',
            },
          },
        ],
      },
      {
        path: '/loginDiary',
        component: Layout,
        redirect: '/loginDiary/list',
        name: 'loginDiaryLog',
        meta: {
          title: '登录日志',
          icon: 'ep:key',
          auth: '/sys/loginLog',
        },
        children: [
          {
            path: 'list',
            name: 'loginDiaryList',
            component: () => import('@/views/system/log/LoginLog.vue'),
            meta: {
              title: '登录日志',
              auth: '/sys/loginLog',
              sidebar: false,
              breadcrumb: true,
              activeMenu: '/loginDiary',
            },
          },
        ],
      },
    ],

  },
]
export default routes
