Files
his/healthlink-his-mobile/src/router/index.js

27 lines
1.8 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router'
const routes = [
{ path: '/login', component: () => import('../views/Login.vue'), meta: { title: '登录' } },
{ path: '/', redirect: '/mobile/home' },
{ path: '/mobile', component: () => import('../views/MobileLayout.vue'), meta: { requiresAuth: true }, children: [
{ path: 'home', component: () => import('../views/Home.vue'), meta: { title: '首页' } },
{ path: 'tasks', component: () => import('../views/TaskList.vue'), meta: { title: '任务列表' } },
{ path: 'patients', component: () => import('../views/PatientList.vue'), meta: { title: '患者列表' } },
{ path: 'patient-detail/:id', component: () => import('../views/PatientDetail.vue'), meta: { title: '患者详情' } },
{ path: 'vital-entry/:patientId', component: () => import('../views/VitalSignEntry.vue'), meta: { title: '生命体征录入' } },
{ path: 'assessment/:patientId', component: () => import('../views/AssessmentForm.vue'), meta: { title: '护理评估' } },
{ path: 'drug-distribution', component: () => import('../views/DrugDistribution.vue'), meta: { title: '药品发放' } },
{ path: 'nursing-record', component: () => import('../views/NursingRecord.vue'), meta: { title: '护理记录' } },
{ path: 'infusion-patrol', component: () => import('../views/InfusionPatrol.vue'), meta: { title: '输液巡视' } },
{ path: 'handoff-record', component: () => import('../views/HandoffRecord.vue'), meta: { title: '交接班记录' } },
{ path: 'mine', component: () => import('../views/Mine.vue'), meta: { title: '我的' } }
]}
]
const router = createRouter({ history: createWebHistory(), routes })
router.beforeEach((to, from, next) => {
if (to.meta.requiresAuth && !localStorage.getItem('Admin-Token')) { next('/login'); return }
next()
})
export default router