diff --git a/assets/image_20260713142841517.png b/assets/image_20260713142841517.png new file mode 100644 index 0000000..21812ca Binary files /dev/null and b/assets/image_20260713142841517.png differ diff --git a/templates/index.html b/templates/index.html index 7245a86..2373806 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2210,6 +2210,47 @@ } // 带日期参数加载历史记录 + // 渲染历史记录列表 + function renderHistory(list) { + const tbody = document.getElementById('history-list'); + if (!list || list.length === 0) { + tbody.innerHTML = '暂无历史记录'; + return; + } + + tbody.innerHTML = list.map(item => { + const statusText = item.status === 1 ? '成功' : '失败'; + const statusClass = item.status === 1 ? 'status-success' : 'status-failed'; + const startTime = item.start_time ? new Date(item.start_time).toLocaleString('zh-CN') : '-'; + const endTime = item.end_time ? new Date(item.end_time).toLocaleString('zh-CN') : '-'; + const timeRange = `${startTime} 至 ${endTime}`; + const reportDate = item.report_date || '-'; + const configName = item.config_name || '-'; + const splitValue = item.split_name || '-'; + const totalOrders = item.total_orders || 0; + const totalAmount = item.total_amount ? item.total_amount.toFixed(2) : '0.00'; + + return ` + + + ${reportDate} + ${timeRange} + ${configName} + ${splitValue} + ${totalOrders} + ¥${totalAmount} + ${statusText} + + ${item.status === 1 && item.file_path ? + `下载` : + '-'} + + + + `; + }).join(''); + } + // 加载历史记录(无日期筛选) async function loadHistory(page = 1) { loadHistoryWithDate(page);