Phase 5: 完成导出功能
- 新增 export_manager.py 导出管理模块 - 知识图谱导出 SVG/PNG - 实体数据导出 Excel/CSV - 关系数据导出 CSV - 项目报告导出 PDF - 转录文本导出 Markdown - 项目完整数据导出 JSON - 前端添加导出面板和功能 - 更新依赖: pandas, openpyxl, reportlab, cairosvg
This commit is contained in:
@@ -1406,6 +1406,71 @@
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
/* Export Panel Styles */
|
||||
.export-section {
|
||||
background: #141414;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.export-options {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.export-btn {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
padding: 16px 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.export-btn:hover {
|
||||
border-color: #00d4ff;
|
||||
background: #1f1f1f;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.export-icon {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.export-label {
|
||||
color: #e0e0e0;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.export-desc {
|
||||
color: #666;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.export-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
color: #00d4ff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.export-success {
|
||||
background: rgba(0, 212, 255, 0.1);
|
||||
border: 1px solid #00d4ff;
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
color: #00d4ff;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -1565,6 +1630,10 @@
|
||||
<div class="kb-stat-value" id="kbGlossaryCount">0</div>
|
||||
<div class="kb-stat-label">术语</div>
|
||||
</div>
|
||||
<div class="kb-stat" style="cursor:pointer;" onclick="showExportPanel()">
|
||||
<div class="kb-stat-value">📥</div>
|
||||
<div class="kb-stat-label">导出</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kb-content">
|
||||
@@ -1957,6 +2026,81 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Export Panel Modal -->
|
||||
<div class="modal-overlay" id="exportPanelModal" style="display:none;z-index:2000;">
|
||||
<div class="modal" style="max-width:600px;">
|
||||
<div class="modal-header">
|
||||
<h3>📥 导出数据</h3>
|
||||
<button class="close-btn" onclick="hideExportPanel()">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="export-section">
|
||||
<h4 style="margin-bottom:12px;color:#00d4ff;">🎨 知识图谱</h4>
|
||||
<div class="export-options">
|
||||
<button class="export-btn" onclick="exportGraph('svg')">
|
||||
<span class="export-icon">🖼️</span>
|
||||
<span class="export-label">导出 SVG</span>
|
||||
<span class="export-desc">矢量图,可编辑</span>
|
||||
</button>
|
||||
<button class="export-btn" onclick="exportGraph('png')">
|
||||
<span class="export-icon">🖼️</span>
|
||||
<span class="export-label">导出 PNG</span>
|
||||
<span class="export-desc">图片格式</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="export-section" style="margin-top:20px;">
|
||||
<h4 style="margin-bottom:12px;color:#00d4ff;">📊 数据导出</h4>
|
||||
<div class="export-options">
|
||||
<button class="export-btn" onclick="exportEntities('excel')">
|
||||
<span class="export-icon">📑</span>
|
||||
<span class="export-label">实体 Excel</span>
|
||||
<span class="export-desc">包含所有属性</span>
|
||||
</button>
|
||||
<button class="export-btn" onclick="exportEntities('csv')">
|
||||
<span class="export-icon">📄</span>
|
||||
<span class="export-label">实体 CSV</span>
|
||||
<span class="export-desc">逗号分隔</span>
|
||||
</button>
|
||||
<button class="export-btn" onclick="exportRelations('csv')">
|
||||
<span class="export-icon">🔗</span>
|
||||
<span class="export-label">关系 CSV</span>
|
||||
<span class="export-desc">关系数据</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="export-section" style="margin-top:20px;">
|
||||
<h4 style="margin-bottom:12px;color:#00d4ff;">📄 文档导出</h4>
|
||||
<div class="export-options">
|
||||
<button class="export-btn" onclick="exportReport('pdf')">
|
||||
<span class="export-icon">📕</span>
|
||||
<span class="export-label">项目报告 PDF</span>
|
||||
<span class="export-desc">完整项目报告</span>
|
||||
</button>
|
||||
<button class="export-btn" onclick="exportProject('json')">
|
||||
<span class="export-icon">🗂️</span>
|
||||
<span class="export-label">项目 JSON</span>
|
||||
<span class="export-desc">完整数据备份</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="export-section" style="margin-top:20px;" id="transcriptExportSection" style="display:none;">
|
||||
<h4 style="margin-bottom:12px;color:#00d4ff;">📝 当前转录文本</h4>
|
||||
<div class="export-options">
|
||||
<button class="export-btn" onclick="exportTranscript('markdown')">
|
||||
<span class="export-icon">📝</span>
|
||||
<span class="export-label">导出 Markdown</span>
|
||||
<span class="export-desc">带实体标注</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Context Menu -->
|
||||
<div class="context-menu" id="contextMenu">
|
||||
<div class="context-menu-item" onclick="editEntity()">✏️ 编辑实体</div>
|
||||
|
||||
Reference in New Issue
Block a user