权限组全自定义、月度分独立、绑定邮箱免密与样式统一

1. 权限组:去掉锁定/预置限制,所有组可编辑/删除/分配;管理员新增/编辑可选任意组;管理员列表不再显示锁定徽标
2. 个人查询:月度分独立计算(当月净得分,与基础分无关),总分=基础分+加分-减分
3. 绑定邮箱:发送验证码与确认绑定不再需要密码(解绑仍需密码)
4. 权限组编辑UI:权限项按 学生/操行分/教务/系统管理 分区,支持全选/清空,上限两行布局,弹窗加宽
5. 样式统一:颜色变量化(硬编码色值清零)、check-grid/check-item 统一复选框网格、cell-wrap、subject-status 全局化、success-msg
6. 旧库升级期兼容保留(登录/权限降级、待升级提示)
7. 文档同步更新
This commit is contained in:
canglan committed 2026-09-18 09:56:39 +08:00
1 parent 8cd2c83412
commit ed3189096d
25 files changed
+237 -159

No files matched your search

+34 -20
View File
@@ -1,4 +1,4 @@
<?php
<?php
/**
* 班级操行分管理系统 - 管理端管理员管理
*
@@ -29,7 +29,9 @@ include __DIR__ . '/../includes/header.php';
<div class="container">
<div class="card">
<div class="action-bar">
<button class="btn btn-primary" onclick="showAddAdminModal()">添加管理员</button>
<div class="action-buttons">
<button class="btn btn-primary" onclick="showAddAdminModal()">添加管理员</button>
</div>
</div>
<div class="table-wrapper">
<table class="table">
@@ -43,7 +45,9 @@ include __DIR__ . '/../includes/header.php';
<div class="card">
<div class="action-bar">
<button class="btn btn-primary" onclick="showAddGroupModal()">新建权限组</button>
<div class="action-buttons">
<button class="btn btn-primary" onclick="showAddGroupModal()">新建权限组</button>
</div>
</div>
<div class="table-wrapper">
<table class="table">
@@ -133,41 +137,51 @@ include __DIR__ . '/../includes/header.php';
<!-- 权限组模态框 -->
<div id="groupModal" class="modal">
<div class="modal-content" style="max-width: 640px;">
<div class="modal-content" style="width: 760px; max-width: 92%;">
<div class="modal-header">
<h3 id="groupModalTitle">新建权限组</h3>
<button class="modal-close" onclick="closeModal('groupModal')">&times;</button>
</div>
<form onsubmit="event.preventDefault(); submitGroupForm()">
<input type="hidden" id="editGroupId">
<div class="form-group">
<label>权限组名称 <span style="color:red;">*</span></label>
<input type="text" id="groupName" required maxlength="50" placeholder="如:纪律委员">
<div style="display:flex; gap:12px; flex-wrap:wrap;">
<div class="form-group" style="flex:1; min-width:220px;">
<label>权限组名称 <span style="color:red;">*</span></label>
<input type="text" id="groupName" required maxlength="50" placeholder="如:纪律委员">
</div>
<div class="form-group" style="flex:2; min-width:260px;">
<label>说明</label>
<input type="text" id="groupDescription" maxlength="255" placeholder="选填">
</div>
</div>
<div class="form-group">
<label>说明</label>
<input type="text" id="groupDescription" maxlength="255" placeholder="选填">
</div>
<div class="form-group">
<label>权限项</label>
<div id="groupPermissionList" style="display:grid; grid-template-columns: repeat(2, 1fr); gap:8px;"></div>
<div class="perm-header">
<label style="margin:0;">权限项</label>
<div>
<button type="button" class="btn btn-sm btn-ghost" onclick="selectAllPermissions(true)">全选</button>
<button type="button" class="btn btn-sm btn-ghost" onclick="selectAllPermissions(false)">清空</button>
</div>
</div>
<div id="groupPermissionList"></div>
</div>
<div class="form-group">
<label>加减分上限</label>
<div style="display:flex; flex-wrap:wrap; gap:16px; align-items:center;">
<label style="display:flex; align-items:center; gap:6px;">
<div class="perm-cap-row">
<label class="check-item">
<input type="checkbox" id="groupCanAdd" checked onchange="onGroupCapChange()"> 允许加分
</label>
<label style="display:flex; align-items:center; gap:6px;">
<label class="check-item">
单次加分上限
<input type="number" id="groupMaxAdd" min="1" max="100" style="width:90px;" placeholder="留空=不限">
<input type="number" id="groupMaxAdd" min="1" max="100" style="width:100px;" placeholder="留空=不限">
</label>
<label style="display:flex; align-items:center; gap:6px;">
</div>
<div class="perm-cap-row">
<label class="check-item">
<input type="checkbox" id="groupCanSubtract" checked onchange="onGroupCapChange()"> 允许扣分
</label>
<label style="display:flex; align-items:center; gap:6px;">
<label class="check-item">
单次扣分上限
<input type="number" id="groupMaxSubtract" min="1" max="100" style="width:90px;" placeholder="留空=不限">
<input type="number" id="groupMaxSubtract" min="1" max="100" style="width:100px;" placeholder="留空=不限">
</label>
</div>
<small>上限必须在1-100之间,留空表示无限制</small>
+1 -1
View File
@@ -139,7 +139,7 @@ include __DIR__ . '/../includes/header.php';
</div>
<div class="form-group" id="dormitoryStudentsGroup" style="display:none;">
<label>宿舍成员</label>
<div id="dormitoryStudentsList" style="max-height: 150px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 4px; padding: 8px;">
<div id="dormitoryStudentsList" style="max-height: 150px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 4px; padding: 8px;">
</div>
<small id="dormitoryStudentsCount"></small>
</div>
-13
View File
@@ -195,19 +195,6 @@ include __DIR__ . '/../includes/header.php';
color: var(--color-text-muted);
font-size: 12px;
}
.subject-status {
font-size: 11px;
padding: 2px 8px;
border-radius: 12px;
}
.subject-status-active {
background: #c6f6d5;
color: #22543d;
}
.subject-status-inactive {
background: #fed7d7;
color: #742a2a;
}
.collapsible-card .collapsible-header {
cursor: pointer;
display: flex;
+9 -12
View File
@@ -59,11 +59,6 @@ include __DIR__ . '/../includes/header.php';
<label>新邮箱</label>
<input type="email" id="bindEmail" maxlength="100" placeholder="请输入要绑定的邮箱">
</div>
<div class="form-group">
<label>当前密码 <span style="color:red;">*</span></label>
<input type="password" id="emailPassword">
<small>安全验证:发送验证码需要输入当前登录密码</small>
</div>
<div style="display:flex; gap:8px; flex-wrap:wrap;">
<button type="button" class="btn btn-secondary" onclick="sendBindEmailCode()">发送验证码</button>
</div>
@@ -73,7 +68,15 @@ include __DIR__ . '/../includes/header.php';
</div>
<div style="display:flex; gap:8px; flex-wrap:wrap;">
<button type="button" class="btn btn-primary" onclick="confirmBindEmail()">确认绑定</button>
<button type="button" class="btn btn-outline-danger" onclick="unbindEmail()">解除绑定</button>
</div>
<hr style="border:none; border-top:1px solid var(--color-border-light); margin:18px 0;">
<div class="form-group">
<label>当前密码</label>
<input type="password" id="emailPassword" placeholder="解除绑定邮箱需验证当前密码">
</div>
<div>
<button type="button" class="btn btn-sm btn-outline-danger" onclick="unbindEmail()">解除绑定</button>
</div>
</div>
</div>
@@ -111,17 +114,11 @@ document.getElementById('passwordForm').addEventListener('submit', async (e) =>
async function sendBindEmailCode() {
const email = document.getElementById('bindEmail').value.trim();
const password = document.getElementById('emailPassword').value;
if (!email) {
showToast('请输入要绑定的邮箱', 'warning');
return;
}
if (!password) {
showToast('请输入当前密码', 'warning');
return;
}
const res = await apiPost('/api/auth/email/send-code', {
password: password,
email: email
});
if (res && res.success) {
+1 -2
View File
@@ -65,10 +65,9 @@ include __DIR__ . '/../includes/header.php';
<thead>
<tr>
<th>月份</th>
<th>月初分</th>
<th>加分</th>
<th>减分</th>
<th>月末分</th>
<th>月度分</th>
<th>记录数</th>
</tr>
</thead>
+10 -10
View File
@@ -1,4 +1,4 @@
<?php
<?php
/**
* 班级操行分管理系统 - 管理端学生管理
*
@@ -73,8 +73,8 @@ include __DIR__ . '/../includes/header.php';
<p>点击选择JSON文件</p>
<p class="import-label">或点击此处上传</p>
<input type="file" id="importFile" accept=".json">
<p style="margin-top: 10px; font-size: 12px; color: #999;">
<a href="/assets/uploads/sample_import.json" download style="color: #667eea;">下载示例文件</a>
<p style="margin-top: 10px; font-size: 12px; color: var(--color-text-muted);">
<a href="/assets/uploads/sample_import.json" download class="link">下载示例文件</a>
</p>
</div>
<div id="importPreview" class="preview-table" style="display: none;"></div>
@@ -189,15 +189,15 @@ include __DIR__ . '/../includes/header.php';
</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>
<div class="check-grid">
<label class="check-item"><input type="checkbox" class="export-student-col" value="student_no" checked disabled> 学号</label>
<label class="check-item"><input type="checkbox" class="export-student-col" value="name" checked disabled> 姓名</label>
<label class="check-item"><input type="checkbox" class="export-student-col" value="dormitory_number" checked> 宿舍号</label>
<label class="check-item"><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>
<label class="check-item"><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>
<label class="check-item"><input type="checkbox" class="export-student-col" value="status" checked> 状态</label>
</div>
<small>导出全班学生名单(CSV,可用Excel打开)</small>
</div>