v4.4 数据报表/操作日志/系统设置与月度分排行
1. 月度分排行:管理端首页支持总分/月度分切换与月份选择,新增排行榜导出CSV 2. 数据报表:新增考勤/作业统计页(日期范围、汇总与每人明细、CSV导出) 3. 操作日志:新增查看页(操作类型/操作人/日期筛选,分页) 4. 系统设置:密码策略可配置(长度/字符种类),全站改密与重置统一校验、前端提示同步;策略通过公开配置下发 5. 学期归档对比:查看归档时展示与上一学期的分数变化与名次升降 6. 历史记录导出支持按学生分表(每人一段,便于发家长) 7. 移动端适配:导航横向滚动、表格触控滚动、字号与弹窗优化 8. 版本升级至4.4(无数据库结构变更)
This commit is contained in:
1 parent
9a19add6c1
commit
768ea281e0
54 files changed
+1782
-90
No files matched your search
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* 班级操行分管理系统 - 操作日志页JS
|
||||
*
|
||||
* 开发者: Canglan
|
||||
* 版权归属: Sea Network Technology Studio
|
||||
*
|
||||
* 版权所有 © Sea Network Technology Studio
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const OPERATION_TYPES = {
|
||||
add_student: '新增学生',
|
||||
update_student: '编辑学生',
|
||||
delete_student: '删除学生',
|
||||
import_students: '导入学生',
|
||||
reset_student_password: '重置学生密码',
|
||||
add_points: '加减分',
|
||||
revoke_record: '撤销记录',
|
||||
restore_record: '反撤销记录',
|
||||
add_attendance: '添加考勤',
|
||||
add_admin: '添加管理员',
|
||||
reactivate_admin: '重新激活管理员',
|
||||
update_admin: '编辑管理员',
|
||||
toggle_admin_status: '启用/禁用管理员',
|
||||
reset_password: '重置管理员密码',
|
||||
unlock_user: '解除登录锁定',
|
||||
create_semester: '创建学期',
|
||||
update_semester: '编辑学期',
|
||||
delete_semester: '删除学期',
|
||||
activate_semester: '激活学期',
|
||||
associate_records: '关联学期数据',
|
||||
archive_semester: '归档学期',
|
||||
create_permission_group: '新建权限组',
|
||||
update_permission_group: '编辑权限组',
|
||||
delete_permission_group: '删除权限组',
|
||||
update_password_policy: '修改密码策略'
|
||||
};
|
||||
|
||||
const TARGET_TYPES = {
|
||||
student: '学生',
|
||||
admin: '管理员',
|
||||
conduct: '操行分',
|
||||
attendance: '考勤',
|
||||
semester: '学期',
|
||||
subject: '科目',
|
||||
permission_group: '权限组',
|
||||
user: '用户',
|
||||
setting: '系统设置'
|
||||
};
|
||||
|
||||
let currentPage = 1;
|
||||
|
||||
function operationLabel(type) {
|
||||
return OPERATION_TYPES[type] || type;
|
||||
}
|
||||
|
||||
function targetLabel(type) {
|
||||
return type ? (TARGET_TYPES[type] || type) : '-';
|
||||
}
|
||||
|
||||
async function loadLogTypes() {
|
||||
const res = await apiGet('/api/admin/operation-logs/types');
|
||||
if (res && res.success && res.data && res.data.types) {
|
||||
const select = document.getElementById('logTypeFilter');
|
||||
let html = '<option value="">全部</option>';
|
||||
res.data.types.forEach(function(type) {
|
||||
html += '<option value="' + escapeHtml(type) + '">' + escapeHtml(operationLabel(type)) + '</option>';
|
||||
});
|
||||
select.innerHTML = html;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadLogs(page) {
|
||||
currentPage = page || 1;
|
||||
const params = {
|
||||
page: currentPage,
|
||||
page_size: 20,
|
||||
operation_type: document.getElementById('logTypeFilter').value,
|
||||
operator: document.getElementById('logOperatorFilter').value.trim(),
|
||||
start_date: document.getElementById('logStartDate').value,
|
||||
end_date: document.getElementById('logEndDate').value
|
||||
};
|
||||
|
||||
const res = await apiGet('/api/admin/operation-logs', params);
|
||||
if (!res || !res.success) {
|
||||
showToast((res && res.message) || '加载操作日志失败', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
let html = '';
|
||||
(res.data.logs || []).forEach(function(log) {
|
||||
const targetText = targetLabel(log.target_type) + (log.target_id ? '#' + log.target_id : '');
|
||||
html += `<tr>
|
||||
<td style="white-space: nowrap;">${formatDateTime(log.created_at)}</td>
|
||||
<td>${escapeHtml(log.operator_name || '-')}</td>
|
||||
<td>${escapeHtml(log.operator_role || '-')}</td>
|
||||
<td>${escapeHtml(operationLabel(log.operation_type))}</td>
|
||||
<td style="white-space: nowrap;">${escapeHtml(targetText)}</td>
|
||||
<td class="cell-wrap">${escapeHtml(log.details || '-')}</td>
|
||||
<td>${escapeHtml(log.ip_address || '-')}</td>
|
||||
</tr>`;
|
||||
});
|
||||
if ((res.data.logs || []).length === 0) {
|
||||
html = '<tr><td colspan="7" style="text-align:center;">暂无日志</td></tr>';
|
||||
}
|
||||
document.getElementById('logList').innerHTML = html;
|
||||
|
||||
renderSmartPagination('logPagination', currentPage, res.data.total_pages || 1, function(page) {
|
||||
loadLogs(page);
|
||||
});
|
||||
}
|
||||
|
||||
loadLogTypes();
|
||||
loadLogs(1);
|
||||
|
||||
window.loadLogs = loadLogs;
|
||||
|
||||
})();
|
||||
Reference in new issue
Block a user