主要内容: - 包含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>
92 lines
3.4 KiB
Python
92 lines
3.4 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import json
|
|
import re
|
|
|
|
def fix_position_levels():
|
|
"""
|
|
修复项目详情数据中的岗位等级标签,使其与能源岗位简历.json中的等级数据保持一致
|
|
"""
|
|
|
|
# 读取能源岗位简历数据,建立岗位名称到等级的映射
|
|
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("🔍 岗位等级映射表:")
|
|
for level in ["技术骨干岗", "储备干部岗", "普通岗"]:
|
|
positions = [pos for pos, lv in position_level_mapping.items() if lv == level]
|
|
print(f" {level}: {len(positions)}个岗位")
|
|
for pos in positions[:3]:
|
|
print(f" - {pos}")
|
|
if len(positions) > 3:
|
|
print(f" ... 还有{len(positions)-3}个岗位")
|
|
print()
|
|
|
|
# 读取当前的Mock数据
|
|
with open("src/mocks/projectLibraryMock.js", 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# 找到getMockProjectDetail函数中的projects数组
|
|
pattern = r'(export const getMockProjectDetail = \(id\) => \{\s*// 直接根据ID返回对应项目的详情\s*const projects = )\[[\s\S]*?\];'
|
|
match = re.search(pattern, content)
|
|
|
|
if not match:
|
|
print("❌ 未找到projects数组")
|
|
return
|
|
|
|
# 提取项目数组部分
|
|
projects_start = match.start(1) + len(match.group(1))
|
|
projects_end = match.end()
|
|
projects_section = content[projects_start:projects_end]
|
|
|
|
# 逐个修复项目中的position级别
|
|
def fix_position_level(match_obj):
|
|
level = match_obj.group(1)
|
|
position = match_obj.group(2)
|
|
|
|
# 查找正确的等级
|
|
correct_level = position_level_mapping.get(position, "技术骨干岗")
|
|
|
|
return f'{{"level": "{correct_level}", "position": "{position}"}}'
|
|
|
|
# 替换所有的position对象
|
|
position_pattern = r'\{\s*"level": "([^"]*)",\s*"position": "([^"]*)"\s*\}'
|
|
fixed_projects_section = re.sub(position_pattern, fix_position_level, projects_section)
|
|
|
|
# 重新构建完整的文件内容
|
|
updated_content = content[:projects_start] + fixed_projects_section
|
|
|
|
# 写入更新后的内容
|
|
with open("src/mocks/projectLibraryMock.js", 'w', encoding='utf-8') as f:
|
|
f.write(updated_content)
|
|
|
|
# 统计修复结果
|
|
updated_matches = re.findall(position_pattern, fixed_projects_section)
|
|
level_stats = {}
|
|
for level, position in updated_matches:
|
|
if level not in level_stats:
|
|
level_stats[level] = []
|
|
level_stats[level].append(position)
|
|
|
|
print("✅ 修复完成!更新后的等级标签统计:")
|
|
for level, positions in level_stats.items():
|
|
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() |