v4.4 数据报表/操作日志/系统设置与月度分排行

1. 月度分排行:管理端首页支持总分/月度分切换与月份选择,新增排行榜导出CSV
2. 数据报表:新增考勤/作业统计页(日期范围、汇总与每人明细、CSV导出)
3. 操作日志:新增查看页(操作类型/操作人/日期筛选,分页)
4. 系统设置:密码策略可配置(长度/字符种类),全站改密与重置统一校验、前端提示同步;策略通过公开配置下发
5. 学期归档对比:查看归档时展示与上一学期的分数变化与名次升降
6. 历史记录导出支持按学生分表(每人一段,便于发家长)
7. 移动端适配:导航横向滚动、表格触控滚动、字号与弹窗优化
8. 版本升级至4.4(无数据库结构变更)
This commit is contained in:
canglan committed 2026-10-09 15:00:32 +08:00
1 parent 9a19add6c1
commit 768ea281e0
54 files changed
+1782 -90

No files matched your search

+2 -2
View File
@@ -211,8 +211,8 @@ include __DIR__ . '/../includes/header.php';
</div>
<div class="form-group">
<label>新密码</label>
<input type="text" id="newPassword" required minlength="6" placeholder="请输入新密码(至少6位)">
<small>密码长度至少6位</small>
<input type="text" id="newPassword" required placeholder="请输入新密码">
<small class="pwd-policy">密码长度至少6位</small>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">确认重置</button>
+11 -5
View File
@@ -35,16 +35,22 @@ include __DIR__ . '/../includes/header.php';
<div class="card">
<div class="card-title">操行分排行榜</div>
<div class="table-wrapper">
<div style="display: flex; align-items: center; margin-bottom: 12px; gap: 8px;">
<span style="font-size: 14px; color: #666;">显示前</span>
<input type="number" id="percentileFilter" style="width: 70px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px;" min="1" max="100" value="100" placeholder="1-100">
<span style="font-size: 14px; color: #666;">% 的学生</span>
<div class="ranking-toolbar">
<select id="rankingType" onchange="onRankingTypeChange()">
<option value="total">总分排行</option>
<option value="monthly">月度分排行</option>
</select>
<input type="month" id="rankingMonth" style="display:none;" onchange="loadRanking()">
<span class="ranking-tip">显示前</span>
<input type="number" id="percentileFilter" style="width: 70px;" min="1" max="100" value="100" placeholder="1-100">
<span class="ranking-tip">% 的学生</span>
<button class="btn btn-sm btn-primary" onclick="applyPercentileFilter()">筛选</button>
<button class="btn btn-sm btn-ghost" onclick="resetPercentileFilter()">显示全部</button>
<button class="btn btn-sm btn-secondary" onclick="exportRanking()">导出</button>
</div>
<table class="table">
<thead>
<tr><th>排名</th><th>学号</th><th>姓名</th><th>操行分</th></tr>
<tr id="rankingHead"><th>排名</th><th>学号</th><th>姓名</th><th>操行分</th></tr>
</thead>
<tbody id="rankingList"></tbody>
</table>
+27 -1
View File
@@ -39,7 +39,7 @@ include __DIR__ . '/../includes/header.php';
</select>
</label>
<?php if (has_perm('export_data')): ?>
<button class="btn btn-secondary" onclick="exportHistoryRecords()">导出</button>
<button class="btn btn-secondary" onclick="showExportHistoryModal()">导出</button>
<?php endif; ?>
</div>
<!-- 高级筛选面板(默认折叠) -->
@@ -122,4 +122,30 @@ include __DIR__ . '/../includes/header.php';
<script src="/assets/js/modules/points-mgmt.js"></script>
<script src="/assets/js/history.js"></script>
<!-- 导出历史记录模态框 -->
<div id="exportHistoryModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>导出历史记录</h3>
<button class="modal-close" onclick="closeModal('exportHistoryModal')">&times;</button>
</div>
<div class="form-group">
<label>导出方式</label>
<div class="check-grid" style="grid-template-columns: 1fr;">
<label class="check-item">
<input type="radio" name="historyExportMode" value="detail" checked> 明细记录(每行一条记录)
</label>
<label class="check-item">
<input type="radio" name="historyExportMode" value="per_student"> 按学生分表(每人一段,便于发给家长)
</label>
</div>
<small>导出内容跟随当前筛选条件;已撤销记录不导出</small>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="exportHistoryRecords()">开始导出</button>
<button type="button" class="btn" onclick="closeModal('exportHistoryModal')">取消</button>
</div>
</div>
</div>
<?php include __DIR__ . '/../includes/footer.php'; ?>
+77
View File
@@ -0,0 +1,77 @@
<?php
/**
* 班级操行分管理系统 - 管理端操作日志
*
* 开发者: Canglan
* 联系方式: admin@sea-studio.top
* 版权归属: Sea Network Technology Studio
* 许可证: MIT License
*
* 版权所有 © Sea Network Technology Studio
*/
require_once __DIR__ . '/../config.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
header('Location: /index.php');
exit();
}
$page_title = '操作日志';
$role = current_group_name();
require_perm('manage_admins');
include __DIR__ . '/../includes/header.php';
?>
<?php include __DIR__ . '/../includes/nav.php'; ?>
<div class="container">
<div class="card">
<div class="filter-bar">
<div class="filter-group">
<label>操作类型</label>
<select id="logTypeFilter">
<option value="">全部</option>
</select>
</div>
<div class="filter-group">
<label>操作人 / 角色</label>
<input type="text" id="logOperatorFilter" placeholder="关键词">
</div>
<div class="filter-group">
<label>开始日期</label>
<input type="date" id="logStartDate">
</div>
<div class="filter-group">
<label>结束日期</label>
<input type="date" id="logEndDate">
</div>
<div class="filter-group" style="flex: 0 0 auto;">
<button class="btn btn-primary" onclick="loadLogs(1)">查询</button>
</div>
</div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th style="white-space: nowrap;">时间</th>
<th>操作人</th>
<th>角色</th>
<th>操作</th>
<th>对象</th>
<th>详情</th>
<th>IP</th>
</tr>
</thead>
<tbody id="logList"></tbody>
</table>
</div>
<div class="pagination" id="logPagination"></div>
</div>
</div>
<script src="/assets/js/logs.js"></script>
<?php include __DIR__ . '/../includes/footer.php'; ?>
+4 -3
View File
@@ -36,7 +36,7 @@ include __DIR__ . '/../includes/header.php';
<div class="form-group">
<label>新密码 <span style="color:red;">*</span></label>
<input type="password" id="newPassword" required>
<small>密码长度6-20位,需包含大写字母、小写字母、数字、特殊符号中的至少3种</small>
<small class="pwd-policy">密码长度6-20位,需包含大写字母、小写字母、数字、特殊符号中的至少3种</small>
</div>
<div class="form-group">
<label>确认新密码 <span style="color:red;">*</span></label>
@@ -94,8 +94,9 @@ document.getElementById('passwordForm').addEventListener('submit', async (e) =>
return;
}
if (newPassword.length < 6 || newPassword.length > 20) {
showToast('密码长度需为6-20位', 'error');
const policyError = validatePasswordByPolicy(newPassword);
if (policyError) {
showToast(policyError, 'error');
return;
}
+104
View File
@@ -0,0 +1,104 @@
<?php
/**
* 班级操行分管理系统 - 管理端数据报表
*
* 开发者: Canglan
* 联系方式: admin@sea-studio.top
* 版权归属: Sea Network Technology Studio
* 许可证: MIT License
*
* 版权所有 © Sea Network Technology Studio
*/
require_once __DIR__ . '/../config.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
header('Location: /index.php');
exit();
}
$page_title = '数据报表';
$role = current_group_name();
require_perm('view_all_records');
include __DIR__ . '/../includes/header.php';
?>
<?php include __DIR__ . '/../includes/nav.php'; ?>
<div class="container">
<div class="card">
<div class="filter-bar">
<div class="filter-group">
<label>开始日期</label>
<input type="date" id="reportStartDate">
</div>
<div class="filter-group">
<label>结束日期</label>
<input type="date" id="reportEndDate">
</div>
<div class="filter-group" style="flex: 0 0 auto;">
<button class="btn btn-primary" onclick="loadReports()">查询</button>
</div>
</div>
<p style="font-size: 12px; color: var(--color-text-secondary);" id="reportRangeHint">
默认统计当前学期范围;考勤按记录日期统计,作业按作业截止日期统计
</p>
</div>
<div class="card">
<div class="card-title" style="display:flex; justify-content:space-between; align-items:center;">
<span>考勤统计</span>
<button class="btn btn-sm btn-secondary" onclick="exportReport('attendance')">导出</button>
</div>
<div id="attendanceSummary" class="report-summary"></div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>序号</th>
<th>学号</th>
<th>姓名</th>
<th>出勤</th>
<th>缺勤</th>
<th>迟到</th>
<th>请假</th>
<th>记录数</th>
<th>出勤率</th>
</tr>
</thead>
<tbody id="attendanceReportList"></tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-title" style="display:flex; justify-content:space-between; align-items:center;">
<span>作业统计</span>
<button class="btn btn-sm btn-secondary" onclick="exportReport('homework')">导出</button>
</div>
<div id="homeworkSummary" class="report-summary"></div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>序号</th>
<th>学号</th>
<th>姓名</th>
<th>已交</th>
<th>未交</th>
<th>迟交</th>
<th>记录数</th>
<th>未交率</th>
</tr>
</thead>
<tbody id="homeworkReportList"></tbody>
</table>
</div>
</div>
</div>
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
<script src="/assets/js/reports.js"></script>
<?php include __DIR__ . '/../includes/footer.php'; ?>
+3
View File
@@ -170,12 +170,15 @@ include __DIR__ . '/../includes/header.php';
<th colspan="2" style="text-align:center; border-bottom: none;">基本信息</th>
<th rowspan="2" style="vertical-align: middle;">姓名</th>
<th rowspan="2" style="vertical-align: middle;">操行分</th>
<th colspan="2" style="text-align:center; border-bottom: none;">环比上次</th>
<th colspan="4" style="text-align:center; border-bottom: none;">考勤统计</th>
<th colspan="3" style="text-align:center; border-bottom: none;">作业统计</th>
</tr>
<tr>
<th>排名</th>
<th>学号</th>
<th>分数变化</th>
<th>排名变化</th>
<th>出勤</th>
<th>缺勤</th>
<th>迟到</th>
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* 班级操行分管理系统 - 管理端系统设置
*
* 开发者: Canglan
* 联系方式: admin@sea-studio.top
* 版权归属: Sea Network Technology Studio
* 许可证: MIT License
*
* 版权所有 © Sea Network Technology Studio
*/
require_once __DIR__ . '/../config.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
header('Location: /index.php');
exit();
}
$page_title = '系统设置';
$role = current_group_name();
require_perm('manage_admins');
include __DIR__ . '/../includes/header.php';
?>
<?php include __DIR__ . '/../includes/nav.php'; ?>
<div class="container">
<div class="card" style="max-width: 640px;">
<div class="card-title">密码策略</div>
<form id="passwordPolicyForm">
<div class="form-group">
<label>密码最小长度</label>
<input type="number" id="pwdMinLength" min="4" max="64" required>
</div>
<div class="form-group">
<label>密码最大长度</label>
<input type="number" id="pwdMaxLength" min="8" max="100" required>
</div>
<div class="form-group">
<label>最少字符种类数</label>
<input type="number" id="pwdMinTypes" min="1" max="4" required>
<small>可选种类:大写字母 / 小写字母 / 数字 / 特殊符号</small>
</div>
<small class="pwd-policy"></small>
<div style="margin-top: 14px;">
<button type="submit" class="btn btn-primary">保存</button>
</div>
</form>
</div>
</div>
<script src="/assets/js/settings.js"></script>
<?php include __DIR__ . '/../includes/footer.php'; ?>
+1 -1
View File
@@ -163,7 +163,7 @@ include __DIR__ . '/../includes/header.php';
<p id="resetStudentInfo" style="margin: 10px 0;"></p>
<div class="form-group">
<label>新密码</label>
<input type="password" id="newStudentPassword" required minlength="6" maxlength="20">
<input type="password" id="newStudentPassword" required>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-warning">确认重置</button>