Files
online_sys/frontend_大健康/updateJobLevel.js
KQL a7242f0c69 Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸
- 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB
- 配置完善的.gitignore文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 18:16:55 +08:00

43 lines
1.8 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.

// 更新joblevel.json文件添加智能制造岗位
import fs from 'fs';
// 读取智能制造数据
const manufacturingData = JSON.parse(
fs.readFileSync('网页未导入数据/智能制造产业/智能制造岗位简历.json', 'utf8')
);
// 读取现有的joblevel.json
const jobLevelData = JSON.parse(
fs.readFileSync('src/data/joblevel.json', 'utf8')
);
// 备份原文件
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
fs.copyFileSync('src/data/joblevel.json', `src/data/joblevel.json.backup_${timestamp}`);
console.log('正在添加智能制造岗位到joblevel.json...');
// 处理智能制造岗位
manufacturingData.forEach((item, index) => {
const levelKey = item['岗位等级标签'] === '技术骨干岗' ? 'middle' :
item['岗位等级标签'] === '储备干部岗' ? 'high' : 'ordinary';
const jobEntry = {
record_id: `manufacturing_${index + 1}`,
position_name: item['岗位名称'],
img: item['简历头像url'] || "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/img/butler_position_avatar/recuPFXZhkWje7.jpeg"
};
// 添加到对应的等级中
jobLevelData.data[levelKey].list.push(jobEntry);
});
// 写入更新后的文件
fs.writeFileSync('src/data/joblevel.json', JSON.stringify(jobLevelData, null, 4), 'utf8');
console.log('✅ 智能制造岗位已添加到joblevel.json');
console.log(`- 储备干部岗: ${jobLevelData.data.high.list.filter(item => item.record_id.startsWith('manufacturing_')).length}`);
console.log(`- 技术骨干岗: ${jobLevelData.data.middle.list.filter(item => item.record_id.startsWith('manufacturing_')).length}`);
console.log(`- 普通岗: ${jobLevelData.data.ordinary.list.filter(item => item.record_id.startsWith('manufacturing_')).length}`);
console.log('请刷新页面查看效果!');