Files
ALL-teach_sys/frontend_环保/complete_all_updates.py
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含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>
2025-09-24 14:14:14 +08:00

89 lines
3.1 KiB
Python
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.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import re
# 读取清理后的数据
with open('resume_updates_cleaned.json', 'r', encoding='utf-8') as f:
updates = json.load(f)
# 读取resumeInterviewMock.js
with open('src/mocks/resumeInterviewMock.js', 'r', encoding='utf-8') as f:
content = f.read()
print("批量更新所有岗位的完整studentInfo数据...")
# 需要更新的所有岗位
all_positions = [
'文创产品设计师',
'文创产品策划师',
'文创产品设计师助理',
'品牌策划运营专员',
'品牌公关',
'品牌推广专员',
'ip运营',
'IP运营总监助理',
'品牌公关管培生'
]
success_count = 0
for position in all_positions:
update_data = next((u for u in updates if u['position'] == position), None)
if not update_data:
print(f"⚠ 未找到{position}的更新数据")
continue
# 准备完整的studentInfo数据
student_info = update_data['studentInfo']
# 构建完整的studentInfo字符串
student_info_str = f'''studentInfo: {{
project_experience: {{
project_name: "{student_info['project_experience']['project_name']}",
position: "{student_info['project_experience']['position']}",
time_period: "{student_info['project_experience']['time_period']}",
company: "{student_info['project_experience']['company']}",
description: `{student_info['project_experience']['description']}`
}},
core_skills: {json.dumps(student_info['core_skills'], ensure_ascii=False, indent=10).replace('"', '`')},
compound_skills: {json.dumps(student_info['compound_skills'], ensure_ascii=False, indent=10).replace('"', '`')},
personal_summary: "{student_info['personal_summary']}"
}}'''
# 使用正则表达式替换整个studentInfo部分
# 查找模式position: "岗位名"...studentInfo: {...}
pattern = rf'(position:\s*"{re.escape(position)}"[^}}]*?)studentInfo:\s*{{[^}}]*(?:{{[^}}]*}}[^}}]*)*}}'
# 替换为新的studentInfo
replacement = rf'\1{student_info_str}'
# 执行替换
new_content, count = re.subn(pattern, replacement, content, flags=re.DOTALL)
if count > 0:
content = new_content
print(f"{position} studentInfo已完整更新")
success_count += 1
else:
print(f"{position} 未能匹配到studentInfo位置")
# 保存更新后的文件
with open('src/mocks/resumeInterviewMock.js', 'w', encoding='utf-8') as f:
f.write(content)
print(f"\n✓ 成功更新 {success_count}/{len(all_positions)} 个岗位的数据!")
# 验证更新
print("\n验证更新结果...")
for position in all_positions[:3]: # 验证前3个
if f'position: "{position}"' in content:
pos = content.find(f'position: "{position}"')
section = content[pos:pos+500]
if 'project_experience: null' in section:
print(f"{position} 仍有null值")
elif 'project_experience: {' in section:
print(f"{position} 已更新")
else:
print(f" ? {position} 状态未知")