init:库尔勒妇幼项目初始化

This commit is contained in:
Elliott
2025-07-23 14:39:14 +08:00
commit 8c9d4af4e0
55 changed files with 13218 additions and 0 deletions

70
src/router/index.js Normal file
View File

@@ -0,0 +1,70 @@
import {createRouter, createWebHashHistory, createWebHistory} from "vue-router";
import {getAuther, getPerm} from "@/api/auth.js";
import useUserStore from "@/store/modules/user.js";
export const constantRoutes = [
{
path: '/synthesis',
component: () => import('@/views/synthesis/index.vue'),
meta: {title: '综合统计'}
},
{
path: '/integrative',
component: () => import('@/views/integrative/index.vue'),
meta: {title: '全院综合统计'}
},
{
path: '/hospitalization',
component: () => import('@/views/hospitalization/index.vue'),
meta: {title: '住院统计'}
}, {
path: '/inhos',
component: () => import('@/views/inhos/index.vue'),
meta: {title: '住院统计'}
},
{
path: '/outpatient',
component: () => import('@/views/outpatient/index.vue'),
meta: {title: '门诊统计'}
},
{
path: '/opd',
component: () => import('@/views/opd/index.vue'),
meta: {title: '门诊统计'}
},
{
path: '/dept',
component: () => import('@/views/dept/index.vue'),
meta: {title: '科室统计'}
},
{
path: '/401',
component: () => import('@/views/error/401.vue'),
},
]
const router = createRouter(
{
history: createWebHashHistory(),
routes: constantRoutes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return {top: 0}
}
},
}
)
router.beforeEach(async (to, from, next) => {
await useUserStore().getInfo(to)
if (to.meta.title) {
document.title = to.meta.title
}
next()
})
export default router;