feat(web): Home.tsx 集成统一工作台 — 医生行动收件箱 + 主任团队概览
- 医生/护士角色:待办任务行替换为行动收件箱(TodoList) + AI 概览面板 - 主任角色:在最近动态下方新增 TeamOverviewPanel 团队概览 - 所有角色:点击待办项可打开 ActionDetailDrawer 查看详情和操作 - admin/operator 角色保持原有待办任务+最近动态布局
This commit is contained in:
@@ -30,6 +30,11 @@ import { listPendingTasks, type TaskInfo } from '../api/workflowTasks';
|
|||||||
import { pointsApi, type PersonalStats } from '../api/health/points';
|
import { pointsApi, type PersonalStats } from '../api/health/points';
|
||||||
import { useStatsData } from './health/StatisticsDashboard/useStatsData';
|
import { useStatsData } from './health/StatisticsDashboard/useStatsData';
|
||||||
import { useCountUp } from '../hooks/useCountUp';
|
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 ---
|
// --- Shared utilities ---
|
||||||
|
|
||||||
@@ -172,6 +177,8 @@ export default function Home() {
|
|||||||
const [pendingTasks, setPendingTasks] = useState<TaskInfo[]>([]);
|
const [pendingTasks, setPendingTasks] = useState<TaskInfo[]>([]);
|
||||||
const [recentActivities, setRecentActivities] = useState<AuditLogItem[]>([]);
|
const [recentActivities, setRecentActivities] = useState<AuditLogItem[]>([]);
|
||||||
const [activitiesLoading, setActivitiesLoading] = useState(true);
|
const [activitiesLoading, setActivitiesLoading] = useState(true);
|
||||||
|
const [drawerItem, setDrawerItem] = useState<ActionItem | null>(null);
|
||||||
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||||
|
|
||||||
const statsData = useStatsData();
|
const statsData = useStatsData();
|
||||||
const loading = personalLoading || statsData.loading;
|
const loading = personalLoading || statsData.loading;
|
||||||
@@ -262,6 +269,23 @@ export default function Home() {
|
|||||||
|
|
||||||
{/* 待办任务 + 最近活动 */}
|
{/* 待办任务 + 最近活动 */}
|
||||||
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
||||||
|
{(role === 'doctor' || role === 'nurse') ? (
|
||||||
|
<>
|
||||||
|
<Col xs={24} lg={14}>
|
||||||
|
<div className="erp-content-card erp-fade-in erp-fade-in-delay-2">
|
||||||
|
<div className="erp-section-header">
|
||||||
|
<CheckCircleOutlined className="erp-section-icon" />
|
||||||
|
<span className="erp-section-title">行动收件箱</span>
|
||||||
|
</div>
|
||||||
|
<TodoList onItemClick={(item) => { setDrawerItem(item); setDrawerOpen(true); }} />
|
||||||
|
</div>
|
||||||
|
</Col>
|
||||||
|
<Col xs={24} lg={10}>
|
||||||
|
<AiInsightPanel />
|
||||||
|
</Col>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
<Col xs={24} lg={14}>
|
<Col xs={24} lg={14}>
|
||||||
<div className="erp-content-card erp-fade-in erp-fade-in-delay-2">
|
<div className="erp-content-card erp-fade-in erp-fade-in-delay-2">
|
||||||
<div className="erp-section-header">
|
<div className="erp-section-header">
|
||||||
@@ -331,6 +355,8 @@ export default function Home() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/* 快捷入口 */}
|
{/* 快捷入口 */}
|
||||||
@@ -361,6 +387,26 @@ export default function Home() {
|
|||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
{/* 主任团队概览 */}
|
||||||
|
{role === 'admin' && (
|
||||||
|
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
||||||
|
<Col span={24}>
|
||||||
|
<TeamOverviewPanel />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 行动详情抽屉 */}
|
||||||
|
<ActionDetailDrawer
|
||||||
|
item={drawerItem}
|
||||||
|
open={drawerOpen}
|
||||||
|
onClose={() => { setDrawerOpen(false); setDrawerItem(null); }}
|
||||||
|
onActionComplete={() => {
|
||||||
|
setDrawerOpen(false);
|
||||||
|
setDrawerItem(null);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user