update code
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user