<%--suppress HtmlUnknownAttribute --%>
<%--
  Created by IntelliJ IDEA.
  User: 25589
  Date: 2024/11/21
  Time: 下午5:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>课程信息列表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/course.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/common.css">
</head>
<body>
<div class="container">
    <table id="course-list">
    </table>
    <div class="course-editor"></div>
    <br><br><br><br><br>
    <table id="course-list-vue">
        <tr class="tr-head">
            <td class="tr-head" colspan="6">课程信息列表</td>
        </tr>
        <tr>
            <td>名称</td>
            <td>性质</td>
            <td>学分</td>
            <td>开设年级</td>
            <td>开设专业</td>
        </tr>
<%--suppress HtmlUnknownAttribute --%>
        <tr v-for="course in courses">
            <td>{{course.name}}</td>
            <td>{{types[course.type]}}</td>
            <td>{{course.credit}}</td>
            <td>{{course.grade}}</td>
            <td>{{majors[course.major]}}</td>
            <td>
<%--suppress HtmlUnknownAttribute --%>
                <a class="blue" @click="edit()">编辑</a>
<%--suppress HtmlUnknownAttribute --%>
                <a class="red" :href="path+'/courseAction/delete?id='+course.id">删除</a>
            </td>
        </tr>

        <tr>
            <td><a href="#" class='blue' onclick="addCourse()">添加</a></td>
            <td></td><td></td><td></td>
            <td>
                <a href="#" class='blue' onclick="getCourses()">刷新数据列表</a>
            </td>
            <td></td>
        </tr>
    </table>
</div>
</body>
<script src="${pageContext.request.contextPath}/js/vue.min.js"></script>
<script>
    let path = "${pageContext.request.contextPath}";
</script>
<script src="${pageContext.request.contextPath}/js/jquery-3.7.1.min.js"></script>
<script src="${pageContext.request.contextPath}/js/course-edit.js"></script>
</html>
