v4.0 权限组重构与导出/个人查询优化
1. 权限重构:自定义权限组(14项功能权限+允许加分/加分上限/允许扣分/扣分上限),管理员账号绑定权限组,预置六组且班主任组锁定;全站前后端改为权限驱动,权限变更60秒内自动生效 2. 新增班主任导出学生名单(导出前自选字段) 3. 加减分/考勤上限改为按权限组动态校验,弹窗实时提示并限制输入 4. 导出按学期隔离(默认当前学期,可选历史/全部),历史导出不再受1000条限制 5. 新增管理端个人查询:基础分/加分/扣分/月度分/月度理由汇总及明细导出 6. 版本升级至4.0(sql/upgrades/v4.0.sql)
This commit is contained in:
1 parent
3067542e53
commit
3588b4c28c
55 files changed
+2846
-801
No files matched your search
+36
-14
@@ -18,7 +18,7 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
}
|
||||
|
||||
$page_title = '学生管理';
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
$role = current_group_name();
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
|
||||
@@ -28,10 +28,13 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="card">
|
||||
<div class="action-bar">
|
||||
<div class="action-buttons">
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<?php if (has_perm('manage_students')): ?>
|
||||
<button class="btn btn-primary" onclick="showImportModal()">导入学生</button>
|
||||
<button class="btn btn-primary" onclick="showAddStudentModal()">新增学生</button>
|
||||
<?php endif; ?>
|
||||
<?php if (has_perm('export_students')): ?>
|
||||
<button class="btn btn-secondary" onclick="showExportStudentsModal()">导出学生名单</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<input type="text" id="searchInput" placeholder="搜索姓名/学号">
|
||||
@@ -48,7 +51,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<th>姓名</th>
|
||||
<th>宿舍号</th>
|
||||
<th>操行分</th>
|
||||
<?php if ($role === '班主任'): ?><th>家长手机号</th><?php endif; ?>
|
||||
<?php if (has_perm('manage_students')): ?><th>家长手机号</th><?php endif; ?>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -170,13 +173,41 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo $role; ?>' };</script>
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
|
||||
<script src="/assets/js/modules/modal-utils.js"></script>
|
||||
<script src="/assets/js/modules/utils.js"></script>
|
||||
<script src="/assets/js/modules/student-mgmt.js"></script>
|
||||
<script src="/assets/js/modules/points-mgmt.js"></script>
|
||||
<script src="/assets/js/students-manage.js"></script>
|
||||
|
||||
<!-- 导出学生名单模态框 -->
|
||||
<div id="exportStudentsModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>导出学生名单</h3>
|
||||
<button class="modal-close" onclick="closeModal('exportStudentsModal')">×</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>导出字段</label>
|
||||
<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:8px;">
|
||||
<label><input type="checkbox" class="export-student-col" value="student_no" checked disabled> 学号</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="name" checked disabled> 姓名</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="dormitory_number" checked> 宿舍号</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="total_points" checked> 当前操行分</label>
|
||||
<?php if (has_perm('manage_students')): ?>
|
||||
<label><input type="checkbox" class="export-student-col" value="parent_phone"> 家长手机号</label>
|
||||
<?php endif; ?>
|
||||
<label><input type="checkbox" class="export-student-col" value="status" checked> 状态</label>
|
||||
</div>
|
||||
<small>导出全班学生名单(CSV,可用Excel打开)</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="exportStudents()">开始导出</button>
|
||||
<button type="button" class="btn" onclick="closeModal('exportStudentsModal')">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 批量加减分模态框(共用) -->
|
||||
<div id="batchPointsModal" class="modal">
|
||||
<div class="modal-content">
|
||||
@@ -192,16 +223,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="form-group">
|
||||
<label>分数变动</label>
|
||||
<input type="number" id="pointsChange" required placeholder="正数为加分,负数为扣分">
|
||||
<small><?php
|
||||
$hints = [
|
||||
'班长' => '班长单次±5分以内',
|
||||
'学习委员' => '学习委员单次±5分以内',
|
||||
'考勤委员' => '考勤委员仅限扣分,单次最多扣8分',
|
||||
'劳动委员' => '劳动委员单次±1分以内',
|
||||
'志愿委员' => '志愿委员仅限加分,最多+5分',
|
||||
];
|
||||
echo $hints[$role] ?? '班主任无限制';
|
||||
?></small>
|
||||
<small id="pointsLimitHint"></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>原因</label>
|
||||
|
||||
Reference in new issue
Block a user