Quellcode durchsuchen

Merge branch 'dev' into dev-api

tom vor 5 Monaten
Ursprung
Commit
b8ae05b8db

+ 55 - 3
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,20 +41,72 @@ export function examTearcherdel(examCollectionIds) {
         method: 'delete'
     })
 }
+
+// 打开考试集合
+export function examTearcheropen(examCollectionId,examCollectionState) {
+  const data = {
+    examCollectionState
+  }
+  return request({
+    url: '/sim/real-exam-collection/teacher/exam/open/' + examCollectionId,
+    method: 'put',
+    data: data
+  })
+}
+// 关闭考试集合
+export function examTearcherclose(examCollectionId,examCollectionState) {
+  const data = {
+    examCollectionState
+  }
+  return request({
+    url: '/sim/real-exam-collection/teacher/exam/close/' + examCollectionId,
+    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
 // 查询学生考试集合列表
-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({

+ 11 - 1
ruoyi-ui/src/views/login.vue

@@ -141,7 +141,17 @@ export default {
             Cookies.remove("password");
             Cookies.remove('rememberMe');
           }
-          this.$store.dispatch("Login", this.loginForm).then(() => {
+          console.log(this.loginForm)
+          console.log(this.loginForm.code)
+          console.log('this.loginForm.code')
+          this.$store.dispatch("Login", this.loginForm).then((res) => {
+            // console.log(res.username)
+            // console.log('res.username')
+            // console.log(res.code)
+            // console.log(this.loginForm)
+            // console.log('this.loginForm')
+            // console.log(this.redirect)
+            // console.log('this.redirect')
             this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
           }).catch(() => {
             this.loading = false;

+ 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() {

+ 59 - 46
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="-"
@@ -114,9 +114,9 @@
 
         <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="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" />
+          <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="3"
                 @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>
@@ -181,14 +181,22 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="考试名称" prop="examCollectionName">
-              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName"/>
+              <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  placeholder="请输入考试时长" maxlength="30" v-model="form.limitDuration"/>
+          <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"
@@ -197,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: 100%;">
-                <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>
 
@@ -398,13 +407,12 @@
 }
 </style>
 <script>
-import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet} from "@/api/sim/exam";
-import { listMajor  } from "@/api/sim/major";
+import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet,examTearcheropen,examTearcherclose} from "@/api/sim/exam";
 
 
 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: [],
@@ -633,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 }
       ],
@@ -847,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;
@@ -987,17 +995,22 @@ 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) {
+      console.log(row.examCollectionState);
+      let text = row.examCollectionState === "2" ? "开启" : "关闭";
+      this.$modal.confirm('确认要"' + text + '""' + row.examCollectionName + '"吗?').then(function() {
+        if(row.examCollectionState==2){
+          return examTearcherclose(row.examCollectionId,row.examCollectionState);
+        }else{
+          return examTearcheropen(row.examCollectionId,row.examCollectionState);
+        }
+      }).then(() => {
+        this.$modal.msgSuccess(text + "成功");
+      }).catch(function() {
+        row.status = row.status === "0" ? "1" : "0";
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;

+ 58 - 29
ruoyi-ui/src/views/peoples/student/index.vue

@@ -1,15 +1,42 @@
 <template>
   <div class="app-container">
     <el-row :gutter="20">
+      <!--组织数据-->
+      <el-col :span="4" :xs="24">
+        <div class="head-container">
+          <el-input
+            v-model="deptName"
+            placeholder="请输入组织名称"
+            clearable
+            size="small"
+            prefix-icon="el-icon-search"
+            style="margin-bottom: 20px"
+          />
+        </div>
+        <div class="head-container">
+          <el-tree
+            :data="deptOptions"
+            :props="defaultProps"
+            :expand-on-click-node="false"
+            :filter-node-method="filterNode"
+            ref="tree"
+            node-key="id"
+            default-expand-all
+            highlight-current
+            @node-click="handleNodeClick"
+          />
+        </div>
+      </el-col>
+
       <!--用户数据-->
-      <el-col :xs="24">
+      <el-col :span="20" :xs="24">
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
           <el-form-item label="学号" prop="UserName">
             <el-input
               v-model="queryParams.UserName"
               placeholder="请输入学号"
               clearable
-              style="width: 150px"
+              style="width: 240px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
@@ -19,12 +46,11 @@
               v-model="queryParams.nickName"
               placeholder="请输入姓名"
               clearable
-              style="width: 150px"
+              style="width: 240px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-
-          <el-form-item label="班级名称" prop="className">
+          <!-- <el-form-item label="班级名称" prop="className">
             <el-input
               v-model="queryParams.className"
               placeholder="请输入班级名称"
@@ -32,7 +58,7 @@
               style="width: 200px"
               @keyup.enter.native="handleQuery"
             />
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="状态" prop="status">
             <el-select
               v-model="queryParams.status"
@@ -106,7 +132,7 @@
           <el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" width="80"/>
           <el-table-column label="学号" align="center" key="userName" prop="userName" v-if="columns[1].visible" />
           <el-table-column label="姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" />
-          <el-table-column label="区队/班级" align="center" key="dept.deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="组织名称" align="center" key="dept.deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
           <el-table-column label="专业名称" align="center" key="major.majorName" prop="major.majorName" v-if="columns[4].visible" :show-overflow-tooltip="true" />
           <el-table-column label="备注" align="center" key="remark" prop="remark" v-if="columns[5].visible" :show-overflow-tooltip="true" />
           <el-table-column label="状态" align="center" key="status" v-if="columns[7].visible">
@@ -144,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>
@@ -189,16 +216,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="归属班级">
-              <el-select v-model="form.deptId" placeholder="请选择归属班级">
-                <el-option
-                  v-for="(item, index) in postOptions.slice(1)"
-                  :key="item.sysDept.deptId"
-                  :label="item.sysDept.deptName"
-                  :value="item.sysDept.deptId"
-                  :v-if="!hideFirstOption"
-                ></el-option>
-              </el-select>
+            <el-form-item label="归属组织" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属组织" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -234,15 +253,10 @@
 
 <script>
 import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
-import { resetUserPwd, changeUserStatus } from "@/api/system/user";
-
-
-import { listClassMajor } from "@/api/sim/teacher";
-
-
+import { getUser,resetUserPwd, changeUserStatus,deptTreeSelect } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css"
 
 export default {
   name: "Student",
@@ -266,6 +280,8 @@ export default {
       userList: null,
       // 弹出层标题
       title: "",
+      // 部门树选项
+      deptOptions: undefined,
       // 是否显示弹出层
       open: false,
       // 部门名称
@@ -299,8 +315,8 @@ export default {
         { 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: 3, label: `组织名称`, visible: true },
+        { key: 4, label: `专业`, visible: false },
         { key: 5, label: `备注`, visible: true },
         { key: 6, label: `创建时间`, visible: true },
         { key: 7, label: `状态`, visible: true }
@@ -330,7 +346,7 @@ export default {
   },
   created() {
     this.getList();
-    // this.getDeptTree();
+    this.getDeptTree();
     this.getConfigKey("sys.user.initPassword").then(response => {
       this.initPassword = response.msg;
     });
@@ -346,11 +362,22 @@ export default {
         }
       );
     },
+    /** 查询部门下拉树结构 */
+    getDeptTree() {
+      deptTreeSelect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
     // 筛选节点
     filterNode(value, data) {
       if (!value) return true;
       return data.label.indexOf(value) !== -1;
     },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.handleQuery();
+    },
     // 用户状态修改
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
@@ -371,6 +398,7 @@ export default {
     reset() {
       this.form = {
         userId: undefined,
+        deptId: undefined,
         userName: undefined,
         nickName: undefined,
         password: undefined,
@@ -390,6 +418,7 @@ export default {
       this.resetForm("queryForm");
       this.queryParams.deptId = undefined;
       this.$refs.tree.setCurrentKey(null);
+      this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -410,11 +439,11 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
-      listClassMajor().then(response => {
+      getUser().then(response => {
         this.postOptions = response;
         this.open = true;
         this.title = "添加学员";
-        // this.form.password = this.initPassword;
+        this.form.password = this.initPassword;
       });
     },
     /** 修改按钮操作 */

+ 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();
     },
     // 多选框选中数据

+ 11 - 7
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%;">
@@ -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;