import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const ADMIN: AppRouteRecordRaw = {
  path: '/admin',
  name: 'base',
  component: DEFAULT_LAYOUT,
  meta: {
    requiresAuth: true,
  },
  children: [
    {
      path: 'school-manage',
      name: 'SchoolManage',
      component: () => import('@/views/admin/school-manage/SchoolManage.vue'),
      meta: {
        title: '学校管理',
        requiresAuth: true,
      },
    },
    {
      path: 'role-manage/:schoolId',
      name: 'RoleManage',
      component: () => import('@/views/admin/role-manage/RoleManage.vue'),
      meta: {
        title: '角色管理',
        requiresAuth: true,
        relationRoutes: ['SchoolManage'],
      },
    },
    {
      path: 'set-manage',
      name: 'SetManage',
      component: () => import('@/views/admin/set-manage/SetManage.vue'),
      meta: {
        title: '配置管理',
        requiresAuth: true,
      },
    },
    {
      path: 'auth-manage',
      name: 'AuthManage',
      component: () => import('@/views/admin/auth-manage/AuthManage.vue'),
      meta: {
        title: '授权管理',
        requiresAuth: true,
      },
    },
  ],
};

export default ADMIN;
