Files
ALL-teach_sys/frontend_财经商贸/checkCalendarDuplicates.js
KQL 38350dca36 更新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>
2025-10-17 14:36:25 +08:00

83 lines
2.4 KiB
JavaScript

import { mockData } from './src/data/mockData.js';
// 检查日历事件中的重复
const events = mockData.calendarEvents;
// 按日期分组
const dateMap = {};
events.forEach((event, index) => {
// 提取日期部分
const dateMatch = event.startTime?.match(/^(\d{4}-\d{2}-\d{2})/);
const date = dateMatch ? dateMatch[1] : 'unknown';
if (!dateMap[date]) {
dateMap[date] = [];
}
// 只关注AI课程和营销能力课
if (event.type === 'ai-course' || event.type === 'marketing-course') {
dateMap[date].push({
index: index,
type: event.type,
title: event.title,
teacher: event.teacher,
time: event.startTime + ' - ' + event.endTime
});
}
});
console.log('检查AI课程(ai-course)和营销能力课(marketing-course)的重复:\n');
let duplicatesFound = false;
// 查找同一天有多个同类型课程的情况
Object.keys(dateMap).sort().forEach(date => {
const courses = dateMap[date];
// 按类型分组
const typeGroups = {};
courses.forEach(course => {
if (!typeGroups[course.type]) {
typeGroups[course.type] = [];
}
typeGroups[course.type].push(course);
});
// 检查是否有重复
Object.keys(typeGroups).forEach(type => {
if (typeGroups[type].length > 1) {
duplicatesFound = true;
console.log(`日期: ${date}`);
console.log(` 类型: ${type} (出现${typeGroups[type].length}次)`);
typeGroups[type].forEach(course => {
console.log(` [索引${course.index}] ${course.title} - ${course.teacher}`);
});
console.log('');
}
});
});
if (!duplicatesFound) {
console.log('没有发现同一天有重复的AI课程或营销能力课\n');
}
// 统计总数
const aiCourses = events.filter(e => e.type === 'ai-course');
const marketingCourses = events.filter(e => e.type === 'marketing-course');
console.log('统计信息:');
console.log(`AI课程(ai-course)总数: ${aiCourses.length}`);
console.log(`营销能力课(marketing-course)总数: ${marketingCourses.length}`);
console.log(`日历事件总数: ${events.length}`);
// 显示前几个AI课程和营销能力课
console.log('\n前5个AI课程:');
aiCourses.slice(0, 5).forEach((course, i) => {
console.log(` ${i+1}. ${course.title} - ${course.startTime?.split(' ')[0]}`);
});
console.log('\n前5个营销能力课:');
marketingCourses.slice(0, 5).forEach((course, i) => {
console.log(` ${i+1}. ${course.title} - ${course.startTime?.split(' ')[0]}`);
});