feat: 岗位面试状态按时间降序排序

- 在transformInterviewStatus函数中添加interviewDate字段
- 实现按面试时间降序排序(最新的在前)
- 确保面试状态板块显示的顺序更符合用户查看习惯

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
KQL
2025-09-08 05:17:19 +08:00
parent 19e1143fe2
commit 14c33d0ffd
12 changed files with 19 additions and 1 deletions

View File

@@ -9,7 +9,8 @@ import marketingCoursesData from './marketingCourses.json';
// 转换函数将JSON数据转换为页面所需格式
// 转换面试状态数据
const transformInterviewStatus = (statusData, jobsData) => {
return statusData.map((status, index) => {
return statusData
.map((status, index) => {
// 从岗位数据中查找匹配的岗位详情
const matchedJob = jobsData.find(job =>
job["内推岗位名称"] === status["查询岗位名称"]
@@ -18,6 +19,7 @@ const transformInterviewStatus = (statusData, jobsData) => {
// 解析日期
const dateParts = status["阶段日期"].split('/');
const formattedDate = `${dateParts[0]}-${dateParts[1].padStart(2, '0')}-${dateParts[2].padStart(2, '0')}`;
const interviewDate = new Date(parseInt(dateParts[0]), parseInt(dateParts[1]) - 1, parseInt(dateParts[2]));
// 根据面试状态确定状态码和文本
let statusCode = 'PENDING';
@@ -35,6 +37,7 @@ const transformInterviewStatus = (statusData, jobsData) => {
id: index + 1,
position: status["查询岗位名称"],
interviewTime: formattedDate,
interviewDate: interviewDate, // 用于排序
status: statusCode,
statusText: statusText,
job: matchedJob ? {
@@ -51,6 +54,10 @@ const transformInterviewStatus = (statusData, jobsData) => {
companyInfo: ""
}
};
})
.sort((a, b) => {
// 按面试时间降序排序(最新的在前)
return b.interviewDate - a.interviewDate;
});
};