v1.7版本更新

This commit is contained in:
2026-05-21 20:15:56 +08:00
parent 74a71ddaf5
commit cb0c367eb7
54 changed files with 2292 additions and 1785 deletions

View File

@@ -94,8 +94,8 @@ include __DIR__ . '/../includes/header.php';
<div class="stat-value" id="studentRank">--</div>
</div>
<div class="stat-card">
<div class="stat-label">作业完成率</div>
<div class="stat-value" id="homeworkRate">--%</div>
<div class="stat-label">缺交次数</div>
<div class="stat-value" id="homeworkRate">--</div>
</div>
<div class="stat-card">
<div class="stat-label">本月出勤率</div>
@@ -103,6 +103,11 @@ include __DIR__ . '/../includes/header.php';
</div>
</div>
<div class="info-item" id="dormitoryInfo" style="display:none; text-align: center; padding: 8px 0; color: #555; font-size: 14px;">
<span class="info-label">宿舍号: </span>
<span class="info-value" id="dormitoryNumber"></span>
</div>
<div class="card">
<div class="card-title">最新操行分记录</div>
<div id="recentRecords"></div>
@@ -136,10 +141,10 @@ include __DIR__ . '/../includes/header.php';
<thead>
<tr>
<th>科目</th>
<th>作业标题</th>
<th>截止日期</th>
<th>状态</th>
<th>时间</th>
<th>分值</th>
<th>备注</th>
<th>作业</th>
</tr>
</thead>
<tbody id="homeworkList"></tbody>
@@ -296,6 +301,13 @@ include __DIR__ . '/../includes/header.php';
document.getElementById('recentRecords').innerHTML = html;
}
// 获取个人信息(宿舍号)
const infoRes = await apiGet('/api/student/my-info');
if (infoRes && infoRes.success && infoRes.data.dormitory_number) {
document.getElementById('dormitoryNumber').textContent = infoRes.data.dormitory_number;
document.getElementById('dormitoryInfo').style.display = '';
}
// 获取班级排名
const rankingRes = await apiGet('/api/student/ranking', { limit: 100 });
if (rankingRes && rankingRes.success) {
@@ -307,13 +319,14 @@ include __DIR__ . '/../includes/header.php';
document.getElementById('studentRank').textContent = '--';
}
}
// 获取作业统计
// 获取作业统计 - 缺交次数
const homeworkRes = await apiGet(`/api/student/homework/${STUDENT_ID}`);
if (homeworkRes && homeworkRes.success) {
const stats = homeworkRes.data.statistics;
const rate = stats.total > 0 ? Math.round(stats.submitted / stats.total * 100) : 0;
document.getElementById('homeworkRate').textContent = `${rate}%`;
const notSubmitted = (stats.not_submitted || 0) + (stats.late || 0);
const total = stats.total || 0;
document.getElementById('homeworkRate').textContent = `缺交 ${notSubmitted}/${total} 次`;
}
}
// 获取考勤统计
@@ -381,13 +394,14 @@ include __DIR__ . '/../includes/header.php';
if (res && res.success) {
let html = '';
res.data.homework.forEach(hw => {
const pointsDisplay = hw.points ? hw.points + '分' : '-';
html += `
<tr>
<td>${escapeHtml(hw.subject_name)}</td>
<td>${escapeHtml(hw.title)}</td>
<td>${escapeHtml(hw.deadline)}</td>
<td>${getStatusBadge(hw.status, 'homework')}</td>
<td>${hw.deadline || hw.created_at}</td>
<td>${pointsDisplay}</td>
<td>${escapeHtml(hw.comments || '-')}</td>
<td>${escapeHtml(hw.title)}</td>
</tr>
`;
});