主要内容: - 包含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>
116 lines
3.4 KiB
JavaScript
116 lines
3.4 KiB
JavaScript
// 转换智能制造项目案例数据为项目库格式
|
|
|
|
import fs from 'fs';
|
|
|
|
// 读取智能制造项目案例数据
|
|
const rawData = JSON.parse(
|
|
fs.readFileSync('网页未导入数据/智能制造产业/智能制造项目案例.json', 'utf8')
|
|
);
|
|
|
|
// 转换数据格式
|
|
const projects = rawData.map((item, index) => {
|
|
// 提取岗位名称列表
|
|
const positions = item['对应个人简历名称'] ?
|
|
item['对应个人简历名称'].split(',').map(p => p.trim()) : [];
|
|
|
|
// 确定项目类别
|
|
let category = '智能制造';
|
|
let direction = item['所属垂直方向'] || '智能制造';
|
|
|
|
// 根据单元名称细分类别
|
|
if (item['对应单元名称(垂直能力课)']) {
|
|
if (item['对应单元名称(垂直能力课)'].includes('新能源')) {
|
|
category = '新能源制造';
|
|
} else if (item['对应单元名称(垂直能力课)'].includes('PLC')) {
|
|
category = 'PLC控制系统';
|
|
} else if (item['对应单元名称(垂直能力课)'].includes('机器人')) {
|
|
category = '工业机器人';
|
|
} else if (item['对应单元名称(垂直能力课)'].includes('3D打印')) {
|
|
category = '3D打印技术';
|
|
} else if (item['对应单元名称(垂直能力课)'].includes('数控')) {
|
|
category = '数控加工';
|
|
}
|
|
}
|
|
|
|
return {
|
|
id: index + 1,
|
|
name: item['案例名称'],
|
|
description: direction,
|
|
positions: positions,
|
|
unit: item['对应单元名称(垂直能力课)'] || item['对应单元名称(复合能力课)'],
|
|
direction: direction,
|
|
category: category,
|
|
content: item['项目案例内容'] || ''
|
|
};
|
|
});
|
|
|
|
// 生成mock数据格式
|
|
const mockCode = `// 项目库Mock数据
|
|
export const getMockProjectsList = (params = {}) => {
|
|
const { search = "", page = 1, pageSize = 10 } = params;
|
|
|
|
// 完整项目列表数据
|
|
const projects = ${JSON.stringify(projects, null, 4)};
|
|
|
|
// 搜索过滤
|
|
let filteredProjects = projects;
|
|
if (search) {
|
|
const searchLower = search.toLowerCase();
|
|
filteredProjects = projects.filter(project =>
|
|
project.name.toLowerCase().includes(searchLower) ||
|
|
project.description.toLowerCase().includes(searchLower) ||
|
|
project.positions.some(pos => pos.toLowerCase().includes(searchLower)) ||
|
|
project.unit.toLowerCase().includes(searchLower) ||
|
|
project.category.toLowerCase().includes(searchLower)
|
|
);
|
|
}
|
|
|
|
// 分页处理
|
|
const total = filteredProjects.length;
|
|
const startIndex = (page - 1) * pageSize;
|
|
const endIndex = startIndex + pageSize;
|
|
const pagedProjects = filteredProjects.slice(startIndex, endIndex);
|
|
|
|
return {
|
|
success: true,
|
|
data: {
|
|
list: pagedProjects,
|
|
total: total,
|
|
page: page,
|
|
pageSize: pageSize
|
|
}
|
|
};
|
|
};
|
|
|
|
// 获取项目详情
|
|
export const getMockProjectDetail = (id) => {
|
|
const projects = ${JSON.stringify(projects.slice(0, 3), null, 4)};
|
|
|
|
const project = projects.find(p => p.id === parseInt(id));
|
|
|
|
if (project) {
|
|
return {
|
|
success: true,
|
|
data: project
|
|
};
|
|
}
|
|
|
|
return {
|
|
success: false,
|
|
message: "项目不存在"
|
|
};
|
|
};
|
|
`;
|
|
|
|
// 写入转换后的文件
|
|
fs.writeFileSync('projectLibraryMock_new.js', mockCode, 'utf8');
|
|
|
|
console.log(`转换完成!
|
|
- 项目总数: ${projects.length}
|
|
- 类别分布:
|
|
${[...new Set(projects.map(p => p.category))].map(cat =>
|
|
` - ${cat}: ${projects.filter(p => p.category === cat).length}个`
|
|
).join('\n')}
|
|
|
|
文件已保存为: projectLibraryMock_new.js
|
|
`); |