主要内容: - 包含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>
82 lines
2.3 KiB
Python
82 lines
2.3 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import re
|
||
|
||
def merge_files():
|
||
"""合并temp_mock_data.js到resumeInterviewMock.js"""
|
||
|
||
# 读取原始文件
|
||
with open('src/mocks/resumeInterviewMock.js.backup_final', 'r', encoding='utf-8') as f:
|
||
original_content = f.read()
|
||
|
||
# 读取新生成的数据
|
||
with open('temp_mock_data.js', 'r', encoding='utf-8') as f:
|
||
new_content = f.read()
|
||
|
||
# 从新文件中提取industries和resumeTemplates
|
||
# 提取industries
|
||
industries_match = re.search(r'const industries = (\[[\s\S]*?\n\]);', new_content, re.MULTILINE)
|
||
if not industries_match:
|
||
print("错误:无法从temp_mock_data.js中提取industries")
|
||
return False
|
||
new_industries = industries_match.group(0)
|
||
|
||
# 提取resumeTemplates
|
||
templates_match = re.search(r'const resumeTemplates = (\{[\s\S]*?\n\});', new_content, re.MULTILINE)
|
||
if not templates_match:
|
||
print("错误:无法从temp_mock_data.js中提取resumeTemplates")
|
||
return False
|
||
new_templates = templates_match.group(0)
|
||
|
||
# 在原始文件中替换industries
|
||
original_content = re.sub(
|
||
r'const industries = \[[\s\S]*?\n\];',
|
||
new_industries,
|
||
original_content,
|
||
count=1
|
||
)
|
||
|
||
# 在原始文件中替换resumeTemplates
|
||
original_content = re.sub(
|
||
r'const resumeTemplates = \{[\s\S]*?\n\};',
|
||
new_templates,
|
||
original_content,
|
||
count=1
|
||
)
|
||
|
||
# 保存合并后的文件
|
||
with open('src/mocks/resumeInterviewMock.js', 'w', encoding='utf-8') as f:
|
||
f.write(original_content)
|
||
|
||
print("✅ 成功合并数据到 resumeInterviewMock.js")
|
||
return True
|
||
|
||
def verify_syntax():
|
||
"""验证生成的文件语法是否正确"""
|
||
import subprocess
|
||
|
||
result = subprocess.run(
|
||
['node', '-c', 'src/mocks/resumeInterviewMock.js'],
|
||
capture_output=True,
|
||
text=True
|
||
)
|
||
|
||
if result.returncode == 0:
|
||
print("✅ 语法检查通过")
|
||
return True
|
||
else:
|
||
print(f"❌ 语法错误:{result.stderr}")
|
||
return False
|
||
|
||
def main():
|
||
print("开始合并文件...")
|
||
|
||
if merge_files():
|
||
print("\n验证语法...")
|
||
verify_syntax()
|
||
|
||
print("\n数据替换完成!")
|
||
|
||
if __name__ == "__main__":
|
||
main() |