修复历史记录等外显信息

This commit is contained in:
2026-07-24 15:49:35 +08:00
parent e8ba97bc9d
commit 47e4359eda
5 changed files with 14 additions and 10 deletions

View File

@@ -195,7 +195,7 @@ function renderHistory(list) {
const configName = item.config_name || '-';
const splitValue = item.split_name || '-';
const totalOrders = item.total_orders || 0;
const totalAmount = item.total_amount ? parseFloat(item.total_amount).toFixed(2) : '0.00';
const totalDegree = item.total_degree ? parseFloat(item.total_degree).toFixed(3) : '0.000';
return `
<tr>
@@ -205,7 +205,7 @@ function renderHistory(list) {
<td>${configName}</td>
<td>${splitValue}</td>
<td>${totalOrders}</td>
<td>¥${totalAmount}</td>
<td>${totalDegree}</td>
<td><span class="${statusClass}">${statusText}</span></td>
<td>
${item.status === 1 && item.file_path ?

View File

@@ -351,7 +351,7 @@ async function generateReport() {
if (r.success) {
html += `<div style="margin: 10px 0; padding: 10px; background: #f0f8ff; border-radius: 4px;">`;
html += `<strong>✓ ${r.name}</strong><br>`;
html += `订单数量:${r.total_orders} 条,总金额:¥${r.total_amount.toFixed(2)}<br>`;
html += `订单数量:${r.total_orders} 条,总电量:${r.total_degree ? parseFloat(r.total_degree).toFixed(3) : '0.000'} kWh<br>`;
html += `<a href="/api/download?path=${r.file_path}" target="_blank" class="btn btn-sm btn-success" style="margin-top: 5px;">📥 下载</a>`;
html += `</div>`;
} else {