Files
teach_sys_Demo/check_homework_structure.cjs
KQL 1b964b3886 chore: 更新数据文件和组件优化
主要更新内容:
- 优化UI组件(视频播放器、HR访问模态框、岗位信息展示等)
- 更新数据文件(简历、岗位、项目案例等)
- 添加新的图片资源(面试状态图标等)
- 新增AgentPage等页面组件
- 清理旧的备份文件,提升代码库整洁度
- 优化岗位等级和面试状态的数据结构

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 15:55:25 +08:00

84 lines
2.9 KiB
JavaScript

const fs = require('fs');
const path = require('path');
// 读取日历课程
const calendarPath = path.join(__dirname, 'src/data/calendarCourses.json');
const calendarData = JSON.parse(fs.readFileSync(calendarPath, 'utf-8'));
// 读取作业海报映射
const posterMappingPath = path.join(__dirname, 'homework_poster_mapping.json');
const posterMapping = JSON.parse(fs.readFileSync(posterMappingPath, 'utf-8'));
// 从日历中提取课程,并匹配作业海报
const compoundCourses = [];
const verticalCourses = [];
calendarData.forEach(day => {
// 复合技能阶段课程
if (day['复合技能阶段'] && day['复合技能阶段'].trim()) {
const courseName = day['复合技能阶段'].trim();
if (!compoundCourses.some(c => c.name === courseName)) {
compoundCourses.push({
id: compoundCourses.length + 1,
name: courseName,
level: 'completed',
imageUrl: posterMapping[courseName] || null,
unit: day['❌查询单元名称'] || ''
});
}
}
// 垂直方向课程
if (day['垂直方向阶段(方向二:商业活动策划)'] && day['垂直方向阶段(方向二:商业活动策划)'].trim()) {
const courseName = day['垂直方向阶段(方向二:商业活动策划)'].trim();
if (!verticalCourses.some(c => c.name === courseName)) {
verticalCourses.push({
id: verticalCourses.length + 1,
name: courseName,
level: 'completed',
imageUrl: posterMapping[courseName] || null,
unit: day['❌查询单元名称'] || ''
});
}
}
});
console.log('===== 从日历提取的课程数据 =====\n');
console.log('【复合技能阶段】');
console.log(`总课程数: ${compoundCourses.length}`);
console.log(`有海报的: ${compoundCourses.filter(c => c.imageUrl).length}`);
console.log(`无海报的: ${compoundCourses.filter(c => !c.imageUrl).length}`);
console.log('\n【垂直方向阶段】');
console.log(`总课程数: ${verticalCourses.length}`);
console.log(`有海报的: ${verticalCourses.filter(c => c.imageUrl).length}`);
console.log(`无海报的: ${verticalCourses.filter(c => !c.imageUrl).length}`);
console.log('\n【无海报的课程列表】');
const noImageCourses = [
...compoundCourses.filter(c => !c.imageUrl),
...verticalCourses.filter(c => !c.imageUrl)
];
noImageCourses.forEach(course => {
console.log(` - ${course.name}`);
});
// 保存处理后的数据
const outputData = {
compound: compoundCourses,
vertical: verticalCourses,
summary: {
compoundTotal: compoundCourses.length,
compoundWithImage: compoundCourses.filter(c => c.imageUrl).length,
verticalTotal: verticalCourses.length,
verticalWithImage: verticalCourses.filter(c => c.imageUrl).length
}
};
const outputPath = path.join(__dirname, 'homework_courses_with_images.json');
fs.writeFileSync(outputPath, JSON.stringify(outputData, null, 2), 'utf-8');
console.log(`\n处理后的数据已保存到: ${outputPath}`);