浏览代码

vue 20241224 页面 修改

贾小兵 5 月之前
父节点
当前提交
86a68c7351
共有 3 个文件被更改,包括 76 次插入147 次删除
  1. 9 4
      ruoyi-ui/src/api/sim/exam.js
  2. 15 2
      ruoyi-ui/src/views/people/exam/exam1.vue
  3. 52 141
      ruoyi-ui/src/views/people/exam/index.vue

+ 9 - 4
ruoyi-ui/src/api/sim/exam.js

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

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

@@ -39,7 +39,7 @@
 </style>
 </style>
 
 
 <script>
 <script>
-import { listUser } from "@/api/system/user";
+import { examStudentPrepare } from "@/api/sim/exam";
 
 
 export default {
 export default {
   name: "AuthRole",
   name: "AuthRole",
@@ -60,6 +60,7 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
+    this.getList();
     // const userId = this.$route.params && this.$route.params.userId;
     // const userId = this.$route.params && this.$route.params.userId;
     // if (userId) {
     // if (userId) {
     //   this.loading = true;
     //   this.loading = true;
@@ -91,6 +92,18 @@ export default {
     getRowKey(row) {
     getRowKey(row) {
       return row.roleId;
       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() {
     submitForm() {
       const userId = this.form.userId;
       const userId = this.form.userId;
@@ -99,7 +112,7 @@ export default {
     //     this.$modal.msgSuccess("授权成功");
     //     this.$modal.msgSuccess("授权成功");
     //     this.close();
     //     this.close();
     //   });
     //   });
-    this.$router.push("/people/exam-exam2/examid/1");
+      this.$router.push("/people/exam-exam2/examid/1");
     },
     },
     /** 关闭按钮 */
     /** 关闭按钮 */
     close() {
     close() {

+ 52 - 141
ruoyi-ui/src/views/people/exam/index.vue

@@ -39,7 +39,7 @@
               />
               />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
-          <el-form-item label="考试状态" prop="status">
+          <!-- <el-form-item label="考试状态" prop="status">
             <el-select
             <el-select
               v-model="queryParams.status"
               v-model="queryParams.status"
               placeholder="考试状态"
               placeholder="考试状态"
@@ -53,7 +53,7 @@
                 :value="dict.value"
                 :value="dict.value"
               />
               />
             </el-select>
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
         
         
           <el-form-item>
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <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 v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column type="selection" width="50" align="center" />
-          <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" >
+          <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">
+              <span>{{scope.row.realExamCollection.startTime}}</span> ~  <span>{{scope.row.realExamCollection.endTime}}</span>
+            </template>
+          </el-table-column>
+          <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">
             <template slot-scope="scope">
-                <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.simType"/>
+                <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.realExamCollection.simType"/>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <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">
+          <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">
             <template slot-scope="scope">
               <el-switch
               <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>
               ></el-switch>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
@@ -178,7 +182,6 @@
        
        
         <el-table 
         <el-table 
           :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
           :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
-          :span-method="objectSpanMethod" 
           style="width:100%;text-align:center;margin-left:10px; margin-top:10px">
           style="width:100%;text-align:center;margin-left:10px; margin-top:10px">
           <el-table-column
           <el-table-column
             prop="xinghao"
             prop="xinghao"
@@ -266,7 +269,10 @@ export default {
       // 角色选项
       // 角色选项
       roleOptions: [],
       roleOptions: [],
       // 表单参数
       // 表单参数
-      form: {},
+      form: {
+        startTime:'',
+        endTime:'',
+      },
       defaultProps: {
       defaultProps: {
         children: "children",
         children: "children",
         label: "label"
         label: "label"
@@ -310,97 +316,6 @@ export default {
     });
     });
   },
   },
   methods: {
   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获取新的数据
     // 根据选择的option获取新的数据
     // getNewTableData(option) {
     // getNewTableData(option) {
     //   // 逻辑处理返回新的数据数组
     //   // 逻辑处理返回新的数据数组
@@ -425,19 +340,29 @@ export default {
     /** 查询用户列表 */
     /** 查询用户列表 */
     getList() {
     getList() {
       this.loading = true;
       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 => {
-            //将返回值注释
-            this.userList = response.rows;
-            this.total = response.total;
-            this.loading = false;
-          }
-        );
-      });
+      // 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;
+        }
+      );
       
       
     },
     },
     /** 查询部门下拉树结构 */
     /** 查询部门下拉树结构 */
@@ -579,36 +504,22 @@ export default {
         this.form.password = "";
         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) {
     handleInto: function(row) {
-      const examId = row.examId;
+      const examId = row.realExam.examId;
       console.log(examId)
       console.log(examId)
       examStudentEnter(examId).then(response => {
       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.userList = response.rows;
           // this.total = response.total;
           // this.total = response.total;
           // this.loading = false;
           // this.loading = false;
-          this.$router.push("/people/exam-exam1/examid/" + examId);
+          // this.$router.push("/people/exam-exam1/examid/" + examId);
         }
         }
       );
       );