更新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:
34
frontend/count_courses.cjs
Normal file
34
frontend/count_courses.cjs
Normal file
@@ -0,0 +1,34 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// 读取mockData.js文件
|
||||
const mockDataPath = path.join(__dirname, 'src/data/mockData.js');
|
||||
const mockDataContent = fs.readFileSync(mockDataPath, 'utf-8');
|
||||
|
||||
// 提取homework数组中的课程对象
|
||||
// 匹配 { id: X, name: "xxx", level: "xxx", ... } 格式
|
||||
const coursePattern = /\{\s*id:\s*\d+,\s*name:\s*"([^"]+)",\s*level:\s*"[^"]+"/g;
|
||||
|
||||
let matches = mockDataContent.match(coursePattern);
|
||||
console.log('mockData.js中找到的课程对象总数:', matches ? matches.length : 0);
|
||||
|
||||
// 统计units结构中的courses
|
||||
const unitsPattern = /units:\s*\[([\s\S]*?)\]\s*,\s*\/\/ 保留原始list用于兼容/g;
|
||||
const unitsMatches = [...mockDataContent.matchAll(unitsPattern)];
|
||||
|
||||
console.log('\n找到的units结构数量:', unitsMatches.length);
|
||||
|
||||
let totalCoursesInUnits = 0;
|
||||
unitsMatches.forEach((match, index) => {
|
||||
const unitsContent = match[1];
|
||||
const coursesInThisSection = (unitsContent.match(/\{\s*id:\s*\d+,\s*name:\s*"[^"]+",\s*level:/g) || []).length;
|
||||
console.log(` - 第${index + 1}个section的units中有 ${coursesInThisSection} 个课程`);
|
||||
totalCoursesInUnits += coursesInThisSection;
|
||||
});
|
||||
|
||||
console.log('\nunits结构中的课程总数:', totalCoursesInUnits);
|
||||
|
||||
// 检查有多少课程已经有imageUrl
|
||||
const imageUrlPattern = /imageUrl:\s*"https:\/\/[^"]+"/g;
|
||||
const imageUrlMatches = mockDataContent.match(imageUrlPattern);
|
||||
console.log('\n已添加imageUrl的课程数:', imageUrlMatches ? imageUrlMatches.length : 0);
|
||||
Reference in New Issue
Block a user