Files
ALL-teach_sys/frontend_智能开发/updateClassProjectLibrary.cjs
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

96 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.

const fs = require('fs');
// 读取智能开发项目案例数据
const projectData = JSON.parse(
fs.readFileSync('./网页未导入数据/智能开发产业/智能开发项目案例.json', 'utf-8')
);
console.log(`找到 ${projectData.length} 个智能开发项目案例`);
// 转换为项目库页面需要的格式
const projects = projectData.map((item, index) => {
// 解析对应岗位
const positions = item['对应个人简历名称']
? item['对应个人简历名称'].split(',').map(p => p.trim())
: [];
// 确定单元名称(优先使用垂直能力课,其次复合能力课)
const unit = item['对应单元名称(垂直能力课)'] || item['对应单元名称(复合能力课)'] || '';
// 确定项目类别和方向
const direction = item['所属垂直方向'] || '智能开发';
const directionMap = {
'AI智能应用开发': 'AI应用开发',
'网络安全': '网络安全',
'AI大前端开发': '前端开发',
'AIOps智能运维': '智能运维'
};
const category = directionMap[direction] || direction;
return {
id: index + 1,
name: item['案例名称'],
description: direction,
positions: positions,
unit: unit,
direction: direction,
category: category,
// 保留项目详情内容
projectDetail: item['项目案例内容'] || ''
};
});
// 读取现有的projectLibraryMock.js文件
const mockFilePath = './src/mocks/projectLibraryMock.js';
let mockFileContent = fs.readFileSync(mockFilePath, 'utf-8');
// 只替换projects数组部分
const projectsStr = JSON.stringify(projects, null, 4);
// 找到projects数组的开始和结束位置
const projectsStartPattern = /const projects = \[/;
const projectsEndPattern = /\];\s*\/\/ 搜索过滤/;
const startMatch = mockFileContent.match(projectsStartPattern);
const endMatch = mockFileContent.match(projectsEndPattern);
if (startMatch && endMatch) {
const startIndex = startMatch.index;
const endIndex = mockFileContent.indexOf('];', startIndex) + 2;
// 构建新的projects部分
const newProjectsSection = `const projects = ${projectsStr};`;
// 替换内容
mockFileContent =
mockFileContent.substring(0, startIndex) +
newProjectsSection +
mockFileContent.substring(endIndex);
// 写入文件
fs.writeFileSync(mockFilePath, mockFileContent, 'utf-8');
console.log('✅ 班级项目库数据更新成功!');
console.log(`- 共更新 ${projects.length} 个项目`);
// 统计信息
const categoryCount = {};
projects.forEach(p => {
categoryCount[p.category] = (categoryCount[p.category] || 0) + 1;
});
console.log('\n项目类别统计');
Object.entries(categoryCount).forEach(([cat, count]) => {
console.log(` ${cat}: ${count}`);
});
console.log('\n前5个项目示例');
projects.slice(0, 5).forEach((p, i) => {
console.log(` ${i+1}. ${p.name}`);
console.log(` 单元: ${p.unit}`);
console.log(` 方向: ${p.direction}`);
console.log(` 岗位: ${p.positions.slice(0, 3).join(', ')}`);
});
} else {
console.error('❌ 未找到projects数组位置请检查文件格式');
}