feat(web): 路由和菜单集成 + 10 页面占位
- App.tsx 添加 10 条 lazy 路由(患者/医护/预约/随访/咨询) - MainLayout.tsx 添加健康管理菜单组(7 项菜单 + 10 条标题映射) - 创建 10 个页面占位组件
This commit is contained in:
@@ -19,6 +19,11 @@ import {
|
||||
TableOutlined,
|
||||
TagsOutlined,
|
||||
RightOutlined,
|
||||
HeartOutlined,
|
||||
CalendarOutlined,
|
||||
PhoneOutlined,
|
||||
CommentOutlined,
|
||||
MedicineBoxOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useAppStore } from '../stores/app';
|
||||
@@ -47,6 +52,16 @@ const bizMenuItems: MenuItem[] = [
|
||||
{ key: '/messages', icon: <MessageOutlined />, label: '消息中心' },
|
||||
];
|
||||
|
||||
const healthMenuItems: MenuItem[] = [
|
||||
{ key: '/health/patients', icon: <TeamOutlined />, label: '患者管理' },
|
||||
{ key: '/health/doctors', icon: <MedicineBoxOutlined />, label: '医护管理' },
|
||||
{ key: '/health/appointments', icon: <CalendarOutlined />, label: '预约排班' },
|
||||
{ key: '/health/schedules', icon: <HeartOutlined />, label: '排班管理' },
|
||||
{ key: '/health/follow-up-tasks', icon: <PhoneOutlined />, label: '随访管理' },
|
||||
{ key: '/health/consultations', icon: <CommentOutlined />, label: '咨询管理' },
|
||||
{ key: '/health/tags', icon: <TagsOutlined />, label: '标签管理' },
|
||||
];
|
||||
|
||||
const sysMenuItems: MenuItem[] = [
|
||||
{ key: '/settings', icon: <SettingOutlined />, label: '系统设置' },
|
||||
{ key: '/plugins/admin', icon: <AppstoreOutlined />, label: '插件管理' },
|
||||
@@ -61,6 +76,16 @@ const routeTitleMap: Record<string, string> = {
|
||||
'/messages': '消息中心',
|
||||
'/settings': '系统设置',
|
||||
'/plugins/admin': '插件管理',
|
||||
'/health/patients': '患者管理',
|
||||
'/health/patients/:id': '患者详情',
|
||||
'/health/tags': '标签管理',
|
||||
'/health/doctors': '医护管理',
|
||||
'/health/appointments': '预约排班',
|
||||
'/health/schedules': '排班管理',
|
||||
'/health/follow-up-tasks': '随访管理',
|
||||
'/health/follow-up-records': '随访记录',
|
||||
'/health/consultations': '咨询管理',
|
||||
'/health/consultations/:id': '咨询详情',
|
||||
};
|
||||
|
||||
// 侧边栏菜单项 - 提取为独立组件避免重复渲染
|
||||
@@ -263,6 +288,20 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* 菜单组:健康管理 */}
|
||||
{!sidebarCollapsed && <div className="erp-sidebar-group">健康管理</div>}
|
||||
<div className="erp-sidebar-menu">
|
||||
{healthMenuItems.map((item) => (
|
||||
<SidebarMenuItem
|
||||
key={item.key}
|
||||
item={item}
|
||||
isActive={currentPath === item.key}
|
||||
collapsed={sidebarCollapsed}
|
||||
onClick={() => navigate(item.key)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* 菜单组:插件 */}
|
||||
{pluginMenuGroups.length > 0 && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user