import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';

const adminRoleRoutes: RouteRecordRaw[] = [
  {
    meta: { title: '超级管理员' },
    name: 'SystemAdminSuper',
    path: '/system/admin/super',
    component: () => import('#/views/system/admin/super/index.vue'),
  },
  {
    meta: { title: '系统管理员' },
    name: 'SystemAdminPlatform',
    path: '/system/admin/platform',
    component: () => import('#/views/system/admin/platform/index.vue'),
  },
  {
    meta: { title: '总部财务' },
    name: 'SystemAdminHeadquartersFinance',
    path: '/system/admin/headquarters-finance',
    component: () =>
      import('#/views/system/admin/headquarters-finance/index.vue'),
  },
  {
    meta: { title: '省级管理员' },
    name: 'SystemAdminProvince',
    path: '/system/admin/province',
    component: () => import('#/views/system/admin/province/index.vue'),
  },
  {
    meta: { title: '市级管理员' },
    name: 'SystemAdminCity',
    path: '/system/admin/city',
    component: () => import('#/views/system/admin/city/index.vue'),
  },
  {
    meta: { title: '区级管理员' },
    name: 'SystemAdminDistrict',
    path: '/system/admin/district',
    component: () => import('#/views/system/admin/district/index.vue'),
  },
  {
    meta: { title: '业务员' },
    name: 'SystemAdminSalesperson',
    path: '/system/admin/salesperson',
    component: () => import('#/views/system/admin/salesperson/index.vue'),
  },
  {
    meta: { title: '供应商' },
    name: 'SystemAdminSupplier',
    path: '/system/admin/supplier',
    component: () => import('#/views/system/admin/supplier/index.vue'),
  },
  {
    meta: { title: '诊所管理员' },
    name: 'SystemAdminClinic',
    path: '/system/admin/clinic',
    component: () => import('#/views/system/admin/clinic/index.vue'),
  },
  {
    meta: { title: '诊所员工' },
    name: 'SystemAdminClinicStaff',
    path: '/system/admin/clinic-staff',
    component: () => import('#/views/system/admin/clinic-staff/index.vue'),
  },
  {
    meta: { title: '医生' },
    name: 'SystemAdminDoctor',
    path: '/system/admin/doctor',
    component: () => import('#/views/system/admin/doctor/index.vue'),
  },
  {
    meta: { title: '药师' },
    name: 'SystemAdminPharmacist',
    path: '/system/admin/pharmacist',
    component: () => import('#/views/system/admin/pharmacist/index.vue'),
  },
  {
    meta: { title: '诊所推广员' },
    name: 'SystemAdminClinicSalesperson',
    path: '/system/admin/clinic-salesperson',
    component: () => import('#/views/system/admin/clinic-salesperson/index.vue'),
  },
];

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'carbon:cics-system-group',
      keepAlive: true,
      order: 1000,
      title: '基础管理',
    },
    name: 'System',
    path: '/system',
    children: [
      ...adminRoleRoutes,
      {
        meta: { title: '管理员管理' },
        name: 'SystemUser',
        path: '/system/user',
        redirect: '/system/admin/platform',
      },
      {
        meta: {
          title: '角色管理',
        },
        name: 'SystemRole',
        path: '/system/role',
        component: () => import('#/views/system/role/index.vue'),
      },
      {
        meta: {
          title: '菜单管理',
        },
        name: 'SystemMenu',
        path: '/system/menu',
        component: () => import('#/views/system/menu/index.vue'),
      },
    ],
  },
];

export default routes;
