v1.7版本更新
This commit is contained in:
@@ -36,7 +36,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr><th>科目</th><th>作业标题</th><th>截止日期</th><th>状态</th><th>备注</th></tr>
|
||||
<tr><th>科目</th><th>时间</th><th>分值</th><th>备注</th><th>作业</th></tr>
|
||||
</thead>
|
||||
<tbody id="homeworkList"></tbody>
|
||||
</table>
|
||||
@@ -44,31 +44,8 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const STUDENT_ID = <?php echo $student_id; ?>;
|
||||
|
||||
async function loadHomework() {
|
||||
const res = await apiGet(`/api/student/homework/${STUDENT_ID}`);
|
||||
if (res && res.success) {
|
||||
let html = '';
|
||||
res.data.homework.forEach(hw => {
|
||||
html += `<tr>
|
||||
<td>${escapeHtml(hw.subject_name)}</td>
|
||||
<td>${escapeHtml(hw.title)}</td>
|
||||
<td>${hw.deadline}</td>
|
||||
<td>${getStatusBadge(hw.status, 'homework')}</td>
|
||||
<td>${escapeHtml(hw.comments || '-')}</td>
|
||||
</tr>`;
|
||||
});
|
||||
if (res.data.homework.length === 0) {
|
||||
html = '<tr><td colspan="5" style="text-align:center;">暂无作业</td></tr>';
|
||||
}
|
||||
document.getElementById('homeworkList').innerHTML = html;
|
||||
}
|
||||
}
|
||||
|
||||
loadHomework();
|
||||
</script>
|
||||
<script>window.PAGE_CONFIG = { studentId: <?php echo $student_id; ?> };</script>
|
||||
<script src="/assets/js/student.js"></script>
|
||||
<script src="/assets/js/student-homework.js"></script>
|
||||
|
||||
<?php include __DIR__ . '/../includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user