|
@@ -69,21 +69,21 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
return {}
|
|
return {}
|
|
|
}
|
|
}
|
|
|
const data = await response.json()
|
|
const data = await response.json()
|
|
|
- // 企业专用工作历史API返回的是工作历史列表,取最新的一条作为当前工作信息
|
|
|
|
|
|
|
+ // 企业专用工作历史API返回的是工作历史列表
|
|
|
const workHistory = data?.工作历史 || []
|
|
const workHistory = data?.工作历史 || []
|
|
|
if (workHistory.length === 0) {
|
|
if (workHistory.length === 0) {
|
|
|
return {}
|
|
return {}
|
|
|
}
|
|
}
|
|
|
- // 取最新的一条工作记录(按入职日期降序)
|
|
|
|
|
- const latestWork = workHistory[0]
|
|
|
|
|
|
|
+ // 优先选择工作状态为"在职"的记录,如果没有则取最新的一条
|
|
|
|
|
+ const currentWork = workHistory.find((item: WorkHistoryItem) => item.工作状态 === '在职') || workHistory[0]
|
|
|
return {
|
|
return {
|
|
|
- id: latestWork.订单ID || talentId,
|
|
|
|
|
- orderId: latestWork.订单ID,
|
|
|
|
|
- position: latestWork.订单名称 || undefined,
|
|
|
|
|
|
|
+ id: currentWork.订单ID || talentId,
|
|
|
|
|
+ orderId: currentWork.订单ID,
|
|
|
|
|
+ position: undefined, // 企业专用API没有岗位类型字段
|
|
|
department: undefined, // 企业专用API没有部门字段
|
|
department: undefined, // 企业专用API没有部门字段
|
|
|
- startDate: latestWork.入职日期 || undefined,
|
|
|
|
|
- endDate: latestWork.离职日期 || undefined,
|
|
|
|
|
- status: latestWork.工作状态,
|
|
|
|
|
|
|
+ startDate: currentWork.入职日期 || undefined,
|
|
|
|
|
+ endDate: currentWork.离职日期 || undefined,
|
|
|
|
|
+ status: currentWork.工作状态,
|
|
|
companyId: undefined // 企业专用API没有公司ID字段
|
|
companyId: undefined // 企业专用API没有公司ID字段
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -376,7 +376,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
<View className="space-y-3 text-sm">
|
|
<View className="space-y-3 text-sm">
|
|
|
<View className="flex justify-between">
|
|
<View className="flex justify-between">
|
|
|
<Text className="text-gray-500">入职日期</Text>
|
|
<Text className="text-gray-500">入职日期</Text>
|
|
|
- <Text className="text-gray-800">{formatDate(talentDetail.joinDate)}</Text>
|
|
|
|
|
|
|
+ <Text className="text-gray-800">{formatDate(workInfo?.startDate)}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
<View className="flex justify-between">
|
|
<View className="flex justify-between">
|
|
|
<Text className="text-gray-500">工作状态</Text>
|
|
<Text className="text-gray-500">工作状态</Text>
|