update code

This commit is contained in:
lychang
2025-11-05 02:04:09 +08:00
parent 43cb0ff431
commit e81d9edbd5
9 changed files with 83 additions and 56 deletions

View File

@@ -167,4 +167,19 @@ body {
background: #667eea;
color: white;
border-color: #667eea;
}
.export-btn {
background: #28a745;
color: white;
border: none;
padding: 8px 16px;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
margin-left: auto;
}
.export-btn:hover {
background: #218838;
}

View File

@@ -36,10 +36,10 @@ body {
margin-bottom: 15px;
}
.nav-links {
.nav {
display: flex;
gap: 15px;
margin-top: 10px;
gap: 10px;
margin-bottom: 20px;
}
.nav-btn {
@@ -58,28 +58,6 @@ body {
border-color: #667eea;
}
.nav-btn.active {
background: #667eea;
color: white;
border-color: #667eea;
}
.nav-link {
background: rgba(255, 255, 255, 0.2);
color: white;
padding: 8px 16px;
border-radius: 20px;
text-decoration: none;
font-size: 0.9em;
transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.3);
}
.nav-link:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.stats-grid {
display: grid;

View File

@@ -141,6 +141,12 @@ body {
margin-bottom: 15px;
}
.nav {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.nav-btn {
padding: 8px 16px;
background: #f8f9fa;
@@ -157,11 +163,6 @@ body {
border-color: #667eea;
}
.nav-btn.active {
background: #667eea;
color: white;
border-color: #667eea;
}
.qa-section {
margin-bottom: 10px;

View File

@@ -80,6 +80,24 @@ function displayStatistics(stats) {
});
}
function exportReport() {
const reportContent = document.getElementById('report-content').textContent;
if (!reportContent) {
showError('请先生成日报');
return;
}
const blob = new Blob([reportContent], { type: 'text/markdown' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `运营日报_${document.getElementById('date').value}.md`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
// 页面加载时自动生成今日日报
window.addEventListener('load', function () {
generateTodayReport();

View File

@@ -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;