From 11e604778cb72d9ea41aaf677e37f172e997b26d Mon Sep 17 00:00:00 2001 From: yuan <3558860895@qq.com> Date: Tue, 19 Nov 2024 18:23:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=A2=9E=E5=8A=A0=E8=AF=95?= =?UTF-8?q?=E5=8D=B7=E4=B8=AD=E5=BF=83=E4=B8=8E=E8=80=83=E8=AF=95=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student/StudentExamPaperController.java | 9 + vue2/vue/src/router/index.js | 16 +- vue2/vue/src/views/Student/Exam.vue | 5 +- vue2/vue/src/views/Student/ExamPaper.vue | 291 ++++++++++++++++++ 4 files changed, 315 insertions(+), 6 deletions(-) create mode 100644 vue2/vue/src/views/Student/ExamPaper.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java index 26efb0d..1a261b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java @@ -38,6 +38,15 @@ public class StudentExamPaperController { @Autowired private IExamCreateService iExamCreateService; + @ApiOperation("班级查询") + @GetMapping("selectByUserId") + public R selectByUserId(){ + SysUser sysUser = SecurityUtils.getLoginUser().getUser(); + Long id = sysUser.getUserId(); + Long userid = iUserService.selectByzhid(id); + return R.ok(iStudentClassService.selectById(userid)); + } + @ApiOperation("试卷查询") @GetMapping("examPaperByTypeAndSubject") public R> examPaperByTypeAndSubject(int pagenum,int pagesize,String type,String subject){ diff --git a/vue2/vue/src/router/index.js b/vue2/vue/src/router/index.js index a783ae6..80174e0 100644 --- a/vue2/vue/src/router/index.js +++ b/vue2/vue/src/router/index.js @@ -8,11 +8,17 @@ import store from '../store'; // 引入 Vuex store Vue.use(VueRouter); const routes = [ - { - path:'/student/exam', - component: () => import(/* webpackChunkName: "about" */ '../views/Student/Exam.vue'), - meta: {requiresAuth: true} - }, + { + path: '/student/examPaper', + name: 'ExamPaper', + component: () => import(/* webpackChunkName: "about" */ '../views/Student/ExamPaper.vue'), + meta: { requiresAuth: true } + }, + { + path:'/student/exam', + component: () => import(/* webpackChunkName: "about" */ '../views/Student/Exam.vue'), + meta: {requiresAuth: true} + }, { path: '/', name: 'home', diff --git a/vue2/vue/src/views/Student/Exam.vue b/vue2/vue/src/views/Student/Exam.vue index dd66312..532ec4c 100644 --- a/vue2/vue/src/views/Student/Exam.vue +++ b/vue2/vue/src/views/Student/Exam.vue @@ -49,7 +49,7 @@

考试时长:{{ paper.time }}

开始时间:{{ paper.startTime || "未设置" }}

结束时间:{{ paper.endTime || "未设置" }}

- + @@ -104,6 +104,9 @@ export default { }, }, methods: { + startExam(name,subject) { + this.$router.push({ name: "ExamPaper", query: { name: name, subject: subject } }); + }, handleTypeChange(type) { this.selectedType = type; // 修改选中的试卷类型 }, diff --git a/vue2/vue/src/views/Student/ExamPaper.vue b/vue2/vue/src/views/Student/ExamPaper.vue new file mode 100644 index 0000000..0ffdbf9 --- /dev/null +++ b/vue2/vue/src/views/Student/ExamPaper.vue @@ -0,0 +1,291 @@ + + + + + +