diff --git a/apps/web/src/pages/Home.tsx b/apps/web/src/pages/Home.tsx index da6f621..adf33d0 100644 --- a/apps/web/src/pages/Home.tsx +++ b/apps/web/src/pages/Home.tsx @@ -30,6 +30,11 @@ import { listPendingTasks, type TaskInfo } from '../api/workflowTasks'; import { pointsApi, type PersonalStats } from '../api/health/points'; import { useStatsData } from './health/StatisticsDashboard/useStatsData'; import { useCountUp } from '../hooks/useCountUp'; +import TodoList from './health/components/workbench/TodoList'; +import AiInsightPanel from './health/components/workbench/AiInsightPanel'; +import TeamOverviewPanel from './health/components/workbench/TeamOverviewPanel'; +import ActionDetailDrawer from './health/components/workbench/ActionDetailDrawer'; +import type { ActionItem } from '../api/health/actionInbox'; // --- Shared utilities --- @@ -172,6 +177,8 @@ export default function Home() { const [pendingTasks, setPendingTasks] = useState([]); const [recentActivities, setRecentActivities] = useState([]); const [activitiesLoading, setActivitiesLoading] = useState(true); + const [drawerItem, setDrawerItem] = useState(null); + const [drawerOpen, setDrawerOpen] = useState(false); const statsData = useStatsData(); const loading = personalLoading || statsData.loading; @@ -262,75 +269,94 @@ export default function Home() { {/* 待办任务 + 最近活动 */} - -
-
- - 待办任务 - - {pendingTasks.length} 项待处理 - -
-
- {pendingTasks.length === 0 ? ( - - ) : ( - pendingTasks.map((task) => ( -
handleNavigate('/workflow')} - role="button" - tabIndex={0} - onKeyDown={(e) => { if (e.key === 'Enter') handleNavigate('/workflow'); }} - > -
-
-
{task.node_name || task.definition_name || '流程任务'}
-
- {task.definition_name || '工作流'} - {task.status === 'pending' ? '待处理' : task.status} + {(role === 'doctor' || role === 'nurse') ? ( + <> + +
+
+ + 行动收件箱 +
+ { setDrawerItem(item); setDrawerOpen(true); }} /> +
+ + + + + + ) : ( + <> + +
+
+ + 待办任务 + + {pendingTasks.length} 项待处理 + +
+
+ {pendingTasks.length === 0 ? ( + + ) : ( + pendingTasks.map((task) => ( +
handleNavigate('/workflow')} + role="button" + tabIndex={0} + onKeyDown={(e) => { if (e.key === 'Enter') handleNavigate('/workflow'); }} + > +
+
+
{task.node_name || task.definition_name || '流程任务'}
+
+ {task.definition_name || '工作流'} + {task.status === 'pending' ? '待处理' : task.status} +
+
+ 一般 +
-
- 一般 - -
- )) - )} -
-
- + )) + )} +
+
+ - -
-
- - 最近动态 -
-
- {activitiesLoading ? ( -
- ) : recentActivities.length === 0 ? ( - - ) : ( - recentActivities.map((log) => ( -
-
- {RESOURCE_ICONS[log.resource_type] || } -
-
-
- {formatActionLabel(log.action)}了{formatResourceLabel(log.resource_type)} + +
+
+ + 最近动态 +
+
+ {activitiesLoading ? ( +
+ ) : recentActivities.length === 0 ? ( + + ) : ( + recentActivities.map((log) => ( +
+
+ {RESOURCE_ICONS[log.resource_type] || } +
+
+
+ {formatActionLabel(log.action)}了{formatResourceLabel(log.resource_type)} +
+
{formatTimeAgo(log.created_at)}
+
-
{formatTimeAgo(log.created_at)}
-
-
- )) - )} -
-
- + )) + )} +
+
+ + + )} {/* 快捷入口 */} @@ -361,6 +387,26 @@ export default function Home() {
+ + {/* 主任团队概览 */} + {role === 'admin' && ( + + + + + + )} + + {/* 行动详情抽屉 */} + { setDrawerOpen(false); setDrawerItem(null); }} + onActionComplete={() => { + setDrawerOpen(false); + setDrawerItem(null); + }} + />
); }