主要内容: - 包含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>
77 lines
2.9 KiB
Python
77 lines
2.9 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import json
|
||
import re
|
||
|
||
def fix_position_levels_safe():
|
||
"""
|
||
安全地修复项目详情数据中的岗位等级标签
|
||
"""
|
||
|
||
# 读取能源岗位简历数据,建立岗位名称到等级的映射
|
||
with open("网页未导入数据/能源产业/能源岗位简历.json", 'r', encoding='utf-8') as f:
|
||
resume_data = json.load(f)
|
||
|
||
# 建立岗位名称到等级的映射字典
|
||
position_level_mapping = {}
|
||
for item in resume_data:
|
||
position_name = item.get("岗位名称", "")
|
||
position_level = item.get("岗位等级标签", "技术骨干岗")
|
||
if position_name:
|
||
position_level_mapping[position_name] = position_level
|
||
|
||
print("🔍 岗位等级映射表构建完成")
|
||
print(f" 技术骨干岗: {len([p for p, l in position_level_mapping.items() if l == '技术骨干岗'])}个")
|
||
print(f" 储备干部岗: {len([p for p, l in position_level_mapping.items() if l == '储备干部岗'])}个")
|
||
print(f" 普通岗: {len([p for p, l in position_level_mapping.items() if l == '普通岗'])}个")
|
||
|
||
# 读取当前的Mock数据
|
||
with open("src/mocks/projectLibraryMock.js", 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
|
||
# 定义替换函数,只修改level字段
|
||
def replace_level(match):
|
||
current_level = match.group(1)
|
||
position_name = match.group(2)
|
||
|
||
# 查找正确的等级
|
||
correct_level = position_level_mapping.get(position_name, current_level)
|
||
|
||
# 如果等级不同,则替换
|
||
if correct_level != current_level:
|
||
print(f" 📝 更新 {position_name}: {current_level} → {correct_level}")
|
||
|
||
return f'"level": "{correct_level}", "position": "{position_name}"'
|
||
|
||
# 使用正则表达式替换所有的level字段
|
||
pattern = r'"level": "([^"]*)", "position": "([^"]*)"'
|
||
updated_content = re.sub(pattern, replace_level, content)
|
||
|
||
# 写入更新后的内容
|
||
with open("src/mocks/projectLibraryMock.js", 'w', encoding='utf-8') as f:
|
||
f.write(updated_content)
|
||
|
||
# 统计修复结果
|
||
updated_matches = re.findall(pattern, updated_content)
|
||
level_stats = {}
|
||
for level, position in updated_matches:
|
||
if level not in level_stats:
|
||
level_stats[level] = []
|
||
level_stats[level].append(position)
|
||
|
||
print("\n✅ 修复完成!更新后的等级标签统计:")
|
||
for level in ["技术骨干岗", "储备干部岗", "普通岗"]:
|
||
if level in level_stats:
|
||
positions = level_stats[level]
|
||
print(f" {level}: {len(positions)}个岗位")
|
||
for pos in positions[:3]:
|
||
print(f" - {pos}")
|
||
if len(positions) > 3:
|
||
print(f" ... 还有{len(positions)-3}个岗位")
|
||
print()
|
||
|
||
print(f"📝 总计: {len(updated_matches)}个岗位的等级标签已检查并更新")
|
||
|
||
if __name__ == "__main__":
|
||
fix_position_levels_safe() |