feat(conduct): add restore revoked record functionality and update history view

This commit is contained in:
2026-04-23 11:19:35 +08:00
parent 03aaaa53a9
commit bf0314f098
5 changed files with 115 additions and 13 deletions

View File

@@ -251,7 +251,7 @@ async function submitAddSubject() {
// 撤销扣分记录
async function revokeRecord(recordId) {
if (!confirm('确定要撤销这条扣分记录吗?')) return;
if (!confirm('确定要撤销这条记录吗?撤销后学生分数将恢复。')) return;
const res = await apiPost('/api/admin/conduct/revoke', { record_id: recordId });
if (res && res.success) {
@@ -262,6 +262,19 @@ async function revokeRecord(recordId) {
}
}
// 反撤销(恢复)记录
async function restoreRecord(recordId) {
if (!confirm('确定要反撤销这条记录吗?分数变动将重新生效。')) return;
const res = await apiPost('/api/admin/conduct/restore', { record_id: recordId });
if (res && res.success) {
showToast('反撤销成功');
loadHistory(currentHistoryPage);
} else {
showToast(res?.message || '反撤销失败', 'error');
}
}
// 关闭模态框
function closeModal(modalId) {
const modal = document.getElementById(modalId);