瀏覽代碼

Merge branch 'dev-web' into dev

tom 5 月之前
父節點
當前提交
356501f148

+ 36 - 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,9 +41,44 @@ 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

+ 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;

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

+ 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;