v2.9update

This commit is contained in:
2026-06-08 10:40:59 +08:00
parent 8d497d73d2
commit 70e7ad8e5e
20 changed files with 162 additions and 74 deletions

View File

@@ -19,15 +19,17 @@ async function loadHomework() {
res.data.homework.forEach(record => {
const pointsClass = record.points_change > 0 ? 'plus' : 'minus';
const pointsColor = record.points_change > 0 ? '#38a169' : '#e53e3e';
const typeLabel = { manual: '手动', homework: '作业', attendance: '考勤' }[record.related_type] || '作业';
html += `<tr>
<td>${formatDateTime(record.created_at)}</td>
<td>${typeLabel}</td>
<td style="color: ${pointsColor}; font-weight: bold;">${record.points_change > 0 ? '+' : ''}${record.points_change}</td>
<td>${escapeHtml(record.reason)}</td>
<td>${escapeHtml(record.recorder_name || '-')}</td>
<td>${formatDateTime(record.created_at)}</td>
</tr>`;
});
if (res.data.homework.length === 0) {
html = '<tr><td colspan="4" style="text-align:center; padding: 40px; color: #999;">📝 暂无作业扣分记录</td></tr>';
html = '<tr><td colspan="5" style="text-align:center; padding: 40px; color: #999;">📝 暂无作业扣分记录</td></tr>';
}
document.getElementById('homeworkList').innerHTML = html;
}