主要内容: - 包含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>
110 lines
3.6 KiB
Python
110 lines
3.6 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import json
|
||
import datetime
|
||
import shutil
|
||
|
||
def generate_resume_templates():
|
||
"""生成简历模板数据"""
|
||
|
||
# 读取能源岗位简历数据
|
||
with open("网页未导入数据/能源产业/能源岗位简历.json", 'r', encoding='utf-8') as f:
|
||
energy_jobs = json.load(f)
|
||
|
||
# 按岗位群分组
|
||
resume_templates = {}
|
||
|
||
for job in energy_jobs:
|
||
group_name = job.get("简历岗位群", "")
|
||
position_name = job.get("岗位名称", "")
|
||
|
||
if group_name and position_name:
|
||
if group_name not in resume_templates:
|
||
resume_templates[group_name] = []
|
||
|
||
# 添加模板数据
|
||
template = {
|
||
"position": position_name,
|
||
"level": job.get("岗位级别", "基础岗"),
|
||
"avatar": job.get("岗位头像", ""),
|
||
"content": {
|
||
"original": job.get("简历模板", ""),
|
||
"modified": job.get("修改后简历", "")
|
||
},
|
||
"studentInfo": {
|
||
"project_experience": {
|
||
"project_name": "",
|
||
"position": "",
|
||
"time_period": "XXXXXX",
|
||
"company": "XXXXXX",
|
||
"description": ""
|
||
},
|
||
"core_skills": [],
|
||
"compound_skills": [],
|
||
"personal_summary": ""
|
||
}
|
||
}
|
||
resume_templates[group_name].append(template)
|
||
|
||
return resume_templates
|
||
|
||
def update_mock_file():
|
||
"""更新mock文件,添加resumeTemplates"""
|
||
|
||
mock_file = "src/mocks/resumeInterviewMock.js"
|
||
|
||
# 备份文件
|
||
backup_path = f"{mock_file}.backup_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
||
shutil.copy(mock_file, backup_path)
|
||
print(f"✅ 已备份文件到:{backup_path}")
|
||
|
||
# 生成resumeTemplates
|
||
resume_templates = generate_resume_templates()
|
||
|
||
# 读取当前文件
|
||
with open(mock_file, 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
|
||
# 在industries定义后添加resumeTemplates
|
||
industries_end = content.find('];')
|
||
if industries_end > 0:
|
||
# 在industries数组结束后插入resumeTemplates
|
||
insert_pos = industries_end + 2
|
||
|
||
# 生成resumeTemplates的JS代码
|
||
templates_js = "\n\n// 简历模板数据\nconst resumeTemplates = " + json.dumps(resume_templates, ensure_ascii=False, indent=2) + ";\n"
|
||
|
||
# 插入resumeTemplates
|
||
new_content = content[:insert_pos] + templates_js + content[insert_pos:]
|
||
|
||
# 更新getMockPageData函数
|
||
new_content = new_content.replace(
|
||
'export function getMockPageData() {\n return {\n industries,\n positions: []\n };\n}',
|
||
'''export function getMockPageData() {
|
||
return {
|
||
industries,
|
||
resumeTemplates,
|
||
positions: [],
|
||
myResume
|
||
};
|
||
}'''
|
||
)
|
||
|
||
# 写回文件
|
||
with open(mock_file, 'w', encoding='utf-8') as f:
|
||
f.write(new_content)
|
||
|
||
print("✅ 成功添加resumeTemplates数据")
|
||
|
||
# 统计
|
||
print("\n📊 简历模板统计:")
|
||
for group_name, templates in resume_templates.items():
|
||
print(f" - {group_name}: {len(templates)}个模板")
|
||
print(f"\n📈 总计:{len(resume_templates)}个岗位群,{sum(len(t) for t in resume_templates.values())}个简历模板")
|
||
else:
|
||
print("❌ 未找到industries数组结束位置")
|
||
|
||
if __name__ == "__main__":
|
||
update_mock_file()
|