v2.1更新
This commit is contained in:
@@ -39,8 +39,8 @@ include __DIR__ . '/../includes/header.php';
|
||||
<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>
|
||||
<button class="btn btn-sm" style="background: #667eea; color: white;" onclick="applyPercentileFilter()">筛选</button>
|
||||
<button class="btn btn-sm" style="border: 1px solid #ccc; color: #666;" onclick="resetPercentileFilter()">显示全部</button>
|
||||
<button class="btn btn-sm btn-primary" onclick="applyPercentileFilter()">筛选</button>
|
||||
<button class="btn btn-sm btn-ghost" onclick="resetPercentileFilter()">显示全部</button>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -52,7 +52,154 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<!-- 升级提示模态框 -->
|
||||
<div id="upgradeModal" class="modal" style="display:none;">
|
||||
<div class="modal-content" style="max-width:520px;">
|
||||
<div class="modal-header">
|
||||
<h3>🔄 系统升级</h3>
|
||||
<button class="modal-close" onclick="closeModal('upgradeModal')" id="upgradeCloseBtn">×</button>
|
||||
</div>
|
||||
<div style="padding: 16px 0;">
|
||||
<div style="text-align: center; margin-bottom: 12px;">
|
||||
<p style="font-size: 15px; color: var(--color-text);">检测到数据库有新版本可用</p>
|
||||
<p style="font-size: 13px; color: var(--color-text-muted); margin-top: 8px;">
|
||||
当前版本: <span id="currentDbVersion">--</span> → 目标版本: <span id="targetDbVersion">--</span>
|
||||
</p>
|
||||
</div>
|
||||
<div id="upgradeStepsList" style="margin: 12px 0;"></div>
|
||||
<div id="upgradeResult" style="display:none; margin-top: 12px;"></div>
|
||||
<p id="upgradeWarning" class="text-danger" style="font-size: 12px; text-align: center; margin-top: 8px;">⚠️ 升级前请确保已备份数据库</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="closeModal('upgradeModal')" id="upgradeLaterBtn">稍后再说</button>
|
||||
<button class="btn btn-primary" onclick="startUpgrade()" id="startUpgradeBtn">开始升级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo $role; ?>' };</script>
|
||||
<script src="/assets/js/dashboard.js"></script>
|
||||
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<script>
|
||||
(function() {
|
||||
var upgradeSteps = [];
|
||||
var currentStepIndex = 0;
|
||||
|
||||
fetch('/api/check_upgrade.php')
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
if (data.needs_upgrade) {
|
||||
document.getElementById('currentDbVersion').textContent = data.current;
|
||||
document.getElementById('targetDbVersion').textContent = data.target;
|
||||
upgradeSteps = data.steps || [];
|
||||
|
||||
// 渲染步骤列表
|
||||
var listHtml = '';
|
||||
for (var i = 0; i < upgradeSteps.length; i++) {
|
||||
listHtml += '<div style="display:flex;align-items:center;padding:8px 12px;margin:4px 0;border-radius:6px;font-size:13px;background:var(--color-hover);border-left:3px solid var(--color-border);" id="ustep-' + i + '">' +
|
||||
'<span style="margin-right:8px;" id="ustep-icon-' + i + '">○</span>' +
|
||||
'<span>升级至 v' + upgradeSteps[i].version + '</span>' +
|
||||
'</div>';
|
||||
}
|
||||
document.getElementById('upgradeStepsList').innerHTML = listHtml;
|
||||
document.getElementById('upgradeModal').style.display = 'flex';
|
||||
}
|
||||
})
|
||||
.catch(function() {});
|
||||
|
||||
window.startUpgrade = function() {
|
||||
var btn = document.getElementById('startUpgradeBtn');
|
||||
var closeBtn = document.getElementById('upgradeCloseBtn');
|
||||
var laterBtn = document.getElementById('upgradeLaterBtn');
|
||||
|
||||
btn.disabled = true;
|
||||
btn.textContent = '升级中...';
|
||||
btn.style.opacity = '0.7';
|
||||
closeBtn.style.display = 'none';
|
||||
laterBtn.style.display = 'none';
|
||||
document.getElementById('upgradeWarning').style.display = 'none';
|
||||
|
||||
currentStepIndex = 0;
|
||||
executeNextUpgradeStep();
|
||||
};
|
||||
|
||||
function executeNextUpgradeStep() {
|
||||
if (currentStepIndex >= upgradeSteps.length) {
|
||||
// 所有步骤完成
|
||||
var btn = document.getElementById('startUpgradeBtn');
|
||||
btn.textContent = '升级完成 ✓';
|
||||
btn.style.background = '#52c41a';
|
||||
|
||||
var laterBtn = document.getElementById('upgradeLaterBtn');
|
||||
laterBtn.style.display = '';
|
||||
laterBtn.textContent = '关闭';
|
||||
laterBtn.onclick = function() { location.reload(); };
|
||||
|
||||
document.getElementById('upgradeResult').style.display = 'block';
|
||||
document.getElementById('upgradeResult').innerHTML = '<div style="background:#f6ffed;border:1px solid #b7eb8f;border-radius:6px;padding:12px;text-align:center;color:var(--color-success);font-size:14px;">✓ 数据库升级成功!</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
var step = upgradeSteps[currentStepIndex];
|
||||
var stepEl = document.getElementById('ustep-' + currentStepIndex);
|
||||
var iconEl = document.getElementById('ustep-icon-' + currentStepIndex);
|
||||
|
||||
// 标记为执行中
|
||||
if (stepEl) {
|
||||
stepEl.style.borderLeftColor = 'var(--color-primary)';
|
||||
stepEl.style.background = 'var(--color-primary-light)';
|
||||
}
|
||||
if (iconEl) iconEl.textContent = '⟳';
|
||||
|
||||
fetch('/upgrade.php?action=step&version=' + encodeURIComponent(step.version), { method: 'POST' })
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
if (data.success) {
|
||||
if (stepEl) {
|
||||
stepEl.style.borderLeftColor = 'var(--color-success)';
|
||||
stepEl.style.background = '#f6ffed';
|
||||
}
|
||||
if (iconEl) iconEl.textContent = '✓';
|
||||
currentStepIndex++;
|
||||
executeNextUpgradeStep();
|
||||
} else {
|
||||
if (stepEl) {
|
||||
stepEl.style.borderLeftColor = 'var(--color-danger)';
|
||||
stepEl.style.background = 'var(--color-danger-light)';
|
||||
}
|
||||
if (iconEl) iconEl.textContent = '✗';
|
||||
showUpgradeError(data.error || '未知错误');
|
||||
}
|
||||
})
|
||||
.catch(function(err) {
|
||||
if (stepEl) {
|
||||
stepEl.style.borderLeftColor = 'var(--color-danger)';
|
||||
stepEl.style.background = 'var(--color-danger-light)';
|
||||
}
|
||||
if (iconEl) iconEl.textContent = '✗';
|
||||
showUpgradeError(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
function showUpgradeError(msg) {
|
||||
var btn = document.getElementById('startUpgradeBtn');
|
||||
btn.textContent = '升级失败';
|
||||
btn.style.background = 'var(--color-danger)';
|
||||
btn.disabled = false;
|
||||
btn.style.opacity = '';
|
||||
|
||||
var laterBtn = document.getElementById('upgradeLaterBtn');
|
||||
laterBtn.style.display = '';
|
||||
laterBtn.textContent = '关闭';
|
||||
|
||||
document.getElementById('upgradeResult').style.display = 'block';
|
||||
document.getElementById('upgradeResult').innerHTML = '<div style="background:var(--color-danger-light);border:1px solid #ffccc7;border-radius:6px;padding:12px;color:var(--color-danger-dark);font-size:13px;"><strong>升级失败:</strong>' + msg + '</div>';
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include __DIR__ . '/../includes/footer.php'; ?>
|
||||
@@ -83,7 +83,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo $role; ?>', userId: <?php echo intval($_SESSION['user_id']); ?> };</script>
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>', userId: <?php echo intval($_SESSION['user_id']); ?> };</script>
|
||||
<script src="/assets/js/modules/modal-utils.js"></script>
|
||||
<script src="/assets/js/modules/utils.js"></script>
|
||||
<script src="/assets/js/modules/points-mgmt.js"></script>
|
||||
|
||||
@@ -32,12 +32,12 @@ include __DIR__ . '/../includes/header.php';
|
||||
|
||||
<div class="container">
|
||||
<!-- 科目管理折叠面板 -->
|
||||
<div class="card" style="margin-bottom: 20px;">
|
||||
<div class="collapsible-header" onclick="toggleSubjectPanel()" style="cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 15px 20px;">
|
||||
<div class="card collapsible-card" style="margin-bottom: 20px;">
|
||||
<div class="collapsible-header" id="subjectPanelHeader">
|
||||
<h3 style="margin: 0; font-size: 16px;">📚 科目管理</h3>
|
||||
<span id="subjectPanelToggle" class="toggle-icon">▶ 展开</span>
|
||||
</div>
|
||||
<div id="subjectPanelContent" style="display: none; padding: 0 20px 20px;">
|
||||
<div id="subjectPanelContent" class="collapsible-content">
|
||||
<div class="action-bar">
|
||||
<button class="btn btn-primary" onclick="showAddSubjectModal()">添加科目</button>
|
||||
</div>
|
||||
@@ -92,9 +92,6 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="deduction-types">
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(-window.DEDUCTION_HOMEWORK_NOT_SUBMIT, '未交作业')">未交作业(-<span class="hw-not-submit"></span>分)</button>
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(-window.DEDUCTION_HOMEWORK_LATE, '迟交作业')">迟交作业(-<span class="hw-late"></span>分)</button>
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '卫生')">卫生</button>
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '课堂')">课堂</button>
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '纪律')">纪律</button>
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(0, '')">自定义</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -189,7 +186,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
gap: 12px;
|
||||
}
|
||||
.subject-item {
|
||||
background: #f8f9fa;
|
||||
background: var(--color-hover);
|
||||
padding: 12px 20px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
@@ -201,7 +198,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
font-size: 16px;
|
||||
}
|
||||
.subject-code {
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.subject-status {
|
||||
@@ -217,22 +214,36 @@ include __DIR__ . '/../includes/header.php';
|
||||
background: #fed7d7;
|
||||
color: #742a2a;
|
||||
}
|
||||
.collapsible-header {
|
||||
.collapsible-card .collapsible-header {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15px 20px;
|
||||
user-select: none;
|
||||
transition: background 0.2s;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.collapsible-header:hover {
|
||||
background: #f8f9fa;
|
||||
.collapsible-card .collapsible-header:hover {
|
||||
background: var(--color-hover, #f7fafc);
|
||||
}
|
||||
.collapsible-card .collapsible-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease-out, padding 0.3s ease-out;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.collapsible-card .collapsible-content.expanded {
|
||||
max-height: 1000px;
|
||||
padding: 0 20px 20px;
|
||||
}
|
||||
.toggle-icon {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
color: var(--color-text-secondary, #666);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.btn-danger {
|
||||
background: #e53e3e;
|
||||
color: white;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: #c53030;
|
||||
.toggle-icon.expanded {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ include __DIR__ . '/../includes/header.php';
|
||||
<input type="text" id="semesterName" required placeholder="如:2025春季学期" maxlength="100">
|
||||
</div>
|
||||
<div style="margin-bottom: 8px;">
|
||||
<button type="button" class="btn btn-sm" style="border: 1px solid #667eea; color: #667eea; margin-right: 6px;" onclick="fillSemesterDates('upper')">上学期(9月-次年2月)</button>
|
||||
<button type="button" class="btn btn-sm" style="border: 1px solid #667eea; color: #667eea;" onclick="fillSemesterDates('lower')">下学期(3月-7月)</button>
|
||||
<button type="button" class="btn btn-sm btn-outline" style="margin-right: 6px;" onclick="fillSemesterDates('upper')">上学期(9月-次年2月)</button>
|
||||
<button type="button" class="btn btn-sm btn-outline" onclick="fillSemesterDates('lower')">下学期(3月-7月)</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>开始日期</label>
|
||||
|
||||
@@ -30,7 +30,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="action-buttons">
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<button class="btn btn-primary" onclick="showImportModal()">导入学生</button>
|
||||
<button class="btn btn-success" onclick="showAddStudentModal()">新增学生</button>
|
||||
<button class="btn btn-primary" onclick="showAddStudentModal()">新增学生</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
|
||||
103
frontend/api/check_upgrade.php
Normal file
103
frontend/api/check_upgrade.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* 检查数据库版本是否需要升级
|
||||
* 返回 JSON: {needs_upgrade: bool, current: string, target: string}
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../config.php';
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
// 只有班主任才能检查升级
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
echo json_encode(['error' => '未授权']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
if ($role !== '班主任') {
|
||||
echo json_encode(['needs_upgrade' => false]);
|
||||
exit();
|
||||
}
|
||||
|
||||
// 读取后端 .env 获取数据库配置
|
||||
$envPath = __DIR__ . '/../../backend/.env';
|
||||
if (!file_exists($envPath)) {
|
||||
echo json_encode(['error' => '数据库配置文件不存在']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$lines = file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
$dbConfig = [];
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line);
|
||||
if ($line === '' || strpos($line, '#') === 0) {
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, '=') !== false) {
|
||||
list($key, $value) = explode('=', $line, 2);
|
||||
$dbConfig[trim($key)] = trim($value);
|
||||
}
|
||||
}
|
||||
|
||||
$required = ['DB_HOST', 'DB_PORT', 'DB_USER', 'DB_PASSWORD', 'DB_NAME'];
|
||||
foreach ($required as $key) {
|
||||
if (!isset($dbConfig[$key]) || $dbConfig[$key] === '') {
|
||||
echo json_encode(['error' => "缺少数据库配置: {$key}"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$dsn = "mysql:host={$dbConfig['DB_HOST']};port={$dbConfig['DB_PORT']};dbname={$dbConfig['DB_NAME']};charset=utf8mb4";
|
||||
$pdo = new PDO($dsn, $dbConfig['DB_USER'], $dbConfig['DB_PASSWORD'], [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||
]);
|
||||
|
||||
// 检测当前版本
|
||||
$currentVersion = '0.0.0';
|
||||
try {
|
||||
$stmt = $pdo->query("SELECT setting_value FROM system_settings WHERE setting_key = 'db_version'");
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row) {
|
||||
$currentVersion = $row['setting_value'];
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
// 表不存在,使用默认值
|
||||
}
|
||||
|
||||
// 读取目标版本
|
||||
$versionFile = __DIR__ . '/../../VERSION';
|
||||
if (!file_exists($versionFile)) {
|
||||
echo json_encode(['error' => 'VERSION 文件不存在']);
|
||||
exit();
|
||||
}
|
||||
$targetVersion = trim(file_get_contents($versionFile));
|
||||
|
||||
$needsUpgrade = version_compare($targetVersion, $currentVersion, '>');
|
||||
|
||||
$allVersions = [
|
||||
'1.7' => 'v1.7.sql',
|
||||
'1.8' => 'v1.8.sql',
|
||||
'2.0' => 'v2.0.sql',
|
||||
'2.0.1' => 'v2.0.1.sql',
|
||||
'2.1' => 'v2.1.sql',
|
||||
];
|
||||
$steps = [];
|
||||
foreach ($allVersions as $version => $file) {
|
||||
if (version_compare($version, $currentVersion, '>') &&
|
||||
version_compare($version, $targetVersion, '<=')) {
|
||||
$steps[] = ['version' => $version, 'file' => $file];
|
||||
}
|
||||
}
|
||||
usort($steps, function($a, $b) { return version_compare($a['version'], $b['version']); });
|
||||
|
||||
echo json_encode([
|
||||
'needs_upgrade' => $needsUpgrade,
|
||||
'current' => $currentVersion,
|
||||
'target' => $targetVersion,
|
||||
'steps' => $steps
|
||||
]);
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['error' => '数据库连接失败: ' . $e->getMessage()]);
|
||||
}
|
||||
@@ -21,13 +21,13 @@
|
||||
}
|
||||
|
||||
.batch-info {
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 导入区域 */
|
||||
.import-area {
|
||||
border: 2px dashed #ddd;
|
||||
border: 2px dashed var(--color-border);
|
||||
border-radius: 12px;
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
.import-area:hover {
|
||||
border-color: #667eea;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.import-area input {
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
|
||||
.import-label {
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
/* 筛选栏 */
|
||||
.filter-bar {
|
||||
background: #f8f9fa;
|
||||
background: var(--color-hover);
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
@@ -78,14 +78,14 @@
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.filter-group input,
|
||||
.filter-group select {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@@ -106,18 +106,18 @@
|
||||
.assignment-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.assignment-meta {
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 状态选择器 */
|
||||
.status-select {
|
||||
padding: 4px 8px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -201,8 +201,8 @@
|
||||
}
|
||||
|
||||
.attendance-toolbar .status-btn.active {
|
||||
border-color: #667eea;
|
||||
background: #eef2ff;
|
||||
border-color: var(--color-primary);
|
||||
background: var(--color-primary-light);
|
||||
color: #4338ca;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,43 @@
|
||||
* 版权所有 © Sea Network Technology Studio
|
||||
*/
|
||||
|
||||
:root {
|
||||
/* 主色调 */
|
||||
--color-primary: #4361ee;
|
||||
--color-primary-light: #eef0ff;
|
||||
--color-primary-dark: #3651d4;
|
||||
--color-primary-hover: #3a56d4;
|
||||
|
||||
/* 语义色 */
|
||||
--color-danger: #e53e3e;
|
||||
--color-danger-light: #fff5f5;
|
||||
--color-danger-dark: #c53030;
|
||||
--color-success: #38a169;
|
||||
--color-success-light: #f0fff4;
|
||||
--color-warning: #d69e2e;
|
||||
--color-warning-light: #fffff0;
|
||||
|
||||
/* 灰度 */
|
||||
--color-text: #1a202c;
|
||||
--color-text-secondary: #4a5568;
|
||||
--color-text-muted: #a0aec0;
|
||||
--color-bg: #f5f7fb;
|
||||
--color-card: #ffffff;
|
||||
--color-border: #e2e8f0;
|
||||
--color-border-light: #edf2f7;
|
||||
--color-hover: #f7fafc;
|
||||
|
||||
/* 按钮 */
|
||||
--btn-primary-bg: var(--color-primary);
|
||||
--btn-primary-text: #ffffff;
|
||||
--btn-outline-bg: transparent;
|
||||
--btn-outline-border: var(--color-primary);
|
||||
--btn-outline-text: var(--color-primary);
|
||||
--btn-danger-bg: var(--color-danger);
|
||||
--btn-danger-text: #ffffff;
|
||||
--btn-ghost-text: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -17,10 +54,10 @@
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
background: #f5f7fb;
|
||||
background: var(--color-bg);
|
||||
min-height: 100vh;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
/* ========== 登录页面 ========== */
|
||||
@@ -41,12 +78,12 @@ body {
|
||||
|
||||
.login-header h1 {
|
||||
font-size: 24px;
|
||||
color: #333;
|
||||
color: var(--color-text);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.login-header p {
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@@ -57,14 +94,14 @@ body {
|
||||
.login-form label {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
color: #555;
|
||||
color: var(--color-text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.login-form input {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
transition: border-color 0.3s;
|
||||
@@ -72,13 +109,13 @@ body {
|
||||
|
||||
.login-form input:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.btn-login {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
background: linear-gradient(135deg, var(--color-primary) 0%, #764ba2 100%);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
@@ -93,8 +130,8 @@ body {
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
background: #fee;
|
||||
color: #c33;
|
||||
background: var(--color-danger-light);
|
||||
color: var(--color-danger);
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
margin-top: 15px;
|
||||
@@ -106,8 +143,8 @@ body {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
color: #999;
|
||||
border-top: 1px solid var(--color-border-light);
|
||||
color: var(--color-text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -126,7 +163,7 @@ body {
|
||||
|
||||
.header h1 {
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.header-info {
|
||||
@@ -136,12 +173,12 @@ body {
|
||||
}
|
||||
|
||||
.user-name {
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.user-role {
|
||||
background: #667eea;
|
||||
background: var(--color-primary);
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 20px;
|
||||
@@ -149,7 +186,7 @@ body {
|
||||
}
|
||||
|
||||
.btn-logout {
|
||||
background: #e53e3e;
|
||||
background: var(--color-danger);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 6px 16px;
|
||||
@@ -160,14 +197,14 @@ body {
|
||||
}
|
||||
|
||||
.btn-logout:hover {
|
||||
background: #c53030;
|
||||
background: var(--color-danger-dark);
|
||||
}
|
||||
|
||||
/* ========== 导航菜单 ========== */
|
||||
.nav {
|
||||
background: white;
|
||||
padding: 0 24px;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
overflow-x: auto;
|
||||
@@ -177,7 +214,7 @@ body {
|
||||
padding: 12px 20px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
@@ -187,12 +224,12 @@ body {
|
||||
}
|
||||
|
||||
.nav-item:hover {
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.nav-item.active {
|
||||
color: #667eea;
|
||||
border-bottom-color: #667eea;
|
||||
color: var(--color-primary);
|
||||
border-bottom-color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* ========== 容器 ========== */
|
||||
@@ -216,8 +253,8 @@ body {
|
||||
font-weight: bold;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 2px solid #667eea;
|
||||
color: #333;
|
||||
border-bottom: 2px solid var(--color-primary);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
/* ========== 统计卡片网格 ========== */
|
||||
@@ -239,12 +276,12 @@ body {
|
||||
.stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -261,17 +298,17 @@ table {
|
||||
th, td {
|
||||
padding: 12px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
}
|
||||
|
||||
th {
|
||||
background: #f8f9fa;
|
||||
background: var(--color-hover);
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background: #f8f9fa;
|
||||
background: var(--color-hover);
|
||||
}
|
||||
|
||||
/* ========== 状态标签 ========== */
|
||||
@@ -324,57 +361,94 @@ tr:hover {
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
background: var(--btn-primary-bg);
|
||||
color: var(--btn-primary-text);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5a67d8;
|
||||
background: var(--color-primary-hover);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #e53e3e;
|
||||
color: white;
|
||||
background: var(--btn-danger-bg);
|
||||
color: var(--btn-danger-text);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #c53030;
|
||||
background: var(--color-danger-dark);
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background: #38a169;
|
||||
color: white;
|
||||
background: var(--color-success-light);
|
||||
color: var(--color-success);
|
||||
border: 1px solid #c6f6d5;
|
||||
}
|
||||
|
||||
.btn-success:hover {
|
||||
background: #2f855a;
|
||||
background: #c6f6d5;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
background: #d69e2e;
|
||||
color: white;
|
||||
background: var(--color-warning-light);
|
||||
color: var(--color-warning);
|
||||
border: 1px solid #fefcbf;
|
||||
}
|
||||
|
||||
.btn-warning:hover {
|
||||
background: #b7791f;
|
||||
background: #fefcbf;
|
||||
}
|
||||
|
||||
.btn-info {
|
||||
background: #3182ce;
|
||||
color: white;
|
||||
background: #e3f2fd;
|
||||
color: #1565c0;
|
||||
border: 1px solid #bbdefb;
|
||||
}
|
||||
|
||||
.btn-info:hover {
|
||||
background: #2b6cb0;
|
||||
background: #bbdefb;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #718096;
|
||||
color: white;
|
||||
background: var(--color-hover);
|
||||
color: var(--color-text-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #4a5568;
|
||||
background: var(--color-border-light);
|
||||
}
|
||||
|
||||
.btn-outline {
|
||||
background: transparent;
|
||||
color: var(--color-primary);
|
||||
border: 1px solid var(--color-primary);
|
||||
}
|
||||
|
||||
.btn-outline:hover {
|
||||
background: var(--color-primary-light);
|
||||
}
|
||||
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--color-text-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.btn-ghost:hover {
|
||||
background: var(--color-hover);
|
||||
border-color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.btn-outline-danger {
|
||||
background: transparent;
|
||||
color: var(--color-danger);
|
||||
border: 1px solid var(--color-danger);
|
||||
}
|
||||
|
||||
.btn-outline-danger:hover {
|
||||
background: var(--color-danger-light);
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
@@ -412,12 +486,12 @@ tr:hover {
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
}
|
||||
|
||||
.modal-header h3 {
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
@@ -425,13 +499,13 @@ tr:hover {
|
||||
border: none;
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
margin-top: 20px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #eee;
|
||||
border-top: 1px solid var(--color-border-light);
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
@@ -446,7 +520,7 @@ tr:hover {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
font-weight: 500;
|
||||
color: #555;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
@@ -454,7 +528,7 @@ tr:hover {
|
||||
.form-group textarea {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
@@ -463,12 +537,12 @@ tr:hover {
|
||||
.form-group select:focus,
|
||||
.form-group textarea:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.form-group small {
|
||||
display: block;
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
@@ -513,7 +587,7 @@ tr:hover {
|
||||
|
||||
.search-bar input {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 6px;
|
||||
width: 200px;
|
||||
}
|
||||
@@ -530,10 +604,10 @@ tr:hover {
|
||||
|
||||
.pagination a, .pagination span {
|
||||
padding: 6px 12px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
cursor: pointer;
|
||||
min-width: 36px;
|
||||
text-align: center;
|
||||
@@ -542,22 +616,22 @@ tr:hover {
|
||||
}
|
||||
|
||||
.pagination a:hover {
|
||||
background: #f0f0ff;
|
||||
border-color: #667eea;
|
||||
color: #667eea;
|
||||
background: var(--color-primary-light);
|
||||
border-color: var(--color-primary);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.pagination .active {
|
||||
background: #667eea;
|
||||
background: var(--color-primary);
|
||||
color: white;
|
||||
border-color: #667eea;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.pagination .ellipsis {
|
||||
border: none;
|
||||
cursor: default;
|
||||
padding: 6px 4px;
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
@@ -567,13 +641,13 @@ tr:hover {
|
||||
gap: 4px;
|
||||
margin-left: 8px;
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.pagination .page-jump input {
|
||||
width: 50px;
|
||||
padding: 5px 8px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
@@ -581,8 +655,8 @@ tr:hover {
|
||||
}
|
||||
|
||||
.pagination .page-jump input:focus {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
|
||||
}
|
||||
|
||||
.pagination .page-nav {
|
||||
@@ -605,11 +679,11 @@ tr:hover {
|
||||
}
|
||||
|
||||
.toast-success {
|
||||
background: #38a169;
|
||||
background: var(--color-success);
|
||||
}
|
||||
|
||||
.toast-error {
|
||||
background: #e53e3e;
|
||||
background: var(--color-danger);
|
||||
}
|
||||
|
||||
.toast-warning {
|
||||
@@ -632,8 +706,8 @@ tr:hover {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid #ddd;
|
||||
border-top-color: #667eea;
|
||||
border: 2px solid var(--color-border);
|
||||
border-top-color: var(--color-primary);
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
@@ -646,14 +720,14 @@ tr:hover {
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* ========== 记录项 ========== */
|
||||
.record-item {
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -664,22 +738,22 @@ tr:hover {
|
||||
}
|
||||
|
||||
.record-points.plus {
|
||||
color: #38a169;
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.record-points.minus {
|
||||
color: #e53e3e;
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.record-reason {
|
||||
flex: 1;
|
||||
margin: 0 15px;
|
||||
color: #555;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.record-time {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.view-more {
|
||||
@@ -688,7 +762,7 @@ tr:hover {
|
||||
}
|
||||
|
||||
.view-more a {
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -700,7 +774,7 @@ tr:hover {
|
||||
.score-number {
|
||||
font-size: 64px;
|
||||
font-weight: bold;
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* ========== 响应式 ========== */
|
||||
@@ -755,9 +829,9 @@ tr:hover {
|
||||
}
|
||||
|
||||
.action-dropdown-toggle {
|
||||
background: #f7fafc;
|
||||
color: #4a5568;
|
||||
border: 1px solid #e2e8f0;
|
||||
background: var(--color-hover);
|
||||
color: var(--color-text-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
@@ -767,13 +841,13 @@ tr:hover {
|
||||
}
|
||||
|
||||
.action-dropdown-toggle:hover {
|
||||
background: #edf2f7;
|
||||
background: var(--color-border-light);
|
||||
border-color: #cbd5e0;
|
||||
}
|
||||
|
||||
.action-dropdown-toggle.open {
|
||||
background: #edf2f7;
|
||||
border-color: #a0aec0;
|
||||
background: var(--color-border-light);
|
||||
border-color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.action-dropdown-menu {
|
||||
@@ -785,7 +859,7 @@ tr:hover {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e2e8f0;
|
||||
border: 1px solid var(--color-border);
|
||||
min-width: 120px;
|
||||
z-index: 200;
|
||||
overflow: hidden;
|
||||
@@ -799,7 +873,7 @@ tr:hover {
|
||||
.action-dropdown-menu a {
|
||||
display: block;
|
||||
padding: 8px 14px;
|
||||
color: #4a5568;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
@@ -808,20 +882,20 @@ tr:hover {
|
||||
}
|
||||
|
||||
.action-dropdown-menu a:hover {
|
||||
background: #f7fafc;
|
||||
background: var(--color-hover);
|
||||
color: #2d3748;
|
||||
}
|
||||
|
||||
.action-dropdown-menu a.danger {
|
||||
color: #e53e3e;
|
||||
border-top: 1px solid #edf2f7;
|
||||
color: var(--color-danger);
|
||||
border-top: 1px solid var(--color-border-light);
|
||||
margin-top: 4px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.action-dropdown-menu a.danger:hover {
|
||||
background: #fff5f5;
|
||||
color: #c53030;
|
||||
background: var(--color-danger-light);
|
||||
color: var(--color-danger-dark);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@@ -829,4 +903,26 @@ tr:hover {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 链接 ========== */
|
||||
.link {
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ========== 文本工具类 ========== */
|
||||
.text-danger { color: var(--color-danger); }
|
||||
.text-success { color: var(--color-success); }
|
||||
.text-muted { color: var(--color-text-muted); }
|
||||
|
||||
/* ========== 标签 ========== */
|
||||
.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
|
||||
.tag-success { background: #e8f5e9; color: #2e7d32; }
|
||||
.tag-danger { background: #ffebee; color: #c62828; }
|
||||
.tag-warning { background: #fff3e0; color: #e65100; }
|
||||
.tag-info { background: #e3f2fd; color: #1565c0; }
|
||||
|
||||
@@ -18,9 +18,9 @@ async function loadStudents() {
|
||||
html += `<tr>
|
||||
<td><input type="checkbox" class="student-checkbox" data-id="${student.student_id}"></td>
|
||||
<td>${escapeHtml(student.student_no)}</td>
|
||||
<td><a href="/admin/history.php?student_id=${student.student_id}" style="color: #3498db; text-decoration: none;">${escapeHtml(student.name)}</a></td>
|
||||
<td><a href="/admin/history.php?student_id=${student.student_id}" class="link">${escapeHtml(student.name)}</a></td>
|
||||
<td>${student.total_points}</td>
|
||||
<td><button class="btn btn-sm btn-primary" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button></td>
|
||||
<td><button class="btn btn-sm btn-outline" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button></td>
|
||||
</tr>`;
|
||||
});
|
||||
if (res.data.students.length === 0) {
|
||||
|
||||
@@ -29,7 +29,7 @@ async function loadDashboard() {
|
||||
quickActions += '<button class="btn btn-primary" onclick="location.href=\'/admin/conduct.php\'">操行分管理</button>';
|
||||
}
|
||||
if (role === '班主任') {
|
||||
quickActions += '<button class="btn btn-success" onclick="location.href=\'/admin/students.php\'">导入学生</button>';
|
||||
quickActions += '<button class="btn btn-outline" onclick="location.href=\'/admin/students.php\'">导入学生</button>';
|
||||
quickActions += '<button class="btn btn-secondary" onclick="location.href=\'/admin/conduct.php\'">导出德育分记录</button>';
|
||||
}
|
||||
document.getElementById('quickActions').innerHTML = quickActions || '<p>暂无快捷操作</p>';
|
||||
|
||||
@@ -50,7 +50,7 @@ async function loadStudents() {
|
||||
<td>${escapeHtml(student.student_no)}</td>
|
||||
<td>${escapeHtml(student.name)}</td>
|
||||
<td>${student.total_points}</td>
|
||||
<td><button class="btn btn-sm btn-primary" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button></td>
|
||||
<td><button class="btn btn-sm btn-outline" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button></td>
|
||||
</tr>`;
|
||||
});
|
||||
if (res.data.students.length === 0) {
|
||||
@@ -110,13 +110,18 @@ function handleSubmitPoints() {
|
||||
function toggleSubjectPanel() {
|
||||
const content = document.getElementById('subjectPanelContent');
|
||||
const toggle = document.getElementById('subjectPanelToggle');
|
||||
if (content.style.display === 'none') {
|
||||
content.style.display = 'block';
|
||||
if (!content || !toggle) return;
|
||||
|
||||
const isExpanded = content.classList.contains('expanded');
|
||||
if (isExpanded) {
|
||||
content.classList.remove('expanded');
|
||||
toggle.classList.remove('expanded');
|
||||
toggle.textContent = '▶ 展开';
|
||||
} else {
|
||||
content.classList.add('expanded');
|
||||
toggle.classList.add('expanded');
|
||||
toggle.textContent = '▼ 收起';
|
||||
loadSubjectList();
|
||||
} else {
|
||||
content.style.display = 'none';
|
||||
toggle.textContent = '▶ 展开';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,11 +137,11 @@ async function loadSubjectList() {
|
||||
<span class="subject-status ${sub.is_active ? 'subject-status-active' : 'subject-status-inactive'}">
|
||||
${sub.is_active ? '启用' : '禁用'}
|
||||
</span>
|
||||
<button class="btn btn-sm btn-primary" onclick="showEditSubjectModal(${sub.subject_id}, '${escapeHtml(sub.subject_name)}', '${escapeHtml(sub.subject_code || '')}', ${sub.sort_order || 0})">编辑</button>
|
||||
<button class="btn btn-sm" onclick="toggleSubjectStatus(${sub.subject_id}, ${!sub.is_active})">
|
||||
<button class="btn btn-sm btn-outline" onclick="showEditSubjectModal(${sub.subject_id}, '${escapeHtml(sub.subject_name)}', '${escapeHtml(sub.subject_code || '')}', ${sub.sort_order || 0})">编辑</button>
|
||||
<button class="btn btn-sm btn-ghost" onclick="toggleSubjectStatus(${sub.subject_id}, ${!sub.is_active})">
|
||||
${sub.is_active ? '禁用' : '启用'}
|
||||
</button>
|
||||
<button class="btn btn-sm btn-danger" onclick="deleteSubject(${sub.subject_id})">删除</button>
|
||||
<button class="btn btn-sm btn-outline-danger" onclick="deleteSubject(${sub.subject_id})">删除</button>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
@@ -234,6 +239,12 @@ async function submitEditSubject() {
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定科目管理折叠面板
|
||||
var subjectHeader = document.getElementById('subjectPanelHeader');
|
||||
if (subjectHeader) {
|
||||
subjectHeader.addEventListener('click', toggleSubjectPanel);
|
||||
}
|
||||
|
||||
loadStudents();
|
||||
loadSubjectsForHomework();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ async function loadHomework() {
|
||||
statusDisplay = getStatusBadge(hw.status, 'homework');
|
||||
}
|
||||
// 扣分显示
|
||||
const pointsDisplay = hw.points ? `<span style="color: #e53e3e;">${hw.points}分</span>` : '-';
|
||||
const pointsDisplay = hw.points ? `<span class="text-danger">${hw.points}分</span>` : '-';
|
||||
|
||||
html += `<tr>
|
||||
<td>${escapeHtml(hw.title)}</td>
|
||||
|
||||
@@ -25,13 +25,13 @@ async function loadStudents(page = 1) {
|
||||
html += `<tr>
|
||||
<td><input type="checkbox" class="student-checkbox" data-id="${student.student_id}"></td>
|
||||
<td>${escapeHtml(student.student_no)}</td>
|
||||
<td><a href="/admin/history.php?student_id=${student.student_id}" style="color: #3498db; text-decoration: none;">${escapeHtml(student.name)}</a></td>
|
||||
<td><a href="/admin/history.php?student_id=${student.student_id}" class="link">${escapeHtml(student.name)}</a></td>
|
||||
<td>${escapeHtml(student.dormitory_number || '-')}</td>
|
||||
<td>${student.total_points}</td>
|
||||
${userRole === '班主任' ? `<td>${student.parent_phone ? student.parent_phone.slice(0,3) + '******' + student.parent_phone.slice(-2) : '-'}</td>` : ''}
|
||||
<td>
|
||||
<div class="action-dropdown">
|
||||
<button class="btn btn-sm btn-primary" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button>
|
||||
<button class="btn btn-sm btn-outline" onclick="showSinglePointsModal(${student.student_id}, '${escapeHtml(student.name)}')">加减分</button>
|
||||
${userRole === '班主任' ? `<button class="btn btn-sm action-dropdown-toggle" onclick="toggleActionDropdown(this)">更多 ▼</button>
|
||||
<div class="action-dropdown-menu">
|
||||
<a onclick="showEditStudentModal(${student.student_id}, '${escapeHtml(student.student_no)}', '${escapeHtml(student.name)}', '${escapeHtml(student.parent_phone || '')}', '${escapeHtml(student.dormitory_number || '')}')">编辑</a>
|
||||
|
||||
@@ -22,11 +22,11 @@ async function loadSubjects() {
|
||||
<span class="subject-status ${sub.is_active ? 'subject-status-active' : 'subject-status-inactive'}">
|
||||
${sub.is_active ? '启用' : '禁用'}
|
||||
</span>
|
||||
<button class="btn btn-sm btn-primary" onclick="showEditSubjectModal(${sub.subject_id}, '${escapeHtml(sub.subject_name)}', '${escapeHtml(sub.subject_code || '')}', ${sub.sort_order || 0})">编辑</button>
|
||||
<button class="btn btn-sm" onclick="toggleSubject(${sub.subject_id}, ${!sub.is_active})">
|
||||
<button class="btn btn-sm btn-outline" onclick="showEditSubjectModal(${sub.subject_id}, '${escapeHtml(sub.subject_name)}', '${escapeHtml(sub.subject_code || '')}', ${sub.sort_order || 0})">编辑</button>
|
||||
<button class="btn btn-sm btn-ghost" onclick="toggleSubject(${sub.subject_id}, ${!sub.is_active})">
|
||||
${sub.is_active ? '禁用' : '启用'}
|
||||
</button>
|
||||
<button class="btn btn-sm btn-danger" onclick="deleteSubject(${sub.subject_id})">删除</button>
|
||||
<button class="btn btn-sm btn-outline-danger" onclick="deleteSubject(${sub.subject_id})">删除</button>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
@@ -37,8 +37,8 @@ include __DIR__ . '/../includes/header.php';
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
.nav .nav-item.active {
|
||||
color: #667eea;
|
||||
border-bottom-color: #667eea;
|
||||
color: var(--color-primary);
|
||||
border-bottom-color: var(--color-primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
.semester-card {
|
||||
@@ -54,7 +54,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
}
|
||||
.semester-name {
|
||||
font-size: 18px;
|
||||
@@ -77,7 +77,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
.semester-stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #667eea;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
.semester-stat-label {
|
||||
font-size: 12px;
|
||||
@@ -169,18 +169,18 @@ async function loadSemesterRecords() {
|
||||
<div style="margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee;">
|
||||
<div style="font-size: 12px; color: #999; margin-bottom: 8px;">考勤统计</div>
|
||||
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<span style="background: #e8f5e9; color: #388e3c; padding: 2px 8px; border-radius: 10px; font-size: 12px;">出勤 ${record.attendance_present || 0}</span>
|
||||
<span style="background: #ffebee; color: #c62828; padding: 2px 8px; border-radius: 10px; font-size: 12px;">缺勤 ${record.attendance_absent || 0}</span>
|
||||
<span style="background: #fff3e0; color: #e65100; padding: 2px 8px; border-radius: 10px; font-size: 12px;">迟到 ${record.attendance_late || 0}</span>
|
||||
<span style="background: #e3f2fd; color: #1565c0; padding: 2px 8px; border-radius: 10px; font-size: 12px;">请假 ${record.attendance_leave || 0}</span>
|
||||
<span class="tag tag-success">出勤 ${record.attendance_present || 0}</span>
|
||||
<span class="tag tag-danger">缺勤 ${record.attendance_absent || 0}</span>
|
||||
<span class="tag tag-warning">迟到 ${record.attendance_late || 0}</span>
|
||||
<span class="tag tag-info">请假 ${record.attendance_leave || 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<div style="font-size: 12px; color: #999; margin-bottom: 8px;">作业统计</div>
|
||||
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<span style="background: #e8f5e9; color: #388e3c; padding: 2px 8px; border-radius: 10px; font-size: 12px;">已交 ${record.homework_submitted || 0}</span>
|
||||
<span style="background: #ffebee; color: #c62828; padding: 2px 8px; border-radius: 10px; font-size: 12px;">未交 ${record.homework_not_submitted || 0}</span>
|
||||
<span style="background: #fff3e0; color: #e65100; padding: 2px 8px; border-radius: 10px; font-size: 12px;">迟交 ${record.homework_late || 0}</span>
|
||||
<span class="tag tag-success">已交 ${record.homework_submitted || 0}</span>
|
||||
<span class="tag tag-danger">未交 ${record.homework_not_submitted || 0}</span>
|
||||
<span class="tag tag-warning">迟交 ${record.homework_late || 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user