Quellcode durchsuchen

vue 20241224 页面 修改

贾小兵 vor 5 Monaten
Ursprung
Commit
76e4201546

+ 13 - 1
ruoyi-ui/src/api/sim/exam.js

@@ -85,11 +85,23 @@ export function exerciseTearcherList(query) {
 // 查询学生考试集合列表
 export function examStudentList(userId) {
     return request({
-        url: '/sim/real-exam/student/listByUserId/' + parseStrEmpty(userId),
+        url: '/sim/real-exam/student/exam/listByUserId/' + parseStrEmpty(userId),
         method: 'get'
     })
 }
 
+
+// 学生进入考试
+export function examStudentEnter(examId) {
+  return request({
+      url: '/sim/real-exam/student/exam/enter/' + parseStrEmpty(examId),
+      method: 'get'
+  })
+}
+
+
+
+
 // 学生获取考试详细信息
 export function examStudentGet(userId) {
   return request({

+ 17 - 17
ruoyi-ui/src/views/people/exam/exam1.vue

@@ -60,23 +60,23 @@ export default {
     };
   },
   created() {
-    const userId = this.$route.params && this.$route.params.userId;
-    if (userId) {
-      this.loading = true;
-      getAuthRole(userId).then((response) => {
-        this.form = response.user;
-        this.roles = response.roles;
-        this.total = this.roles.length;
-        this.$nextTick(() => {
-          this.roles.forEach((row) => {
-            if (row.flag) {
-              this.$refs.table.toggleRowSelection(row);
-            }
-          });
-        });
-        this.loading = false;
-      });
-    }
+    // const userId = this.$route.params && this.$route.params.userId;
+    // if (userId) {
+    //   this.loading = true;
+    //   getAuthRole(userId).then((response) => {
+    //     this.form = response.user;
+    //     this.roles = response.roles;
+    //     this.total = this.roles.length;
+    //     this.$nextTick(() => {
+    //       this.roles.forEach((row) => {
+    //         if (row.flag) {
+    //           this.$refs.table.toggleRowSelection(row);
+    //         }
+    //       });
+    //     });
+    //     this.loading = false;
+    //   });
+    // }
   },
   methods: {
     /** 单击选中行数据 */

+ 36 - 25
ruoyi-ui/src/views/people/exam/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-row>
-      <!--用户数据-->
+      <!--考试数据-->
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
           <el-form-item label="考试名称" prop="userName">
             <el-input
@@ -98,16 +98,16 @@
 
         <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="50" align="center" />
-          <el-table-column label="考试名称" align="center" key="userName" prop="userName" v-if="columns[0].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[1].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="模拟器型号" align="center" key="simType" prop="simType" v-if="columns[2].visible" :show-overflow-tooltip="true" >
+          <el-table-column label="编号" align="center" key="examId" prop="examId" v-if="columns[0].visible" width="80"/>
+          <el-table-column label="考试名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="模拟器型号" align="center" key="simType" prop="simType" v-if="columns[3].visible" :show-overflow-tooltip="true" >
             <template slot-scope="scope">
                 <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.simType"/>
             </template>
           </el-table-column>
-
-          <el-table-column label="创建老师" align="center" key="creater" prop="creater" v-if="columns[3].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="考试状态" align="center" key="status" v-if="columns[4].visible">
+          <el-table-column label="创建老师" align="center" key="creater" prop="creater" v-if="columns[4].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="考试状态" align="center" key="status" v-if="columns[5].visible">
             <template slot-scope="scope">
               <el-switch
                 v-model="scope.row.status"
@@ -221,7 +221,7 @@
 </style>
 <script>
 import { listUser,getUserProfile} from "@/api/system/user";
-import { examStudentList,examStudentGet} from "@/api/sim/exam";
+import { examStudentList,examStudentGet,examStudentEnter} from "@/api/sim/exam";
 import { getToken } from "@/utils/auth";
 
 export default {
@@ -282,11 +282,12 @@ export default {
       },
       // 列信息
       columns: [
-        { key: 0, label: `考试名称`, visible: true },
-        { key: 1, label: `考试时间`, visible: true },
-        { key: 2, label: `模拟器类型`, visible: true },
-        { key: 3, label: `考试状态`, visible: true },
-        { key: 4, label: `创建老师`, visible: true },
+        { key: 0, label: `编号`, visible: true },
+        { key: 1, label: `考试名称`, visible: true },
+        { key: 2, label: `考试时间`, visible: true },
+        { key: 3, label: `模拟器类型`, visible: true },
+        { key: 4, label: `考试状态`, visible: true },
+        { key: 5, label: `创建老师`, visible: true },
       ],
       // 表单校验
       rules: {
@@ -427,16 +428,17 @@ export default {
       getUserProfile().then(response => {
         this.user = response.data;
         console.log(response.data.userId)
+        console.log(this.user.userId);
+        console.log('this.user.userId');
+        examStudentList(this.user.userId).then(response => {
+            //将返回值注释
+            this.userList = response.rows;
+            this.total = response.total;
+            this.loading = false;
+          }
+        );
       });
-      console.log(this.user.userId);
-      console.log('this.user.userId');
-      examStudentList(this.user.userId).then(response => {
-          //将返回值注释
-          this.userList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        }
-      );
+      
     },
     /** 查询部门下拉树结构 */
     getDeptTree() {
@@ -599,9 +601,18 @@ export default {
 
     /** 进入操作 */
     handleInto: function(row) {
-      const userId = row.userId;
-      console.log(userId)
-      this.$router.push("/people/exam-exam1/examid/" + userId);
+      const examId = row.examId;
+      console.log(examId)
+      examStudentEnter(examId).then(response => {
+          //将返回值注释
+          // this.userList = response.rows;
+          // this.total = response.total;
+          // this.loading = false;
+          this.$router.push("/people/exam-exam1/examid/" + examId);
+        }
+      );
+
+      // this.$router.push("/people/exam-exam1/examid/" + userId);
     },
     /** 提交按钮 */
     submitForm: function() {