diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class index 1bf4183..638701c 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp index 014f011..0cc29af 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp @@ -49,7 +49,7 @@
  • 成绩查看
  • -
  • 成绩管理
  • +
  • 成绩管理
  • 学生成绩管理
  • diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/scoreopv2.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/scoreopv2.jsp new file mode 100644 index 0000000..0107679 --- /dev/null +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/scoreopv2.jsp @@ -0,0 +1,446 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + + + + 成绩信息修改v2 + + + + + + + + + + + +
    + +
    + + + + +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    成绩ID学号学生姓名课程ID课程名成绩
    ${score.scoreID}${score.student.id}${score.student.name}${score.course.courseID}${score.course.courseName}${score.score}
    +
    +
    +
    + + + +
    + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project2/out/artifacts/project2_war_exploded/resources/js/range-limit.js b/project2/out/artifacts/project2_war_exploded/resources/js/range-limit.js new file mode 100644 index 0000000..9fef4f2 --- /dev/null +++ b/project2/out/artifacts/project2_war_exploded/resources/js/range-limit.js @@ -0,0 +1,12 @@ +const input_min = document.querySelector("#customRange1") +const input_max = document.querySelector("#customRange2") +const value_min = document.querySelector("#score_min_value") +const value_max = document.querySelector("#score_max_value") +input_min.addEventListener("input", (event) => { + value_min.textContent = event.target.value + input_max.setAttribute("min", event.target.value) +}) +input_max.addEventListener("input", (event) => { + value_max.textContent = event.target.value + input_min.setAttribute("max", event.target.value) +}) \ No newline at end of file diff --git a/project2/project2.sql b/project2/project2.sql index d854a00..8ae3820 100644 --- a/project2/project2.sql +++ b/project2/project2.sql @@ -11,7 +11,7 @@ Target Server Version : 80033 (8.0.33) File Encoding : 65001 - Date: 12/06/2023 10:34:40 + Date: 12/06/2023 19:35:57 */ SET NAMES utf8mb4; diff --git a/project2/src/main/java/cyou/chenx221/controller/ScoreController.java b/project2/src/main/java/cyou/chenx221/controller/ScoreController.java index 30b8e17..7e4bc67 100644 --- a/project2/src/main/java/cyou/chenx221/controller/ScoreController.java +++ b/project2/src/main/java/cyou/chenx221/controller/ScoreController.java @@ -1,12 +1,16 @@ package cyou.chenx221.controller; import cyou.chenx221.helper.UsernameHelper; +import cyou.chenx221.pojo.Course; import cyou.chenx221.service.ScoreService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; @Controller @RequestMapping("/score") @@ -27,4 +31,19 @@ public class ScoreController { model.addAttribute("scores", scoreService.getAllScores()); return "scoreList"; } + + @GetMapping("/infomodv2")//处理学生信息修改页 + public String getInfoModv2(@RequestParam(value = "successMessage", required = false, defaultValue = "null") String successMessage, + @RequestParam(value = "errorMessage", required = false, defaultValue = "null") String errorMessage, + Model model) { + String username = new UsernameHelper().getCurrentUsername(); + if (username != null) { + model.addAttribute("username", username); + } + model.addAttribute("scores", scoreService.getAllScores()); + model.addAttribute("successMessage", successMessage); + model.addAttribute("errorMessage", errorMessage); + + return "scoreopv2"; + } } diff --git a/project2/web/WEB-INF/views/dashboard.jsp b/project2/web/WEB-INF/views/dashboard.jsp index 014f011..0cc29af 100644 --- a/project2/web/WEB-INF/views/dashboard.jsp +++ b/project2/web/WEB-INF/views/dashboard.jsp @@ -49,7 +49,7 @@
  • 成绩查看
  • -
  • 成绩管理
  • +
  • 成绩管理
  • 学生成绩管理
  • diff --git a/project2/web/WEB-INF/views/scoreopv2.jsp b/project2/web/WEB-INF/views/scoreopv2.jsp new file mode 100644 index 0000000..0107679 --- /dev/null +++ b/project2/web/WEB-INF/views/scoreopv2.jsp @@ -0,0 +1,446 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + + + + 成绩信息修改v2 + + + + + + + + + + + +
    + +
    + + + + +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    成绩ID学号学生姓名课程ID课程名成绩
    ${score.scoreID}${score.student.id}${score.student.name}${score.course.courseID}${score.course.courseName}${score.score}
    +
    +
    +
    + + + +
    + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project2/web/resources/js/range-limit.js b/project2/web/resources/js/range-limit.js new file mode 100644 index 0000000..28b0545 --- /dev/null +++ b/project2/web/resources/js/range-limit.js @@ -0,0 +1,12 @@ +const input_min = document.querySelector("#customRange1") +const input_max = document.querySelector("#customRange2") +const value_min = document.querySelector("#score_min_value") +const value_max = document.querySelector("#score_max_value") +input_min.addEventListener("input", (event) => { + value_min.textContent = event.target.value + input_max.setAttribute("min", event.target.value) +}) +input_max.addEventListener("input", (event) => { + value_max.textContent = event.target.value + input_min.setAttribute("max", event.target.value) +})