更新12个教务系统并优化项目大小
主要更新: - 更新所有12个产业的教务系统数据和功能 - 删除所有 node_modules 文件夹(节省3.7GB) - 删除所有 .yoyo 缓存文件夹(节省1.2GB) - 删除所有 dist 构建文件(节省55MB) 项目优化: - 项目大小从 8.1GB 减少到 3.2GB(节省60%空间) - 保留完整的源代码和配置文件 - .gitignore 已配置,防止再次提交大文件 启动脚本: - start-industry.sh/bat/ps1 脚本会自动检测并安装依赖 - 首次启动时自动运行 npm install - 支持单个或批量启动产业系统 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
83
frontend/check_homework_structure.cjs
Normal file
83
frontend/check_homework_structure.cjs
Normal file
@@ -0,0 +1,83 @@
|
||||
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}`);
|
||||
Reference in New Issue
Block a user