Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸 - 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB - 配置完善的.gitignore文件 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
48
frontend_财经商贸/restoreOriginalCalendar.js
Normal file
48
frontend_财经商贸/restoreOriginalCalendar.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
// 读取财经商贸日历课程表数据
|
||||
const financeCalendarData = JSON.parse(
|
||||
fs.readFileSync(path.join(__dirname, '网页未导入数据/财经商贸产业/财经商贸日历课程表.json'), 'utf-8')
|
||||
);
|
||||
|
||||
// 备份当前文件
|
||||
const backupPath = path.join(__dirname, 'src/data', `intelligentManufacturingCalendar.json.backup_${new Date().toISOString().replace(/[:.]/g, '-')}`);
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, 'src/data/intelligentManufacturingCalendar.json'),
|
||||
backupPath
|
||||
);
|
||||
console.log(`备份已创建: ${backupPath}`);
|
||||
|
||||
// 移除"就业管家"字段,保持数据结构一致
|
||||
const cleanedData = financeCalendarData.map(item => {
|
||||
const { "就业管家": _, ...restItem } = item;
|
||||
return restItem;
|
||||
});
|
||||
|
||||
// 写入清理后的数据
|
||||
fs.writeFileSync(
|
||||
path.join(__dirname, 'src/data/intelligentManufacturingCalendar.json'),
|
||||
JSON.stringify(cleanedData, null, 2),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
console.log(`成功恢复财经商贸日历课程表原始导师分配,共 ${cleanedData.length} 条记录`);
|
||||
|
||||
// 统计导师分配情况
|
||||
const teacherStats = {};
|
||||
cleanedData.forEach(item => {
|
||||
if (item["导师姓名查询"] && item["个人课程表"]) {
|
||||
const teacher = item["导师姓名查询"];
|
||||
teacherStats[teacher] = (teacherStats[teacher] || 0) + 1;
|
||||
}
|
||||
});
|
||||
|
||||
console.log('\n导师课程分配统计:');
|
||||
Object.entries(teacherStats).forEach(([teacher, count]) => {
|
||||
console.log(` ${teacher}: ${count} 门课程`);
|
||||
});
|
||||
Reference in New Issue
Block a user