|
|
@@ -10,6 +10,7 @@ import { MenuSection } from '../../components/MenuSection'
|
|
|
import { LogoutButton } from '../../components/LogoutButton'
|
|
|
import { talentSettingsClient } from '../../api'
|
|
|
import type { MenuSection as MenuSectionType } from '../../types/settings'
|
|
|
+import { generateMockAttendanceData, getCurrentYearMonth } from '../../utils/mockAttendanceData'
|
|
|
|
|
|
/**
|
|
|
* 人才小程序设置页
|
|
|
@@ -204,17 +205,25 @@ const SettingsPage: React.FC = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const displayProfile = profile ? {
|
|
|
- id: profile.id,
|
|
|
- name: profile.name || profile.nickname || '用户',
|
|
|
- disabilityType: profile.personInfo?.disabilityType || '未知',
|
|
|
- disabilityLevel: profile.personInfo?.disabilityLevel || '未知',
|
|
|
- stats: {
|
|
|
- thisMonthAttendance: 0,
|
|
|
- totalAttendance: 0,
|
|
|
- thisMonthSalary: 0
|
|
|
- }
|
|
|
- } : mockProfile
|
|
|
+ const displayProfile = (() => {
|
|
|
+ // 获取考勤统计数据
|
|
|
+ const { stats: attendanceData } = (() => {
|
|
|
+ const { year, month } = getCurrentYearMonth()
|
|
|
+ return generateMockAttendanceData(year, month)
|
|
|
+ })()
|
|
|
+
|
|
|
+ return profile ? {
|
|
|
+ id: profile.id,
|
|
|
+ name: profile.name || profile.nickname || '用户',
|
|
|
+ disabilityType: profile.personInfo?.disabilityType || '未知',
|
|
|
+ disabilityLevel: profile.personInfo?.disabilityLevel || '未知',
|
|
|
+ stats: {
|
|
|
+ thisMonthAttendance: attendanceData.normalDays,
|
|
|
+ totalAttendance: attendanceData.normalDays, // 累计出勤暂时显示本月值
|
|
|
+ thisMonthSalary: 4800 // 薪资保持不变
|
|
|
+ }
|
|
|
+ } : mockProfile
|
|
|
+ })()
|
|
|
|
|
|
return (
|
|
|
<RencaiTabBarLayout activeKey="settings">
|