diff --git a/backend/src/services/risk.service.ts b/backend/src/services/risk.service.ts index ec9129d..e6bb64a 100644 --- a/backend/src/services/risk.service.ts +++ b/backend/src/services/risk.service.ts @@ -340,7 +340,7 @@ async function detectSpecialStatusRisks(orgId: string) { }, }) - const risks: { employeeId: string; type: RiskType; level: RiskLevel; title: string; description: string; actionUrl: string }[] = [] + const risks: { employeeId: string; type: RiskType; level: RiskLevel; title: string; description: string; actionUrl: string; deadline?: Date }[] = [] for (const ss of specialStatuses) { const emp = ss.employee @@ -956,6 +956,8 @@ export async function getDashboardData(orgId: string) { contract: dedupedTodos.filter((t) => t.type === 'CONTRACT').length, salary: dedupedTodos.filter((t) => t.type === 'SALARY').length, termination: dedupedTodos.filter((t) => t.type === 'TERMINATION').length, + retirement: dedupedTodos.filter((t) => t.type === 'RETIREMENT').length, + monthly: dedupedTodos.filter((t) => t.type === 'MONTHLY').length, } // 按优先级排序:URGENT > HIGH > MEDIUM > LOW(priorityOrder 已在上方声明) diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 6baa76f..7865cbd 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -1003,114 +1003,6 @@ export default function Dashboard() { {/* 风险提醒 Tab */} {(activeTab === 'risk' || activeTab === 'task') && (
- {/* 风险分布饼图(仅风险提醒Tab) */} - {activeTab === 'risk' && isSectionVisible('risk_distribution') && ( - -

风险分布

-
-
- - - d.value > 0)} - dataKey="value" - nameKey="name" - cx="50%" - cy="50%" - innerRadius={30} - outerRadius={55} - paddingAngle={2} - > - {[ - { name: '合同风险', value: data.riskDistribution.contract, color: '#4F46E5' }, - { name: '薪资风险', value: data.riskDistribution.salary, color: '#F59E0B' }, - { name: '解聘风险', value: data.riskDistribution.termination, color: '#EF4444' }, - ].filter(d => d.value > 0).map((entry, i) => ( - - ))} - - `${v} 项`} /> - - -
-
- - - -
-
- - {drillDownType && ( -
-
- - {drillDownType === 'CONTRACT' ? '合同' : drillDownType === 'SALARY' ? '薪资' : '解聘'}风险明细 - - -
- {(data.topRisks || []).filter(r => r.type === drillDownType).length > 0 ? ( - (data.topRisks || []).filter(r => r.type === drillDownType).map((r) => ( - - -
-
- {r.title} - {r.priority && priorityConfig[r.priority] && ( - - {priorityConfig[r.priority].label} - - )} -
-
- {r.employeeName && {r.employeeName}} - {r.estimatedLoss > 0 && 损失 {fmt(r.estimatedLoss)}} - {r.daysUntilDeadline !== null && r.daysUntilDeadline <= 7 && ( - {r.daysUntilDeadline <= 0 ? '已逾期' : `${r.daysUntilDeadline}天`} - )} -
-
- - - )) - ) : ( -
暂无高风险项
- )} -
- )} -
- )} - {/* 待办列表 */} {isSectionVisible(activeTab === 'risk' ? 'risk_todos' : 'task_todos') && ( diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 2513d33..8084d4b 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -125,6 +125,8 @@ export interface DashboardData { contract: number salary: number termination: number + retirement: number + monthly: number } riskTrend: { thisMonth: number