v2.0.1更新

This commit is contained in:
2026-05-26 08:39:12 +08:00
parent cb0c367eb7
commit c575d711ee
34 changed files with 750 additions and 204 deletions

View File

@@ -35,14 +35,13 @@ include __DIR__ . '/../includes/header.php';
<thead>
<tr>
<th>日期</th>
<th>类型</th>
<th>原因</th>
<th>分值</th>
<th>记录人</th>
</tr>
</thead>
<tbody id="historyList">
<tr><td colspan="5" style="text-align:center;">加载中...</td></tr>
<tr><td colspan="4" style="text-align:center;">加载中...</td></tr>
</tbody>
</table>
</div>
@@ -76,17 +75,16 @@ async function loadHistory(page) {
if (res && res.success) {
let html = '';
if (res.data.records.length === 0) {
html = '<tr><td colspan="5" style="text-align:center;">暂无记录</td></tr>';
html = '<tr><td colspan="4" style="text-align:center;">暂无记录</td></tr>';
} else {
res.data.records.forEach(record => {
const pointsClass = record.points_change > 0 ? 'plus' : 'minus';
const pointsText = record.points_change > 0 ? `+${record.points_change}` : record.points_change;
html += `<tr>
<td>${formatDateTime(record.created_at)}</td>
<td>${escapeHtml(record.related_type || '手动')}</td>
<td class="preserve-newlines">${escapeHtml(record.reason || '-')}</td>
<td><span class="record-points ${pointsClass}">${pointsText}</span></td>
<td>${escapeHtml(record.recorder_name || '-')}</td>
<td>班主任</td>
</tr>`;
});
}