初始化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>
This commit is contained in:
122
frontend_视觉设计/fix_original_resume_content.py
Normal file
122
frontend_视觉设计/fix_original_resume_content.py
Normal file
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
修复岗位对象中的原始版简历内容
|
||||
将resumeTemplates中的真实原始版内容复制到industries.positions的content.original中
|
||||
"""
|
||||
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
from datetime import datetime
|
||||
|
||||
def fix_original_resume_content():
|
||||
"""修复原始版简历内容"""
|
||||
|
||||
file_path = "src/mocks/resumeInterviewMock.js"
|
||||
|
||||
# 创建备份
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
backup_path = f"{file_path}.backup_fix_original_{timestamp}"
|
||||
shutil.copy2(file_path, backup_path)
|
||||
print(f"📦 已创建备份: {backup_path}")
|
||||
|
||||
try:
|
||||
# 读取文件
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
print("🚀 开始修复原始版简历内容...")
|
||||
|
||||
# 需要修复的岗位列表
|
||||
positions_to_fix = [
|
||||
"UI设计师",
|
||||
"包装设计师",
|
||||
"摄影师",
|
||||
"角色原画师",
|
||||
"影视灯光",
|
||||
"摄影美术指导助理",
|
||||
"品牌视觉内容策划",
|
||||
"影视摄像",
|
||||
"AI绘画师",
|
||||
"CG总监助理"
|
||||
]
|
||||
|
||||
# 从resumeTemplates中提取原始版内容的映射
|
||||
resume_templates_pattern = r'const resumeTemplates = \{(.*?)\};'
|
||||
templates_match = re.search(resume_templates_pattern, content, re.DOTALL)
|
||||
|
||||
if not templates_match:
|
||||
print("❌ 无法找到resumeTemplates部分")
|
||||
return
|
||||
|
||||
templates_content = templates_match.group(1)
|
||||
|
||||
# 提取各岗位的原始版内容
|
||||
original_content_map = {}
|
||||
|
||||
for position in positions_to_fix:
|
||||
# 查找该岗位在resumeTemplates中的定义
|
||||
position_pattern = rf'"position":\s*"{re.escape(position)}".*?"original":\s*"([^"]*(?:\\.[^"]*)*)"'
|
||||
position_match = re.search(position_pattern, templates_content, re.DOTALL)
|
||||
|
||||
if position_match:
|
||||
original_content = position_match.group(1)
|
||||
original_content_map[position] = original_content
|
||||
print(f"✅ 找到 {position} 的原始版内容")
|
||||
else:
|
||||
print(f"⚠️ 未找到 {position} 在resumeTemplates中的原始版内容")
|
||||
|
||||
print(f"📊 找到 {len(original_content_map)} 个岗位的原始版内容")
|
||||
|
||||
# 更新industries.positions中的content.original
|
||||
updated_count = 0
|
||||
|
||||
for position_title, original_content in original_content_map.items():
|
||||
# 查找该岗位在industries中的位置
|
||||
position_pattern = rf'("title":\s*"{re.escape(position_title)}".*?"content":\s*\{{.*?"original":\s*")([^"]*(?:\\.[^"]*)*)"'
|
||||
|
||||
def replace_original(match):
|
||||
nonlocal updated_count
|
||||
prefix = match.group(1)
|
||||
old_content = match.group(2)
|
||||
updated_count += 1
|
||||
print(f"🔄 更新 {position_title} 的原始版内容")
|
||||
return prefix + original_content + '"'
|
||||
|
||||
content = re.sub(position_pattern, replace_original, content, flags=re.DOTALL)
|
||||
|
||||
# 写入文件
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f"📊 处理统计:")
|
||||
print(f" - 需要修复的岗位数: {len(positions_to_fix)}")
|
||||
print(f" - 找到原始内容的岗位数: {len(original_content_map)}")
|
||||
print(f" - 成功更新的岗位数: {updated_count}")
|
||||
print(f"✅ 已更新 {file_path}")
|
||||
|
||||
# 验证JS语法
|
||||
import subprocess
|
||||
try:
|
||||
result = subprocess.run(['node', '-c', file_path], capture_output=True, text=True)
|
||||
if result.returncode == 0:
|
||||
print("✅ JavaScript语法验证通过")
|
||||
else:
|
||||
print(f"❌ JavaScript语法验证失败: {result.stderr}")
|
||||
# 恢复备份
|
||||
shutil.copy2(backup_path, file_path)
|
||||
print("🔄 已恢复原始文件")
|
||||
except Exception as e:
|
||||
print(f"⚠️ 无法验证JavaScript语法: {e}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ 处理失败: {e}")
|
||||
# 恢复备份
|
||||
shutil.copy2(backup_path, file_path)
|
||||
print("🔄 已恢复原始文件")
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("🚀 开始修复原始版简历内容...")
|
||||
fix_original_resume_content()
|
||||
print("🎉 处理完成!")
|
||||
Reference in New Issue
Block a user