import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/',
    component: () => import('@/views/Layout.vue'),
    children: [
      {
        path: 'home',
        name: 'Home',
        redirect: '/hospital/overview'
      },
      // 院区信息管理
      {
        path: 'hospital/overview',
        name: 'HospitalOverview',
        component: () => import('@/views/hospital/Overview.vue')
      },
      {
        path: 'hospital/department',
        name: 'Department',
        component: () => import('@/views/hospital/Department.vue')
      },
      {
        path: 'hospital/ward-area',
        name: 'WardArea',
        component: () => import('@/views/hospital/WardArea.vue')
      },
      {
        path: 'hospital/ward',
        name: 'Ward',
        component: () => import('@/views/hospital/Room.vue')
      },
      {
        path: 'hospital/bed',
        name: 'Bed',
        component: () => import('@/views/hospital/Bed.vue')
      },
      // 患者管理
      {
        path: 'hospital/patient',
        name: 'Patient',
        component: () => import('@/views/patient/Index.vue')
      },
      // 设备管理
      {
        path: 'device',
        name: 'Device',
        component: () => import('@/views/device/Index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
