Procházet zdrojové kódy

Merge branch 'dev-web' into dev

tom před 5 měsíci
rodič
revize
a0cbf09f47

+ 19 - 2
ruoyi-ui/src/api/sim/exam.js

@@ -83,13 +83,30 @@ export function exerciseTearcherList(query) {
 
 // 学生考试相关 start
 // 查询学生考试集合列表
-export function examStudentList(userId) {
+export function examStudentList() {
     return request({
-        url: '/sim/real-exam/student/listByUserId/' + parseStrEmpty(userId),
+        url: '/sim/real-exam/student/exam/listByUserId/',
         method: 'get'
     })
 }
 
+// 学生进入考试
+export function examStudentEnter(examId) {
+  return request({
+      url: '/sim/real-exam/student/exam/enter/' + parseStrEmpty(examId),
+      method: 'get'
+  })
+}
+
+// 准备考试界面
+export function examStudentPrepare(examId) {
+  return request({
+      url: '/sim/real-exam/student/exam/prepare/' + parseStrEmpty(examId),
+      method: 'get'
+  })
+}
+
+
 // 学生获取考试详细信息
 export function examStudentGet(userId) {
   return request({

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

@@ -39,7 +39,7 @@
 </style>
 
 <script>
-import { listUser } from "@/api/system/user";
+import { examStudentPrepare } from "@/api/sim/exam";
 
 export default {
   name: "AuthRole",
@@ -60,23 +60,24 @@ 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;
-      });
-    }
+    this.getList();
+    // 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: {
     /** 单击选中行数据 */
@@ -91,6 +92,18 @@ export default {
     getRowKey(row) {
       return row.roleId;
     },
+    getList() {
+      this.loading = true;
+      const examId = 1;
+      examStudentPrepare(examId).then(response => {
+           console.log(response);
+           console.log();
+           console.log('response.rows.realExamCollectio');
+          //将返回值注释
+          this.loading = false;
+        }
+      );
+    },
     /** 提交按钮 */
     submitForm() {
       const userId = this.form.userId;
@@ -99,7 +112,7 @@ export default {
     //     this.$modal.msgSuccess("授权成功");
     //     this.close();
     //   });
-    this.$router.push("/people/exam-exam2/examid/1");
+      this.$router.push("/people/exam-exam2/examid/1");
     },
     /** 关闭按钮 */
     close() {

+ 65 - 143
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
@@ -39,7 +39,7 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="考试状态" prop="status">
+          <!-- <el-form-item label="考试状态" prop="status">
             <el-select
               v-model="queryParams.status"
               placeholder="考试状态"
@@ -53,7 +53,7 @@
                 :value="dict.value"
               />
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
         
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -98,22 +98,26 @@
 
         <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="realExam.examId" prop="realExam.examId" v-if="columns[0].visible" width="80"/>
+          <el-table-column label="考试名称" align="center" key="realExamCollection.examCollectionName" prop="realExamCollection.examCollectionName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="考试时间" align="center" key="realExamCollection.kaoshiTime" prop="realExamCollection.kaoshiTime" 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"/>
+              <span>{{scope.row.realExamCollection.startTime}}</span> ~  <span>{{scope.row.realExamCollection.endTime}}</span>
             </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="realExamCollection.simType" prop="realExamCollection.simType" v-if="columns[4].visible" :show-overflow-tooltip="true" >
+            <template slot-scope="scope">
+                <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.realExamCollection.simType"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="创建老师" align="center" key="realExamCollection.createBy" prop="realExamCollection.createBy" v-if="columns[4].visible" :show-overflow-tooltip="true" width="100" />
+          <el-table-column label="考试状态" align="center" key="realExamCollection.examCollectionState" v-if="columns[5].visible" width="100">
             <template slot-scope="scope">
               <el-switch
-                v-model="scope.row.status"
-                active-value="0"
-                inactive-value="1"
-                @change="handleStatusChange(scope.row)"
+                v-model="scope.row.realExamCollection.examCollectionState"
+                active-value="2"
+                inactive-value="3"
+                disabled
               ></el-switch>
             </template>
           </el-table-column>
@@ -178,7 +182,6 @@
        
         <el-table 
           :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
-          :span-method="objectSpanMethod" 
           style="width:100%;text-align:center;margin-left:10px; margin-top:10px">
           <el-table-column
             prop="xinghao"
@@ -221,7 +224,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 {
@@ -266,7 +269,10 @@ export default {
       // 角色选项
       roleOptions: [],
       // 表单参数
-      form: {},
+      form: {
+        startTime:'',
+        endTime:'',
+      },
       defaultProps: {
         children: "children",
         label: "label"
@@ -282,11 +288,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: {
@@ -309,97 +316,6 @@ export default {
     });
   },
   methods: {
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      // console.log(this.selectedEquip+'@@@')
-      //第一列型号
-      if(columnIndex === 0) {
-        if(this.selectedEquip==2){
-          if(rowIndex==0){
-            return { rowspan: 13, colspan: 1 };
-          }
-          return { rowspan: 0, colspan: 0 };
-        }else if(this.selectedEquip==3){
-          if(rowIndex==0){
-            return { rowspan: 16, colspan: 1 };
-          }
-          return { rowspan: 0, colspan: 0};
-        }else{
-          if(rowIndex==0){
-            return { rowspan: 11, colspan: 1 };
-          }else if(rowIndex==11){
-            return { rowspan: 13, colspan: 1 };
-          }else if(rowIndex==24){
-            return { rowspan: 16, colspan: 1 };
-          }else{
-            return { rowspan: 0, colspan: 0 };
-          }
-        }
-      }
-
-      //第二列故障现象
-      if(columnIndex === 1) {
-        if(this.selectedEquip==2){
-          // console.log(rowIndex+'####')
-          if(rowIndex<9 && rowIndex % 2 === 0){
-            return { rowspan: 2, colspan: 1 };
-          }else if((rowIndex>9&&rowIndex<13)){
-            return { rowspan: 1, colspan: 1 };
-          }else{
-            return { rowspan: 0, colspan: 0 };
-          } 
-        }else if(this.selectedEquip==3){
-          if(rowIndex<7 && rowIndex % 2 === 0){
-            return { rowspan: 2, colspan: 1 };
-          }else if((rowIndex==8)){
-            return { rowspan: 3, colspan: 1 };
-          }else if(rowIndex==11){
-            return { rowspan: 2, colspan: 1 };
-          }else if(rowIndex>12 && rowIndex<16){
-            return { rowspan: 1, colspan: 1 };
-          }else{
-            return { rowspan: 0, colspan: 0 };
-          } 
-        }else{
-          if(rowIndex<7 && rowIndex % 2 === 0){
-            return { rowspan: 2, colspan: 1 };
-          }else if((rowIndex>7&&rowIndex<11) || (rowIndex>20&&rowIndex<24) || (rowIndex>36)){
-            return { rowspan: 1, colspan: 1 };
-          }else if((rowIndex==35) || (rowIndex>10 && rowIndex<20) && rowIndex % 2 === 1){
-            return { rowspan: 2, colspan: 1 };
-          }else if(rowIndex>23 && rowIndex<32 && rowIndex % 2 === 0){
-            return { rowspan: 2, colspan: 1 };
-          }else if(rowIndex==32){
-            return { rowspan: 3, colspan: 1 };
-          }else{
-            return { rowspan: 0, colspan: 0 };
-          }
-        }
-        
-      }
-      //故障部位 和 选择
-      if(columnIndex === 2 || columnIndex === 3){
-        //return { rowspan: 1, colspan: 1 };
-      }
-    },
-    
-    objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
-      //第二列故障现象
-      if(columnIndex === 0) {
-        if(rowIndex<7 && rowIndex % 2 === 0){
-          return { rowspan: 2, colspan: 1 };
-        }else if((rowIndex>7&&rowIndex<11) || (rowIndex>20&&rowIndex<24) || (rowIndex>36)){
-          return { rowspan: 1, colspan: 1 };
-        }else if((rowIndex==35) || (rowIndex>10 && rowIndex<20) && rowIndex % 2 === 1){
-          return { rowspan: 2, colspan: 1 };
-        }else if(rowIndex>23 && rowIndex<32 && rowIndex % 2 === 0){
-          return { rowspan: 2, colspan: 1 };
-        }else if(rowIndex==32){
-          return { rowspan: 3, colspan: 1 };
-        }else{
-          return { rowspan: 0, colspan: 0 };
-        }
-      }
-    },
     // 根据选择的option获取新的数据
     // getNewTableData(option) {
     //   // 逻辑处理返回新的数据数组
@@ -424,19 +340,30 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      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 => {
+      // 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;
+      //     }
+      //   );
+      // });
+      examStudentList().then(response => {
+          //  console.log(response.rows[0]['realExa']);
+          //  console.log(response.rows.realExamCollection);
+          //  console.log('response.rows.realExamCollectio');
           //将返回值注释
           this.userList = response.rows;
           this.total = response.total;
           this.loading = false;
         }
       );
+      
     },
     /** 查询部门下拉树结构 */
     getDeptTree() {
@@ -577,31 +504,26 @@ export default {
         this.form.password = "";
       });
     },
-    /** 重置密码按钮操作 */
-    handleResetPwd(row) {
-      this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        closeOnClickModal: false,
-        inputPattern: /^.{5,20}$/,
-        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
-        inputValidator: (value) => {
-          if (/<|>|"|'|\||\\/.test(value)) {
-            return "不能包含非法字符:< > \" ' \\\ |"
-          }
-        },
-      }).then(({ value }) => {
-          resetUserPwd(row.userId, value).then(response => {
-            this.$modal.msgSuccess("修改成功,新密码是:" + value);
-          });
-        }).catch(() => {});
-    },
-
     /** 进入操作 */
     handleInto: function(row) {
-      const userId = row.userId;
-      console.log(userId)
-      this.$router.push("/people/exam-exam1/examid/" + userId);
+      const examId = row.realExam.examId;
+      console.log(examId)
+      examStudentEnter(examId).then(response => {
+        if(response.code='200'){
+          this.$router.push("/people/exam-exam1/examid/" + examId);
+        }
+          // console.log(response);
+          // console.log('response');
+          // return;
+          //将返回值注释
+          // 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() {

+ 5 - 5
ruoyi-ui/src/views/peoples/trains/index.vue

@@ -116,7 +116,7 @@
 
         <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="userId" prop="userId" v-if="columns[0].visible" /> -->
+          <el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" width="80"/>
           <el-table-column label="练习名称" align="center" key="userName1" prop="userName1" 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" />
 
@@ -310,10 +310,10 @@
 
       <h4 class="h4" style="font-size: 16px;font-weight: bold;margin-left: 2%;">统计情况</h4>
       <div class="shixiang">
-          <div>本次考试班级数量:2</div>
-          <div>计划参加考试学员数量:34</div>
-          <div>每批次考试学员数量:34</div>
-          <div>计划考试批次:5</div>
+          <div>本次练习区队数量:2</div>
+          <div>计划参加练习学员数量:34</div>
+          <div>每批次练习学员数量:34</div>
+          <div>计划练习批次:5</div>
       </div>
 
       <div slot="footer" class="dialog-footer" style="margin-top: 10%;">