主要内容: - 包含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>
78 lines
2.9 KiB
Python
78 lines
2.9 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import json
|
|
import re
|
|
|
|
print("添加缺失的导师信息到mockData.js...")
|
|
|
|
# 读取通用导师信息
|
|
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/网页未导入数据/导师信息(通用).json', 'r', encoding='utf-8') as f:
|
|
teachers_data = json.load(f)
|
|
|
|
# 需要添加的导师列表(企业高管公开课和营销能力课的导师)
|
|
needed_teachers = ["刘杰", "郭建辉", "赵志强", "周伏波", "李毅峰", "范雪娇"]
|
|
|
|
# 提取需要的导师信息
|
|
teachers_to_add = {}
|
|
for teacher in teachers_data:
|
|
name = teacher.get("查询导师名称", "")
|
|
if name in needed_teachers:
|
|
# 处理导师特长,去掉 "# " 前缀
|
|
specialties = [s.replace("# ", "") for s in teacher.get("导师特长", [])]
|
|
|
|
teachers_to_add[name] = {
|
|
"name": name,
|
|
"introduction": teacher.get("导师介绍", ""),
|
|
"specialties": specialties,
|
|
"avatar": teacher.get("❌导师头像url链接", ""),
|
|
"type": "公共课导师",
|
|
"verticalDirection": teacher.get("所属垂直方向", ""),
|
|
"courses": []
|
|
}
|
|
|
|
# 读取当前的 mockData.js
|
|
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/mockData.js', 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# 备份原文件
|
|
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/mockData.js.backup_before_adding_teachers', 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
|
|
# 找到插入位置 - 在魏立慧后面,}, allCalendarEvents) 之前
|
|
pattern = r'("魏立慧": \{[^}]+courses: \[\]\s*\})(.*?)(\}, allCalendarEvents\))'
|
|
match = re.search(pattern, content, re.DOTALL)
|
|
|
|
if match:
|
|
# 准备新的导师数据字符串
|
|
new_teachers_str = ""
|
|
added_count = 0
|
|
for name, data in teachers_to_add.items():
|
|
# 转义引号以避免JS语法错误
|
|
introduction = data['introduction'].replace('"', '\\"').replace('\n', '\\n')
|
|
|
|
teacher_str = f''',
|
|
"{name}": {{
|
|
name: "{data['name']}",
|
|
introduction: "{introduction}",
|
|
specialties: {json.dumps(data['specialties'], ensure_ascii=False)},
|
|
avatar: "{data['avatar']}",
|
|
type: "{data['type']}",
|
|
verticalDirection: "{data['verticalDirection']}",
|
|
courses: []
|
|
}}'''
|
|
new_teachers_str += teacher_str
|
|
print(f"✓ 添加导师: {name}")
|
|
added_count += 1
|
|
|
|
# 插入新导师
|
|
new_content = content[:match.end(1)] + new_teachers_str + match.group(3) + content[match.end():]
|
|
|
|
# 写入更新后的文件
|
|
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/mockData.js', 'w', encoding='utf-8') as f:
|
|
f.write(new_content)
|
|
|
|
print(f"\n✓ 成功添加 {added_count} 个导师到 mockData.js")
|
|
print(" - 原文件已备份为 mockData.js.backup_before_adding_teachers")
|
|
else:
|
|
print("❌ 无法找到插入位置") |