Parcourir la source

vue 20241223 页面 修改

贾小兵 il y a 5 mois
Parent
commit
0132cca9a5
2 fichiers modifiés avec 37 ajouts et 22 suppressions
  1. 16 1
      ruoyi-ui/src/api/sim/exam.js
  2. 21 21
      ruoyi-ui/src/views/peoples/exams/index.vue

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

@@ -6,7 +6,7 @@ import { parseStrEmpty } from "@/utils/ruoyi";
 // 查询老师考试集合列表
 export function examTearcherList(query) {
     return request({
-      url: '/sim/real-exam-collection/list',
+      url: '/sim/real-exam-collection/teacher/exam/list',
       method: 'get',
       params: query
     })
@@ -41,6 +41,21 @@ export function examTearcherdel(examCollectionIds) {
         method: 'delete'
     })
 }
+
+// 打开考试集合
+export function examTearcheropen(examCollectionId) {
+  return request({
+    url: '/sim/real-exam-collection/teacher/exam/open/' + examCollectionId,
+    method: 'get',
+  })
+}
+// 关闭考试集合
+export function examTearcherclose(examCollectionId) {
+  return request({
+    url: '/sim/real-exam-collection/teacher/exam/close/' + examCollectionId,
+    method: 'get',
+  })
+}
 // 老师考试相关 end
 
 

+ 21 - 21
ruoyi-ui/src/views/peoples/exams/index.vue

@@ -116,7 +116,7 @@
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column label="编号" align="center" key="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" width="80"/>
           <el-table-column label="考试名称" align="center" key="examCollectionName" prop="examCollectionName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="考试时长" align="center" key="limitDuration" prop="limitDuration" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="考试时长" align="center" key="limitDuration" prop="limitDuration" v-if="columns[2].visible" :show-overflow-tooltip="true" width="100"/>
           <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[3].visible" :show-overflow-tooltip="true" >
             <template slot-scope="scope">
               <span>{{scope.row.startTime}}</span> ~  <span>{{scope.row.endTime}}</span>
@@ -127,17 +127,17 @@
                 <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="createBy" prop="createBy" v-if="columns[5].visible" :show-overflow-tooltip="true" />
-          <!-- <el-table-column label="考试状态" align="center" key="status" v-if="columns[6].visible">
+          <el-table-column label="创建老师" align="center" key="createBy" prop="createBy" v-if="columns[5].visible" :show-overflow-tooltip="true" width="100" />
+          <el-table-column label="考试状态" align="center" key="examCollectionState" v-if="columns[6].visible" width="100">
             <template slot-scope="scope">
               <el-switch
-                v-model="scope.row.status"
-                active-value="0"
-                inactive-value="1"
+                v-model="scope.row.examCollectionState"
+                active-value="2"
+                inactive-value="0"
                 @change="handleStatusChange(scope.row)"
               ></el-switch>
             </template>
-          </el-table-column> -->
+          </el-table-column>
           <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[7].visible" width="160">
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -406,7 +406,7 @@
 }
 </style>
 <script>
-import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet} from "@/api/sim/exam";
+import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet,examTearcheropen,examTearcherclose} from "@/api/sim/exam";
 import { listMajor  } from "@/api/sim/major";
 
 
@@ -641,7 +641,7 @@ export default {
         { key: 2, label: `考试时长`, visible: true },
         { key: 3, label: `考试时间`, visible: true },
         { key: 4, label: `模拟器类型`, visible: true },
-        { key: 5, label: `考试状态`, visible: false },
+        { key: 5, label: `考试状态`, visible: true },
         { key: 6, label: `创建老师`, visible: true },
         { key: 7, label: `创建时间`, visible: true }
       ],
@@ -963,7 +963,7 @@ export default {
       this.loading = true;
       examTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           //将返回值注释
-          this.userList = response.rows;
+          this.userList = response.data;
           this.total = response.total;
           this.loading = false;
         }
@@ -995,17 +995,17 @@ export default {
       this.queryParams.deptId = data.id;
       this.handleQuery();
     },
-    // 用户状态修改
-    // handleStatusChange(row) {
-    //   let text = row.status === "0" ? "启用" : "停用";
-    //   this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
-    //     return changeUserStatus(row.userId, row.status);
-    //   }).then(() => {
-    //     this.$modal.msgSuccess(text + "成功");
-    //   }).catch(function() {
-    //     row.status = row.status === "0" ? "1" : "0";
-    //   });
-    // },
+    // 状态修改
+    handleStatusChange(row) {
+      let text = row.examCollectionState === "0" ? "启用" : "停用";
+      this.$modal.confirm('确认要"' + text + '""' + row.examCollectionName + '"吗?').then(function() {
+        return changeUserStatus(row.userId, row.status);
+      }).then(() => {
+        this.$modal.msgSuccess(text + "成功");
+      }).catch(function() {
+        row.status = row.status === "0" ? "1" : "0";
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;