主要内容: - 包含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>
68 lines
2.1 KiB
Python
68 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import os
|
||
|
||
def read_ehs_content():
|
||
"""
|
||
读取EHS项目的完整内容
|
||
"""
|
||
project_folder = "网页未导入数据/能源产业/学生完成的项目"
|
||
|
||
# 查找EHS文件
|
||
for file in os.listdir(project_folder):
|
||
if "EHS" in file and file.endswith(".md"):
|
||
file_path = os.path.join(project_folder, file)
|
||
with open(file_path, 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
return content, file.replace(".md", "")
|
||
return None, None
|
||
|
||
def generate_clickable_projects_code():
|
||
"""
|
||
生成可点击项目的JavaScript代码
|
||
"""
|
||
content, title = read_ehs_content()
|
||
if not content:
|
||
print("未找到EHS项目文件")
|
||
return
|
||
|
||
# 转义特殊字符
|
||
content_escaped = content.replace('\\', '\\\\').replace('`', '\\`').replace('${', '\\${')
|
||
|
||
# 生成JavaScript代码
|
||
js_code = f''' // 可点击查看的特殊项目
|
||
const clickableProjects = [
|
||
{{
|
||
id: "energy-clickable-1",
|
||
name: "{title}",
|
||
unitName: "EHS管理体系",
|
||
isClickable: true,
|
||
content: {{
|
||
title: "{title}",
|
||
description: "本项目以"安绿一体"EHS管理体系建设与运行示范项目,体现了在EHS(环境、健康、安全)体系中将安全管理与环境管理深度融合的理念。",
|
||
images: [],
|
||
sections: [
|
||
{{
|
||
title: "项目详情",
|
||
content: `{content_escaped}`
|
||
}}
|
||
],
|
||
relatedPositions: [
|
||
{{ name: "EHS工程师", level: "技术骨干岗" }},
|
||
{{ name: "安全管理专员", level: "普通岗" }},
|
||
{{ name: "环保工程师", level: "技术骨干岗" }}
|
||
]
|
||
}}
|
||
}}
|
||
];'''
|
||
|
||
# 保存到文件
|
||
with open("clickable_projects_update.js", 'w', encoding='utf-8') as f:
|
||
f.write(js_code)
|
||
|
||
print(f"✅ JavaScript代码已生成到:clickable_projects_update.js")
|
||
print(f"📋 项目标题:{title}")
|
||
|
||
if __name__ == "__main__":
|
||
generate_clickable_projects_code() |