refactor(clinical-web): 重构医护端布局与路由结构
This commit is contained in:
@@ -1,73 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { RouterView, useRoute, useRouter } from 'vue-router'
|
||||
import { RouterView } from 'vue-router'
|
||||
|
||||
import { useAppStore } from '@/stores/app'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const appStore = useAppStore()
|
||||
|
||||
const menuItems = [
|
||||
{ path: '/dashboard', label: '工作台' },
|
||||
{ path: '/consent-tasks', label: '签署任务' },
|
||||
{ path: '/documents', label: '文书库' },
|
||||
{ path: '/reports', label: '统计报表' },
|
||||
{ path: '/settings', label: '系统设置' },
|
||||
]
|
||||
|
||||
const activeMenu = computed(() => route.path)
|
||||
const pageTitle = computed(() => String(route.meta.title ?? '医签通'))
|
||||
|
||||
function handleMenuSelect(path: string) {
|
||||
if (path !== route.path) {
|
||||
void router.push(path)
|
||||
}
|
||||
}
|
||||
import Container from '@/components/Container.vue'
|
||||
import Header from '@/components/Header.vue'
|
||||
import Menu from '@/components/Menu.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-container class="clinical-layout">
|
||||
<el-aside width="236px" class="clinical-sidebar">
|
||||
<div class="brand">
|
||||
<div class="brand-mark">签</div>
|
||||
<div>
|
||||
<strong>医签通</strong>
|
||||
<span>medical-sign</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-menu :default-active="activeMenu" class="clinical-menu" @select="handleMenuSelect">
|
||||
<el-menu-item v-for="item in menuItems" :key="item.path" :index="item.path">
|
||||
<span class="menu-dot" />
|
||||
<span>{{ item.label }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
|
||||
<div class="sidebar-footer">
|
||||
<span class="status-dot" />
|
||||
<span>演示环境运行中</span>
|
||||
</div>
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
<el-header class="clinical-header">
|
||||
<div>
|
||||
<p class="header-kicker">电子知情同意管理平台</p>
|
||||
<h1>{{ pageTitle }}</h1>
|
||||
</div>
|
||||
<div class="user-context">
|
||||
<div class="user-avatar">{{ appStore.userName.slice(0, 1) }}</div>
|
||||
<div>
|
||||
<strong>{{ appStore.userName }}</strong>
|
||||
<span>{{ appStore.department }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
|
||||
<el-main class="clinical-main">
|
||||
<div class="clinical-layout">
|
||||
<Menu />
|
||||
<div class="clinical-main">
|
||||
<Header />
|
||||
<Container>
|
||||
<RouterView />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</Container>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user