Files
Agent-n8n/scripts/final_validation.py
Yep_Q 67f5dfbe50 feat: 实现多订单班支持系统
主要功能:
- 修改RequirementModal支持12个订单班选择
- 添加OrderClassIconMap图标映射组件
- Store中添加selectedOrderClass状态管理
- WorkflowPage支持传递orderClass参数
- web_result添加URL参数切换功能
- 创建order-class-handler.js动态处理页面主题

技术改进:
- 创建软链接关联订单班数据目录
- 生成wenlu.json和food.json数据结构
- 删除重复的web_result目录
- 添加测试页面test-order-class.html

影响范围:
- 展会策划系统现支持12个订单班
- 结果展示页面自动适配不同订单班主题
- 用户可选择不同行业生成对应方案

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 10:02:15 +08:00

90 lines
2.7 KiB
Python

#!/usr/bin/env python3
"""
最终验证所有图片路径是否正确
"""
import re
from pathlib import Path
def validate_order_class(order_dir: Path):
"""验证单个订单班"""
notion_dir = order_dir / "notion文稿"
if not notion_dir.exists():
return None
image_dir = notion_dir / "image"
if not image_dir.exists():
return {"error": "没有image目录"}
# 获取所有实际存在的图片
actual_images = {img.name for img in image_dir.glob("*.jpg")}
# 获取所有MD文件中的引用
referenced_images = set()
for md_file in notion_dir.glob("*.md"):
if md_file.name == "图片索引.md":
continue
content = md_file.read_text(encoding='utf-8')
# 查找所有图片引用
matches = re.findall(r'!\[.*?\]\(./image/([^)]+\.jpg)\)', content)
referenced_images.update(matches)
# 找出问题
missing = referenced_images - actual_images
unused = actual_images - referenced_images - {"图片名.jpg"} # 排除示例文件
return {
"total_images": len(actual_images),
"referenced": len(referenced_images),
"missing": list(missing),
"unused": list(unused)
}
def main():
base_path = Path("/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/data/订单班文档资料")
order_classes = [
"文旅", "财经商贸", "食品", "智能开发", "智能制造",
"视觉设计", "交通物流", "土木", "大健康", "能源",
"化工", "环保"
]
print("=" * 60)
print("最终验证报告")
print("=" * 60)
all_good = True
for order_class in order_classes:
order_dir = base_path / order_class
result = validate_order_class(order_dir)
if result is None:
continue
print(f"\n{order_class}")
if "error" in result:
print(f"{result['error']}")
all_good = False
elif result["missing"]:
print(f" ⚠️ 找不到 {len(result['missing'])} 个引用的图片:")
for img in result["missing"][:3]:
print(f" - {img}")
all_good = False
else:
print(f" ✅ 所有 {result['referenced']} 个引用都正确")
print(f" 实际图片: {result['total_images']}")
if result["unused"]:
print(f" 未使用: {len(result['unused'])}")
print("\n" + "=" * 60)
if all_good:
print("✅ 所有图片路径验证通过!")
else:
print("⚠️ 有一些路径需要检查")
print("=" * 60)
if __name__ == "__main__":
main()