update code

This commit is contained in:
lychang
2025-11-13 23:05:14 +08:00
parent e81d9edbd5
commit c8ea28bcde
186 changed files with 561 additions and 324 deletions

View File

@@ -36,7 +36,16 @@ function generateReport() {
hideLoading();
if (data.success) {
document.getElementById('report-content').textContent = data.report;
// 保存原始Markdown内容到data属性
document.getElementById('report-content').setAttribute('data-markdown', data.report);
// 将Markdown转换为HTML并显示
const htmlContent = markdownToHtml(data.report);
document.getElementById('report-content').innerHTML = htmlContent;
// 重置为预览模式
togglePreview('preview');
document.getElementById('report-container').style.display = 'block';
// 显示统计数据
@@ -81,7 +90,7 @@ function displayStatistics(stats) {
}
function exportReport() {
const reportContent = document.getElementById('report-content').textContent;
const reportContent = document.getElementById('report-content').getAttribute('data-markdown');
if (!reportContent) {
showError('请先生成日报');
return;