update code
This commit is contained in:
@@ -40,7 +40,7 @@ function generateReport() {
|
||||
}
|
||||
|
||||
// 转换格式:YYYY-WWW 到 YYYY-WW
|
||||
const weekFormatted = week.replace('W', '-W');
|
||||
const weekFormatted = week.replace('W', '');
|
||||
|
||||
showLoading();
|
||||
|
||||
@@ -50,7 +50,10 @@ function generateReport() {
|
||||
hideLoading();
|
||||
|
||||
if (data.success) {
|
||||
document.getElementById('report-content').textContent = data.report;
|
||||
// 保存原始Markdown内容到data属性
|
||||
document.getElementById('report-content').setAttribute('data-markdown', data.report);
|
||||
// 使用innerHTML显示格式化内容
|
||||
document.getElementById('report-content').innerHTML = data.report.replace(/\n/g, '<br>');
|
||||
document.getElementById('report-container').style.display = 'block';
|
||||
|
||||
// 显示统计数据
|
||||
@@ -116,7 +119,7 @@ function displayCategoryChart(categories) {
|
||||
}
|
||||
|
||||
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