Explorar o código

vue 20241223 页面 修改

贾小兵 hai 5 meses
pai
achega
d2929fad67

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

@@ -43,22 +43,42 @@ export function examTearcherdel(examCollectionIds) {
 }
 
 // 打开考试集合
-export function examTearcheropen(examCollectionId) {
+export function examTearcheropen(examCollectionId,examCollectionState) {
+  const data = {
+    examCollectionState
+  }
   return request({
     url: '/sim/real-exam-collection/teacher/exam/open/' + examCollectionId,
-    method: 'get',
+    method: 'put',
+    data: data
   })
 }
 // 关闭考试集合
-export function examTearcherclose(examCollectionId) {
+export function examTearcherclose(examCollectionId,examCollectionState) {
+  const data = {
+    examCollectionState
+  }
   return request({
     url: '/sim/real-exam-collection/teacher/exam/close/' + examCollectionId,
-    method: 'get',
+    method: 'put',
+    data: data
   })
 }
 // 老师考试相关 end
 
 
+// 老师练习相关 start
+// 练习集合列表
+export function exerciseTearcherList(query) {
+  return request({
+    url: '/sim/real-exam-collection/teacher/exercise/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 老师练习相关 end
+
 
 
 // 学生考试相关 start

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

@@ -8,16 +8,16 @@
               v-model="queryParams.examCollectionName"
               placeholder="请输入考试名称"
               clearable
-              style="width: 150px"
+              style="width: 240px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <!-- <el-form-item label="状态" prop="status">
+          <!-- <el-form-item label="考试状态" prop="examCollectionState">
             <el-select
               v-model="queryParams.status"
-              placeholder="用户状态"
+              placeholder="考试状态"
               clearable
-              style="width: 240px"
+              style="width: 200px"
             >
               <el-option
                 v-for="dict in dict.type.sys_normal_disable"
@@ -30,7 +30,7 @@
           <el-form-item label="考试时间">
             <el-date-picker
               v-model="dateRange"
-              style="width: 240px"
+              style="width: 260px"
               value-format="yyyy-MM-dd"
               type="daterange"
               range-separator="-"
@@ -55,7 +55,7 @@
           </el-form-item>
           <el-form-item label="创建时间">
             <el-date-picker
-              style="width: 240px"
+              style="width: 260px"
               value-format="yyyy-MM-dd"
               type="daterange"
               range-separator="-"
@@ -133,7 +133,7 @@
               <el-switch
                 v-model="scope.row.examCollectionState"
                 active-value="2"
-                inactive-value="0"
+                inactive-value="3"
                 @change="handleStatusChange(scope.row)"
               ></el-switch>
             </template>
@@ -181,22 +181,22 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="考试名称" prop="examCollectionName">
-              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName" style="width: 85%;"/>
+              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName" style="width: 65%;"/>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="考试时长" prop="limitDuration">
-              <el-input v-model="form.limitDuration" placeholder="请输入考试时长" style="width: 85%;">
-                <template slot="append">
-                  <el-button type="primary">
-                    单位(分)
-                  </el-button>
-                </template>
-              </el-input>
+          <el-col :span="8" >
+            <el-form-item label="型号" prop="simType">
+              <el-select v-model="form.simType"  placeholder="请选择模拟器类型" style="width: 65%;">
+                <el-option
+                  v-for="dict in dict.type.sim_sim_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
-
           <el-col :span="8">
             <el-form-item label="考试时间" prop="examTime">
               <el-date-picker type="daterange" v-model="form.examTime" format="yyyy-MM-dd"
@@ -205,34 +205,35 @@
             </el-form-item>
           </el-col>
           
-          <el-col :span="8" >
-            <el-form-item label="型号" prop="simType">
-              <el-select v-model="form.simType"  placeholder="请选择模拟器类型" style="width: 85%;">
-                <el-option
-                  v-for="dict in dict.type.sim_sim_type"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
+          <el-col :span="8">
+            <el-form-item label="考试时长" prop="limitDuration">
+              <el-input v-model="form.limitDuration" placeholder="请输入考试时长" style="width: 65%;">
+                <template slot="append">
+                  <el-button type="primary">
+                    单位(分)
+                  </el-button>
+                </template>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="出题方式" prop="questionSettingMethod"> 
-              <el-select  v-model="form.questionSettingMethod" placeholder="请选择出题方式" style="width: 100%;" @change="selectmethod">
+              <el-select  v-model="form.questionSettingMethod" placeholder="请选择出题方式" style="width: 65%;" @change="selectmethod">
                 <el-option
                   value="请选择"
                 >请选择</el-option>
                 <el-option
-                  v-for="dict in dict.type.sys_topic_way"
+                  v-for="dict in dict.type.sim_question_setting_method"
                   :key="dict.value"
                   :label="dict.label"
                   :value="dict.value"
                 ></el-option>
               </el-select>
             </el-form-item>
+            
           </el-col>
           <el-button type="primary" round @click="handleSelectType" v-show="isShow" style="margin-left: 15px;">自选考题编辑</el-button>
+          
         </el-row>
       </el-form>
 
@@ -407,12 +408,11 @@
 </style>
 <script>
 import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet,examTearcheropen,examTearcherclose} from "@/api/sim/exam";
-import { listMajor  } from "@/api/sim/major";
 
 
 export default {
   name: "Exam",
-  dicts: ['sim_sim_type','sys_topic_way','sys_normal_disable',],
+  dicts: ['sim_sim_type','sim_question_setting_method','sys_normal_disable',],
   data() {
     return {
       multipleSelection: [],
@@ -855,7 +855,7 @@ export default {
   methods: {
     selectmethod(value){
       console.log('出题方式:'+value)
-      if(value==2){
+      if(value==2 || value==3){
         this.isShow = true;
       }else{
         this.isShow = false;
@@ -963,7 +963,7 @@ export default {
       this.loading = true;
       examTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           //将返回值注释
-          this.userList = response.data;
+          this.userList = response.rows;
           this.total = response.total;
           this.loading = false;
         }
@@ -997,9 +997,14 @@ export default {
     },
     // 状态修改
     handleStatusChange(row) {
-      let text = row.examCollectionState === "0" ? "启用" : "停用";
+      console.log(row.examCollectionState);
+      let text = row.examCollectionState === "2" ? "开启" : "关闭";
       this.$modal.confirm('确认要"' + text + '""' + row.examCollectionName + '"吗?').then(function() {
-        return changeUserStatus(row.userId, row.status);
+        if(row.examCollectionState==2){
+          return examTearcherclose(row.examCollectionId,row.examCollectionState);
+        }else{
+          return examTearcheropen(row.examCollectionId,row.examCollectionState);
+        }
       }).then(() => {
         this.$modal.msgSuccess(text + "成功");
       }).catch(function() {

+ 1 - 0
ruoyi-ui/src/views/peoples/student/index.vue

@@ -170,6 +170,7 @@
                 type="text"
                 icon="el-icon-delete"
                 v-hasPermi="['sim:student:remove']"
+                @click="handleDelete(scope.row)"
               >删除</el-button>
               <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['sim:student:resetPwd', 'sim:student:edit']">
                 <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>

+ 8 - 3
ruoyi-ui/src/views/peoples/task/index.vue

@@ -2591,6 +2591,8 @@ export default {
         // console.log(obj)
         // jsonString = JSON.stringify(obj);
 
+       
+
         const arr = [];
         arr['ids'] = 1;
         arr['xinghao'] = 'FZD04B型侦毒器';
@@ -2599,7 +2601,12 @@ export default {
         console.log(arr);
         console.log(JSON.stringify(arr));
         console.log('JSON.stringify(arr)');
-        this.tableData = arr;
+        this.tableData = [{
+          ids:1,
+          xinghao: 'FZD04B型侦毒器',
+          xianxiang: '开机无响应',
+          name: '1.电源开关',
+        }];
       });
 
       // {
@@ -2784,8 +2791,6 @@ export default {
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
-      this.queryParams.deptId = undefined;
-      this.$refs.tree.setCurrentKey(null);
       this.handleQuery();
     },
     // 多选框选中数据

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

@@ -400,6 +400,10 @@
 </style>
 <script>
 import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
+
+import { exerciseTearcherList,examTearcheropen,examTearcherclose} from "@/api/sim/exam";
+
+
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -921,10 +925,10 @@ export default {
     handleSelectionRow(val) {
       this.multipleSelection = val;
     },
-    /** 查询用户列表 */
+    /** 查询练习列表 */
     getList() {
       this.loading = true;
-      listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      exerciseTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           //将返回值注释
           this.userList = response.rows;
           this.total = response.total;