Files
ALL-teach_sys/frontend_环保/fixUnitAssignments.js
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含12个产业的完整教务系统前端代码
- 智能启动脚本 (start-industry.sh)
- 可视化产业导航页面 (index.html)
- 项目文档 (README.md)

优化内容:
- 删除所有node_modules和.yoyo文件夹,从7.5GB减少到2.7GB
- 添加.gitignore文件避免上传不必要的文件
- 自动依赖管理和智能启动系统

产业列表:
1. 文旅产业 (5150)
2. 智能制造 (5151)
3. 智能开发 (5152)
4. 财经商贸 (5153)
5. 视觉设计 (5154)
6. 交通物流 (5155)
7. 大健康 (5156)
8. 土木水利 (5157)
9. 食品产业 (5158)
10. 化工产业 (5159)
11. 能源产业 (5160)
12. 环保产业 (5161)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:14:14 +08:00

69 lines
3.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import fs from 'fs';
// 读取日历数据
const dataPath = './src/data/intelligentManufacturingCalendar.json';
const data = JSON.parse(fs.readFileSync(dataPath, 'utf8'));
console.log('开始修正单元归属...\n');
let fixCount = 0;
// 1. 修正所有单元小结的单元归属
data.forEach((item, index) => {
if (item['个人课程表'] === '单元小结') {
// 找前一条有个人课程的记录
let prevUnit = null;
for (let i = index - 1; i >= 0; i--) {
if (data[i]['个人课程表'] &&
data[i]['个人课程表'] !== '单元小结' &&
data[i]['所属单元(个人课程)']) {
prevUnit = data[i]['所属单元(个人课程)'];
break;
}
}
if (prevUnit && item['所属单元(个人课程)'] !== prevUnit) {
console.log(`修正单元小结 [${item['日期']}]`);
console.log(` 原单元:${item['所属单元(个人课程)'] || '(空)'}`);
console.log(` 新单元:${prevUnit}`);
item['所属单元(个人课程)'] = prevUnit;
fixCount++;
}
}
// 2. 修正"个人职业目标与发展路径规划"的单元
if (item['个人课程表'] === '个人职业目标与发展路径规划') {
if (item['所属单元(个人课程)'] !== '职业规划课') {
console.log(`\n修正课程 "个人职业目标与发展路径规划" [${item['日期']}]`);
console.log(` 原单元:${item['所属单元(个人课程)'] || '(空)'}`);
console.log(` 新单元:职业规划课`);
item['所属单元(个人课程)'] = '职业规划课';
fixCount++;
}
}
// 3. 修正"采样方法与仪器选型"的单元
if (item['个人课程表'] === '采样方法与仪器选型') {
if (item['所属单元(个人课程)'] !== '空气及废气检测') {
console.log(`\n修正课程 "采样方法与仪器选型" [${item['日期']}]`);
console.log(` 原单元:${item['所属单元(个人课程)'] || '(空)'}`);
console.log(` 新单元:空气及废气检测`);
item['所属单元(个人课程)'] = '空气及废气检测';
fixCount++;
}
}
});
// 写回文件
fs.writeFileSync(dataPath, JSON.stringify(data, null, 2), 'utf8');
console.log(`\n修正完成!共更新了 ${fixCount} 条记录的单元归属。`);
// 验证修正结果
console.log('\n验证结果');
const summaryCount = data.filter(d => d['个人课程表'] === '单元小结' && d['所属单元(个人课程)']).length;
const careerCount = data.filter(d => d['个人课程表'] === '个人职业目标与发展路径规划' && d['所属单元(个人课程)'] === '职业规划课').length;
const samplingCount = data.filter(d => d['个人课程表'] === '采样方法与仪器选型' && d['所属单元(个人课程)'] === '空气及废气检测').length;
console.log(` - 单元小结有单元归属的数量:${summaryCount}/10`);
console.log(` - 个人职业目标与发展路径规划归属于"职业规划课"${careerCount > 0 ? '是' : '否'}`);
console.log(` - 采样方法与仪器选型归属于"空气及废气检测"${samplingCount > 0 ? '是' : '否'}`);