主要内容: - 包含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>
104 lines
3.4 KiB
JavaScript
104 lines
3.4 KiB
JavaScript
import fs from 'fs';
|
|
|
|
// 读取财经商贸项目案例数据
|
|
const caseData = JSON.parse(fs.readFileSync('网页未导入数据/财经商贸产业/财经商贸项目案例.json', 'utf8'));
|
|
|
|
// 读取现有的映射文件
|
|
let mappingContent = fs.readFileSync('src/data/projectUnitsMapping.js', 'utf8');
|
|
|
|
// 构建财经商贸项目单元映射
|
|
const financeMapping = {};
|
|
|
|
caseData.slice(0, 20).forEach(item => {
|
|
const projectName = item['案例名称'];
|
|
const verticalUnit = item['对应单元名称(垂直能力课)'];
|
|
const compoundUnit = item['对应单元名称(复合能力课)'];
|
|
|
|
financeMapping[projectName] = {
|
|
compoundUnits: compoundUnit ? [compoundUnit] : [],
|
|
verticalUnits: verticalUnit ? [verticalUnit] : []
|
|
};
|
|
});
|
|
|
|
// 生成新的映射对象字符串
|
|
const newMappingStr = JSON.stringify(financeMapping, null, 2)
|
|
.replace(/"([^"]+)":/g, ' "$1":')
|
|
.replace(/"/g, '"');
|
|
|
|
// 查找现有的智能制造映射部分
|
|
const existingMappingStart = mappingContent.indexOf('export const projectUnitsMapping = {');
|
|
const existingMappingEnd = mappingContent.indexOf('};', existingMappingStart) + 2;
|
|
|
|
// 构建新的完整映射文件内容
|
|
const newContent = `// 项目案例对应单元映射数据 - 财经商贸
|
|
// 基于 网页未导入数据/财经商贸产业/财经商贸项目案例.json
|
|
|
|
export const projectUnitsMapping = ${newMappingStr};
|
|
|
|
// 获取项目的复合能力课程
|
|
export const getCompoundUnits = (projectTitle) => {
|
|
if (!projectTitle) return [];
|
|
|
|
// 直接匹配
|
|
if (projectUnitsMapping[projectTitle]) {
|
|
return projectUnitsMapping[projectTitle].compoundUnits || [];
|
|
}
|
|
|
|
// 模糊匹配(包含关系)
|
|
const keys = Object.keys(projectUnitsMapping);
|
|
for (const key of keys) {
|
|
if (projectTitle.includes(key) || key.includes(projectTitle)) {
|
|
return projectUnitsMapping[key].compoundUnits || [];
|
|
}
|
|
}
|
|
|
|
return [];
|
|
};
|
|
|
|
// 获取项目的垂直能力课程
|
|
export const getVerticalUnits = (projectTitle) => {
|
|
if (!projectTitle) return [];
|
|
|
|
// 直接匹配
|
|
if (projectUnitsMapping[projectTitle]) {
|
|
return projectUnitsMapping[projectTitle].verticalUnits || [];
|
|
}
|
|
|
|
// 模糊匹配(包含关系)
|
|
const keys = Object.keys(projectUnitsMapping);
|
|
for (const key of keys) {
|
|
if (projectTitle.includes(key) || key.includes(projectTitle)) {
|
|
return projectUnitsMapping[key].verticalUnits || [];
|
|
}
|
|
}
|
|
|
|
return [];
|
|
};
|
|
|
|
// 获取项目的所有对应单元
|
|
export const getProjectUnits = (projectTitle) => {
|
|
const compoundUnits = getCompoundUnits(projectTitle);
|
|
const verticalUnits = getVerticalUnits(projectTitle);
|
|
return [...compoundUnits, ...verticalUnits];
|
|
};`;
|
|
|
|
// 写入文件
|
|
fs.writeFileSync('src/data/projectUnitsMapping.js', newContent, 'utf8');
|
|
|
|
console.log('项目单元映射已更新为财经商贸数据!');
|
|
console.log(`共添加了 ${Object.keys(financeMapping).length} 个项目的单元映射`);
|
|
|
|
// 显示单元统计
|
|
const allVerticalUnits = new Set();
|
|
const allCompoundUnits = new Set();
|
|
|
|
Object.values(financeMapping).forEach(mapping => {
|
|
mapping.verticalUnits.forEach(unit => allVerticalUnits.add(unit));
|
|
mapping.compoundUnits.forEach(unit => allCompoundUnits.add(unit));
|
|
});
|
|
|
|
console.log(`\n垂直能力课: ${allVerticalUnits.size} 种`);
|
|
[...allVerticalUnits].forEach(unit => console.log(` - ${unit}`));
|
|
|
|
console.log(`\n复合能力课: ${allCompoundUnits.size} 种`);
|
|
[...allCompoundUnits].forEach(unit => console.log(` - ${unit}`)); |