主要内容: - 包含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>
125 lines
3.9 KiB
JavaScript
125 lines
3.9 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// 读取智能开发岗位简历数据,获取准确的岗位等级映射
|
|
const resumeData = JSON.parse(
|
|
fs.readFileSync('网页未导入数据/智能开发产业/智能开发岗位简历.json', 'utf-8')
|
|
);
|
|
|
|
// 创建岗位名称到等级标签的映射
|
|
const positionLevelMap = {};
|
|
resumeData.forEach(item => {
|
|
positionLevelMap[item['岗位名称']] = item['岗位等级标签'];
|
|
});
|
|
|
|
console.log('岗位等级映射表:');
|
|
console.log(positionLevelMap);
|
|
|
|
// 读取智能开发项目案例数据
|
|
const projectData = JSON.parse(
|
|
fs.readFileSync('网页未导入数据/智能开发产业/智能开发项目案例.json', 'utf-8')
|
|
);
|
|
|
|
// 读取当前的mock文件
|
|
const mockFilePath = path.join(__dirname, 'src/mocks/projectLibraryMock.js');
|
|
let mockFileContent = fs.readFileSync(mockFilePath, 'utf-8');
|
|
|
|
// 构建项目详情数据 - 只更新岗位等级部分
|
|
let projectDetailsStr = ' const projectDetails = {\n';
|
|
|
|
projectData.forEach((project, index) => {
|
|
const id = index + 1;
|
|
|
|
// 获取适用岗位字符串并分割
|
|
const positionsStr = project['适用岗位'] || '';
|
|
const positionsList = positionsStr ? positionsStr.split(',').map(p => p.trim()) : [];
|
|
|
|
// 为每个岗位查找正确的等级
|
|
const applicablePositions = positionsList.map(pos => {
|
|
// 从映射表中获取准确的等级
|
|
const level = positionLevelMap[pos] || '技术骨干岗'; // 默认值
|
|
console.log(`岗位: ${pos} -> 等级: ${level}`);
|
|
return `{ level: '${level}', position: '${pos}' }`;
|
|
}).join(', ');
|
|
|
|
// 获取单元列表
|
|
const units = [];
|
|
const compoundUnit = project['对应单元名称(复合能力课)'];
|
|
const verticalUnit = project['对应单元名称(垂直能力课)'];
|
|
|
|
if (compoundUnit) {
|
|
units.push(compoundUnit);
|
|
}
|
|
if (verticalUnit) {
|
|
units.push(verticalUnit);
|
|
}
|
|
|
|
const unitsStr = units.map(u => `'${u.replace(/'/g, "\\'")}'`).join(', ');
|
|
|
|
// 处理项目案例内容 - 提取概述、流程和技术点
|
|
const content = project['项目案例内容'] || '';
|
|
|
|
// 提取项目概述
|
|
let overview = '';
|
|
const overviewMatch = content.match(/# 一、项目概述[\s\S]*?(?=# 二、|$)/);
|
|
if (overviewMatch) {
|
|
overview = overviewMatch[0]
|
|
.replace(/# 一、项目概述\s*\n/, '')
|
|
.replace(/\n/g, ' ')
|
|
.replace(/\s+/g, ' ')
|
|
.trim()
|
|
.replace(/'/g, "\\'");
|
|
}
|
|
|
|
// 提取项目流程
|
|
let process = '';
|
|
const processMatch = content.match(/# 二、项目整体流程介绍[\s\S]*?(?=# 三、|$)/);
|
|
if (processMatch) {
|
|
process = processMatch[0]
|
|
.replace(/'/g, "\\'")
|
|
.replace(/\n/g, '\\n');
|
|
}
|
|
|
|
// 提取关键技术点
|
|
let keyPoints = '';
|
|
const keyPointsMatch = content.match(/# 三、项目案例关键技术点[\s\S]*$/);
|
|
if (keyPointsMatch) {
|
|
keyPoints = keyPointsMatch[0]
|
|
.replace(/'/g, "\\'")
|
|
.replace(/\n/g, '\\n');
|
|
}
|
|
|
|
// 处理文本内容
|
|
const title = (project['案例名称'] + '详情').replace(/'/g, "\\'");
|
|
|
|
projectDetailsStr += ` ${id}: {
|
|
id: ${id},
|
|
title: '${title}',
|
|
overview: '${overview}',
|
|
applicablePositions: [${applicablePositions}],
|
|
units: [${unitsStr}],
|
|
process: '${process}',
|
|
keyPoints: '${keyPoints}',
|
|
attachments: [
|
|
{ name: '项目文档.docx', size: '1.2MB', type: 'doc' },
|
|
{ name: '项目执行手册.pdf', size: '1.8MB', type: 'pdf' }
|
|
]
|
|
}`;
|
|
|
|
if (index < projectData.length - 1) {
|
|
projectDetailsStr += ',\n';
|
|
}
|
|
});
|
|
|
|
projectDetailsStr += '\n };\n';
|
|
|
|
// 替换projectDetails对象
|
|
const detailsPattern = /const projectDetails = \{[\s\S]*?\n \};/;
|
|
mockFileContent = mockFileContent.replace(detailsPattern, projectDetailsStr.trim());
|
|
|
|
// 写入文件
|
|
fs.writeFileSync(mockFilePath, mockFileContent);
|
|
|
|
console.log('\n✅ 岗位等级标签已成功修复!');
|
|
console.log('- 使用智能开发岗位简历.json中的准确等级映射');
|
|
console.log('- 所有项目详情中的岗位等级已更新'); |