Files
ALL-teach_sys/frontend_视觉设计/test_single_update.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

93 lines
3.2 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
import json
import re
import os
# 只测试UI设计产业
json_file = '网页未导入数据/视觉设计产业/视觉设计岗位简历.json'
mock_file = 'src/mocks/resumeInterviewMock.js'
print("正在读取UI设计师面试题...")
with open(json_file, 'r', encoding='utf-8') as f:
positions_data = json.load(f)
# 找到UI设计师的面试题
ui_designer_questions = None
for position in positions_data:
if position.get("岗位名称") == "UI设计师":
interview_content = position.get("面试题内容", "")
if interview_content:
# 简化解析只提取前5个问题
questions = []
lines = interview_content.split('\n')
question_count = 0
for line in lines:
line = line.strip()
if line and line[0].isdigit() and '. ' in line and question_count < 5:
parts = line.split('. ', 1)
if len(parts) > 1:
question_text = parts[1].strip()
if question_text.startswith('问题:'):
question_text = question_text[3:].strip()
questions.append({
"id": f"q1_{question_count+1}",
"question": question_text,
"answer": "这是一个专业的UI设计问题需要根据实际项目经验回答。"
})
question_count += 1
ui_designer_questions = [{
"id": "group_q1",
"question": "# 专业能力类",
"subQuestions": questions
}]
break
if not ui_designer_questions:
print("未找到UI设计师面试题")
exit(1)
print(f"准备更新UI设计产业面试题{len(ui_designer_questions[0]['subQuestions'])}个问题")
# 读取文件
with open(mock_file, 'r', encoding='utf-8') as f:
content = f.read()
# 备份
backup_file = f"{mock_file}.backup_test_{os.popen('date +%Y%m%d_%H%M%S').read().strip()}"
with open(backup_file, 'w', encoding='utf-8') as f:
f.write(content)
print(f"已创建备份: {backup_file}")
# 生成JSON字符串
questions_str = json.dumps(ui_designer_questions, ensure_ascii=False, indent=8)
# 查找并替换UI设计的questions
pattern = r'("name":\s*"UI设计".*?"questions":\s*)\[[^\]]*?\](\s*[,}])'
match = re.search(pattern, content, re.DOTALL)
if match:
replacement = match.group(1) + questions_str + match.group(2)
new_content = re.sub(pattern, replacement, content, count=1, flags=re.DOTALL)
# 写入文件
with open(mock_file, 'w', encoding='utf-8') as f:
f.write(new_content)
print("✓ 已更新UI设计产业面试题")
# 验证语法
result = os.popen(f'node -c {mock_file} 2>&1').read()
if result:
print(f"❌ 语法错误: {result}")
# 恢复备份
with open(backup_file, 'r', encoding='utf-8') as f:
content = f.read()
with open(mock_file, 'w', encoding='utf-8') as f:
f.write(content)
print("已恢复备份")
else:
print("✓ 语法验证通过")
else:
print("✗ 未找到UI设计产业")