主要内容: - 包含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>
90 lines
3.3 KiB
Python
90 lines
3.3 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import json
|
|
import re
|
|
|
|
def verify_units_mapping():
|
|
"""验证单元映射数据是否正确"""
|
|
|
|
# 读取化工项目案例数据
|
|
with open('网页未导入数据/化工产业/化工项目案例.json', 'r', encoding='utf-8') as f:
|
|
source_data = json.load(f)
|
|
|
|
# 读取生成的映射文件
|
|
with open('src/data/projectUnitsMapping.js', 'r', encoding='utf-8') as f:
|
|
mapping_content = f.read()
|
|
|
|
print("验证化工项目单元映射数据:")
|
|
print("=" * 80)
|
|
|
|
all_correct = True
|
|
total_projects = 0
|
|
|
|
for project in source_data:
|
|
total_projects += 1
|
|
name = project.get('案例名称', '').strip()
|
|
expected_composite = project.get('对应单元名称(复合能力课)', '').strip()
|
|
expected_vertical = project.get('对应单元名称(垂直能力课)', '').strip()
|
|
|
|
# 处理期望的课程列表
|
|
expected_composite_list = []
|
|
if expected_composite:
|
|
expected_composite_list = [course.strip() for course in expected_composite.split(',') if course.strip()]
|
|
|
|
expected_vertical_list = []
|
|
if expected_vertical:
|
|
expected_vertical_list = [course.strip() for course in expected_vertical.split(',') if course.strip()]
|
|
|
|
print(f"\n项目: {name}")
|
|
|
|
# 在映射文件中查找该项目
|
|
project_pattern = rf'"{re.escape(name)}":\s*\{{\s*"compoundUnits":\s*\[(.*?)\],\s*"verticalUnits":\s*\[(.*?)\]\s*\}}'
|
|
match = re.search(project_pattern, mapping_content, re.DOTALL)
|
|
|
|
if match:
|
|
# 提取复合能力课
|
|
compound_block = match.group(1)
|
|
compound_matches = re.findall(r'"([^"]+)"', compound_block)
|
|
|
|
# 提取垂直能力课
|
|
vertical_block = match.group(2)
|
|
vertical_matches = re.findall(r'"([^"]+)"', vertical_block)
|
|
|
|
# 验证复合能力课
|
|
compound_correct = set(compound_matches) == set(expected_composite_list)
|
|
if compound_correct:
|
|
print(f" ✅ 复合能力课 ({len(expected_composite_list)}个): {', '.join(expected_composite_list)}")
|
|
else:
|
|
print(f" ❌ 复合能力课不匹配:")
|
|
print(f" 期望: {expected_composite_list}")
|
|
print(f" 实际: {compound_matches}")
|
|
all_correct = False
|
|
|
|
# 验证垂直能力课
|
|
vertical_correct = set(vertical_matches) == set(expected_vertical_list)
|
|
if vertical_correct:
|
|
print(f" ✅ 垂直能力课 ({len(expected_vertical_list)}个): {', '.join(expected_vertical_list)}")
|
|
else:
|
|
print(f" ❌ 垂直能力课不匹配:")
|
|
print(f" 期望: {expected_vertical_list}")
|
|
print(f" 实际: {vertical_matches}")
|
|
all_correct = False
|
|
|
|
else:
|
|
print(f" ❌ 在映射文件中未找到项目: {name}")
|
|
all_correct = False
|
|
|
|
print("\n" + "=" * 80)
|
|
print("验证结果汇总")
|
|
print("=" * 80)
|
|
print(f"总项目数: {total_projects}")
|
|
|
|
if all_correct:
|
|
print("✅ 所有项目的单元映射数据完全正确!")
|
|
else:
|
|
print("❌ 部分项目的单元映射数据有问题")
|
|
|
|
return all_correct
|
|
|
|
if __name__ == "__main__":
|
|
verify_units_mapping() |