This repository has been archived on 2024-09-30. You can view files and clone it, but cannot push or open issues/pull-requests.
SmartRollCall/app/templates/course-info.html

121 lines
3.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>课程信息</title>
<meta name="renderer" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link href="static/css/layui.css" rel="stylesheet"/>
<style>
.custom-table {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd; /* 轻灰色边框 */
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 轻微的阴影 */
}
.custom-table th, .custom-table td {
text-align: left;
padding: 12px 15px;
border-bottom: 1px solid #ddd; /* 每行之间的分割线 */
}
.custom-table th {
background-color: #f2f2f2; /* 轻灰色背景 */
color: #333; /* 深色文字 */
}
.custom-table tr:hover {
background-color: #f5f5f5; /* 鼠标悬浮时的背景色 */
}
.custom-table td {
color: #555; /* 内容的文字颜色 */
}
</style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo layui-hide-xs layui-bg-black">网上上课点名系统</div>
<!-- 头部区域可配合layui 已有的水平导航) -->
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item layui-hide layui-show-sm-inline-block">
<a href="javascript:;">
<img
src="//unpkg.com/outeres@0.0.10/img/layui/icon-v2.png"
class="layui-nav-img"
/>
{{ session.name }}
</a>
<dl class="layui-nav-child">
<dd><a href="/home/profile">资料</a></dd> <!-- 修改这里的href指向/profile -->
<dd><a href="javascript:;" id="logoutLink">登出</a></dd>
</dl>
</li>
<li
class="layui-nav-item"
lay-header-event="menuRight"
lay-unselect
></li>
</ul>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<!-- 动态加载菜单栏 -->
<ul class="layui-nav layui-nav-tree" lay-filter="test">
</ul>
</div>
</div>
<div class="layui-body">
<!-- 内容主体区域 -->
<div style="padding: 15px;">
<table class="layui-table custom-table">
<!-- 略去colgroup中课程代码的列 -->
<colgroup>
<col width="200">
<col width="150">
<col width="200">
</colgroup>
<thead>
<tr>
<th>课程名称</th>
<th>学分</th>
<th>课程描述</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
<script src="static/layui.js"></script>
<script src="/static/js/menu.js"></script>
<script src="/static/js/logout.js"></script>
<script>
$.get('/api/get-course-info', function (courses) {
var tbody = $('.layui-table tbody');
tbody.empty(); // 清空表格现有内容
courses.forEach(function (course) {
var row = '<tr>' +
'<td>' + course.course_name + '</td>' +
// 移除课程代码的数据
'<td>' + course.credits + '</td>' +
'<td>' + course.description + '</td>' +
'</tr>';
tbody.append(row); // 将新行添加到表格中
});
}
);
</script>
</body>
</html>