主要内容: - 包含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>
85 lines
3.2 KiB
Python
85 lines
3.2 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import json
|
|
import re
|
|
|
|
def verify_units_mapping():
|
|
"""验证项目单元映射数据是否正确"""
|
|
|
|
# 1. 读取大健康项目案例原始数据
|
|
with open('网页未导入数据/大健康产业/大健康项目案例.json', 'r', encoding='utf-8') as f:
|
|
health_data = json.load(f)
|
|
|
|
# 2. 读取生成的projectUnitsMapping.js文件
|
|
with open('src/data/projectUnitsMapping.js', 'r', encoding='utf-8') as f:
|
|
mapping_content = f.read()
|
|
|
|
# 3. 提取映射数据
|
|
pattern = r'export const projectUnitsMapping = ({[\s\S]*?});'
|
|
match = re.search(pattern, mapping_content)
|
|
|
|
if match:
|
|
mapping_json = match.group(1)
|
|
# 清理JSON格式
|
|
mapping_json = mapping_json.replace('\\n', '\n')
|
|
try:
|
|
mapping_data = json.loads(mapping_json)
|
|
except:
|
|
# 使用eval作为备选方案
|
|
safe_dict = {"true": True, "false": False, "null": None}
|
|
mapping_data = eval(mapping_json, {"__builtins__": {}}, safe_dict)
|
|
|
|
print("=" * 60)
|
|
print("项目单元映射验证报告")
|
|
print("=" * 60)
|
|
|
|
# 验证每个项目的单元映射
|
|
for project in health_data:
|
|
project_name = project.get('案例名称', '')
|
|
|
|
print(f"\n项目: {project_name}")
|
|
print("-" * 40)
|
|
|
|
# 原始数据中的单元
|
|
original_compound = project.get('对应单元名称(复合能力课)', '')
|
|
original_vertical = project.get('对应单元名称(垂直能力课)', '')
|
|
|
|
# 分割为列表
|
|
original_compound_units = [u.strip() for u in original_compound.split(',') if u.strip()]
|
|
original_vertical_units = [u.strip() for u in original_vertical.split(',') if u.strip()]
|
|
|
|
# 映射数据中的单元
|
|
if project_name in mapping_data:
|
|
mapped = mapping_data[project_name]
|
|
mapped_compound = mapped.get('compoundUnits', [])
|
|
mapped_vertical = mapped.get('verticalUnits', [])
|
|
|
|
# 比较复合能力课
|
|
print(" 复合能力课:")
|
|
if set(original_compound_units) == set(mapped_compound):
|
|
print(f" ✅ 一致: {', '.join(mapped_compound)}")
|
|
else:
|
|
print(f" ❌ 不一致!")
|
|
print(f" 原始: {', '.join(original_compound_units)}")
|
|
print(f" 映射: {', '.join(mapped_compound)}")
|
|
|
|
# 比较垂直能力课
|
|
print(" 垂直能力课:")
|
|
if set(original_vertical_units) == set(mapped_vertical):
|
|
print(f" ✅ 一致: {', '.join(mapped_vertical)}")
|
|
else:
|
|
print(f" ❌ 不一致!")
|
|
print(f" 原始: {', '.join(original_vertical_units)}")
|
|
print(f" 映射: {', '.join(mapped_vertical)}")
|
|
else:
|
|
print(" ⚠️ 项目未找到映射!")
|
|
|
|
print("\n" + "=" * 60)
|
|
print(f"验证完成: 共{len(health_data)}个项目")
|
|
|
|
else:
|
|
print("无法解析映射数据")
|
|
|
|
if __name__ == "__main__":
|
|
verify_units_mapping() |