ソースを参照

Merge remote-tracking branch 'origin/dev-web' into dev

tom 5 ヶ月 前
コミット
520fab5459

+ 66 - 0
ruoyi-ui/src/api/sim/exam.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
+
+
+// 老师考试相关 start
+// 查询老师考试集合列表
+export function examTearcherList(query) {
+    return request({
+      url: '/sim/real-exam-collection/list',
+      method: 'get',
+      params: query
+    })
+}
+// 查询老师考试集合详细信息
+export function examTearcherGet(examCollectionId) {
+    return request({
+      url: '/sim/real-exam-collection/' + parseStrEmpty(examCollectionId),
+      method: 'get'
+    })
+}
+// 新增老师考试集合
+export function examTearcheradd(data) {
+    return request({
+      url: '/sim/real-exam-collection',
+      method: 'post',
+      data: data
+    })
+}
+// 修改老师考试集合
+export function examTearcherupdate(data) {
+    return request({
+      url: '/sim/real-exam-collection',
+      method: 'put',
+      data: data
+    })
+}
+// 删除考试集合老师考试集合列表
+export function examTearcherdel(examCollectionIds) {
+    return request({
+        url: '/sim/real-exam-collection/' + examCollectionIds,
+        method: 'delete'
+    })
+}
+// 老师考试相关 end
+
+
+
+
+// 学生考试相关 start
+// 查询学生考试集合列表
+export function examStudentList(userId) {
+    return request({
+        url: '/sim/real-exam/student/listByUserId/' + parseStrEmpty(userId),
+        method: 'get'
+    })
+}
+
+// 学生获取考试详细信息
+export function examStudentGet(userId) {
+  return request({
+      url: '/sim/real-exam/student/' + parseStrEmpty(userId),
+      method: 'get'
+  })
+}
+
+// 学生考试相关 end

+ 18 - 29
ruoyi-ui/src/views/people/exam/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-row>
       <!--用户数据1-->
-        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
           <el-form-item label="考试名称" prop="userName">
             <el-input
               v-model="queryParams.userName"
@@ -53,8 +53,8 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
           </el-form-item>
         </el-form>
-        <!-- <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
+        <el-row :gutter="10" class="mb8">
+          <!-- <el-col :span="1.5">
             <el-button
               type="primary"
               plain
@@ -85,9 +85,9 @@
               @click="handleDelete"
               v-hasPermi="['simulator:user:remove']"
             >删除</el-button>
-          </el-col>
+          </el-col> -->
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
-        </el-row> -->
+        </el-row>
 
         <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="50" align="center" />
@@ -208,21 +208,19 @@
   } */
 </style>
 <script>
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
+import { listUser,getUserProfile} from "@/api/system/user";
+import { examStudentList,examStudentGet} from "@/api/sim/exam";
 import { getToken } from "@/utils/auth";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
-  // name: "Task",
+  name: "Exam",
   dicts: ['sim_equip_type'],
-  components: { Treeselect },
   data() {
     return {
+      user: {},
       multipleSelection: [],
-      selectedEquip: '',
-      selectedZjEquip: '',
-      
+      selectedEquip:'',
+      tableData:[],
       // 遮罩层
       loading: true,
       // 选中数组
@@ -261,21 +259,6 @@ export default {
         children: "children",
         label: "label"
       },
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/simulator/user/importData"
-      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -429,7 +412,13 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listUser(this.addDateRange(this.queryParams, this.dateRange)).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;

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

@@ -1,18 +1,18 @@
 <template>
   <div class="app-container">
     <el-row>
-      <!--用户数据1-->
+      <!--用户数据-->
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-          <el-form-item label="考试名称" prop="userName">
+          <el-form-item label="考试名称" prop="examCollectionName">
             <el-input
-              v-model="queryParams.userName"
+              v-model="queryParams.examCollectionName"
               placeholder="请输入考试名称"
               clearable
               style="width: 150px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="状态" prop="status">
+          <!-- <el-form-item label="状态" prop="status">
             <el-select
               v-model="queryParams.status"
               placeholder="用户状态"
@@ -26,7 +26,7 @@
                 :value="dict.value"
               />
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="考试时间">
             <el-date-picker
               v-model="dateRange"
@@ -38,15 +38,15 @@
               end-placeholder="结束日期"
             ></el-date-picker>
           </el-form-item>
-          <el-form-item label="模拟器类型" prop="userName">
+          <el-form-item label="模拟器类型" prop="simType">
             <el-select
-              v-model="queryParams.userName"
+              v-model="queryParams.simType"
               placeholder="模拟器类型"
               clearable
               style="width: 240px"
             >
               <el-option
-                v-for="dict in dict.type.sim_equip_type"
+                v-for="dict in dict.type.sim_sim_type"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
@@ -76,6 +76,7 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd"
+              
             >新增</el-button>
           </el-col>
           <el-col :span="1.5">
@@ -113,12 +114,21 @@
 
         <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="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="liexing" prop="liexing" v-if="columns[3].visible" :show-overflow-tooltip="true" />
-          <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="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" />
+          <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="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>
+            </template>
+          </el-table-column>
+          <el-table-column label="模拟器类型" align="center" key="simType" prop="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.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">
             <template slot-scope="scope">
               <el-switch
                 v-model="scope.row.status"
@@ -127,8 +137,8 @@
                 @change="handleStatusChange(scope.row)"
               ></el-switch>
             </template>
-          </el-table-column>
-          <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
+          </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>
             </template>
@@ -145,16 +155,13 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
-                v-hasPermi="['simulator:user:edit']"
               >修改</el-button>
               <el-button
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
                 @click="handleDelete(scope.row)"
-                v-hasPermi="['simulator:user:remove']"
               >删除</el-button>
-              
             </template>
           </el-table-column>
         </el-table>
@@ -170,44 +177,41 @@
 
     <!-- 添加或修改用户配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px" style="display: flex;">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" >
         <el-row>
-          <el-col :span="6" style="width: 20%;">
-            <el-form-item label="型号">
-              <el-select v-model="selectedEquip"  placeholder="请选择模拟器类型">
-                <el-option
-                  value="请选择"
-                >请选择</el-option>
-                <el-option
-                  v-for="dict in dict.type.sim_equip_type"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
+          <el-col :span="8">
+            <el-form-item label="考试名称" prop="examCollectionName">
+              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName"/>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
-            <el-form-item label="考试名称" prop="userName">
-              <el-input  placeholder="请输入考试名称" maxlength="30" />
+          <el-col :span="8">
+            <el-form-item label="考试时长" prop="limitDuration">
+              <el-input  placeholder="请输入考试时长" maxlength="30" v-model="form.limitDuration"/>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
-            <el-form-item label="考试时长" prop="userName">
-              <el-input  placeholder="请输入考试时长" maxlength="30" />
+          <el-col :span="8">
+            <el-form-item label="考试时间" prop="examTime">
+              <el-date-picker type="daterange" v-model="form.examTime" format="yyyy-MM-dd"
+                value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始时间" end-placeholder="结束时间"
+                range-separator="至" clearable></el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
-            <el-form-item label="日期范围" prop="field101">
-              <el-date-picker type="daterange" format="yyyy-MM-dd"
-                value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始日期" end-placeholder="结束日期"
-                range-separator="至" clearable></el-date-picker>
+          
+          <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-form-item>
           </el-col>
-
-          <el-col :span="6">
-            <el-form-item label="出题方式" prop="userName">
-              <el-select v-model="selectmethod"  placeholder="请选择出题方式">
+          <el-col :span="8">
+            <el-form-item label="出题方式" prop="questionSettingMethod"> 
+              <el-select  v-model="form.questionSettingMethod" placeholder="请选择出题方式" style="width: 100%;" @change="selectmethod">
                 <el-option
                   value="请选择"
                 >请选择</el-option>
@@ -220,7 +224,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-button type="primary" round @click="handleSelectType" v-show="isShow">自选考题编辑</el-button>
+          <el-button type="primary" round @click="handleSelectType" v-show="isShow" style="margin-left: 15px;">自选考题编辑</el-button>
         </el-row>
       </el-form>
 
@@ -310,7 +314,8 @@
 
 
       <div slot="footer" class="dialog-footer" style="margin-top: 10%;">
-        <el-button type="primary" @click="submitForm">添加考试</el-button>
+        <el-button type="primary" @click="submitForm" v-if="form.examCollectionId == undefined" >添加考试</el-button>
+        <el-button type="primary" @click="submitForm" v-if="form.examCollectionId != undefined" >确定考试</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -393,21 +398,18 @@
 }
 </style>
 <script>
-import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
+import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet} from "@/api/sim/exam";
 import { listMajor  } from "@/api/sim/major";
-import { getToken } from "@/utils/auth";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
 
 export default {
-  name: "Task",
-  dicts: ['sim_equip_type','sys_topic_way','sys_normal_disable'],
-  components: { Treeselect },
+  name: "Exam",
+  dicts: ['sim_sim_type','sys_topic_way','sys_normal_disable',],
   data() {
     return {
       multipleSelection: [],
       selectedEquip: '',
-      selectmethod:'',
+      // selectmethod:'',
       isShow:false,
       selectedZjEquip: '',
       tableData_tm: [
@@ -605,27 +607,16 @@ export default {
       roleOptions: [],
       // 表单参数
       form: {
-        field101: null,
+        simType:'',
+        questionSettingMethod:'',
+        examTime:[],
+        startTime:'',
+        endTime:'',
       },
       defaultProps: {
         children: "children",
         label: "label"
       },
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/simulator/user/importData"
-      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -639,26 +630,46 @@ 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: 5, label: `创建老师`, visible: true },
-        { key: 6, label: `创建时间`, visible: true }
+        { key: 2, label: `考试时长`, visible: true },
+        { key: 3, label: `考试时间`, visible: true },
+        { key: 4, label: `模拟器类型`, visible: true },
+        { key: 5, label: `考试状态`, visible: false },
+        { key: 6, label: `创建老师`, visible: true },
+        { key: 7, label: `创建时间`, visible: true }
       ],
       // 表单校验
       rules: {
+        examCollectionName: [
+          { required: true, 
+            message: "考试名称不能为空", 
+            trigger: "blur" },
+        ],
+        limitDuration:[
+          { required: true, 
+            message: "考试时长不能为空", 
+            trigger: "blur" },
+        ],
+        simType: [
+          { required: true, 
+            message: "模拟器型号不能为空", 
+            trigger: "change"}
+        ],
+
+        questionSettingMethod: [
+          { required: true, 
+            message: "出题方式不能为空", 
+            trigger: "change"}
+        ],
+        examTime:[{
+            required: true,
+            type: 'array',
+            message: '请选择考试时间',
+            trigger: 'change'
+        }],
       }
     };
   },
   watch: {
-    selectmethod(Value){
-      console.log('出题方式:'+Value)
-      if(Value==2){
-        this.isShow = true;
-      }else{
-        this.isShow = false;
-      }
-    },
     selectedEquip(newValue) {
       // console.log(newValue);
       // 根据newValue更新tableData
@@ -834,6 +845,14 @@ export default {
     });
   },
   methods: {
+    selectmethod(value){
+      console.log('出题方式:'+value)
+      if(value==2){
+        this.isShow = true;
+      }else{
+        this.isShow = false;
+      }
+    },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       // console.log(this.selectedEquip+'@@@')
       //第一列型号
@@ -931,10 +950,10 @@ export default {
     handleSelectionRow(val) {
       this.multipleSelection = val;
     },
-    /** 查询用户列表 */
+    /** 查询考试列表 */
     getList() {
       this.loading = true;
-      listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      examTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           //将返回值注释
           this.userList = response.rows;
           this.total = response.total;
@@ -969,16 +988,16 @@ export default {
       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.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";
+    //   });
+    // },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -989,17 +1008,18 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        userId: undefined,
-        deptId: undefined,
-        userName: undefined,
-        password: undefined,
-        phonenumber: undefined,
-        email: undefined,
-        sex: undefined,
-        status: "0",
-        remark: undefined,
-        postIds: [],
-        roleIds: []
+        examCollectionId: undefined,
+        examCollectionType:3,
+        // deptId: undefined,
+        // userName: undefined,
+        // password: undefined,
+        // phonenumber: undefined,
+        // email: undefined,
+        // sex: undefined,
+        // status: "0",
+        // remark: undefined,
+        // postIds: [],
+        // roleIds: []
       };
       this.resetForm("form");
     },
@@ -1012,13 +1032,13 @@ export default {
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
-      this.queryParams.deptId = undefined;
-      this.$refs.tree.setCurrentKey(null);
+      // this.queryParams.deptId = undefined;
+      // this.$refs.tree.setCurrentKey(null);
       this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.userId);
+      this.ids = selection.map(item => item.examCollectionId);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
@@ -1037,17 +1057,18 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const userId = row.userId || this.ids;
-      // getUser(userId).then(response => {
-        // this.form = response.data;
+      const examCollectionId = row.examCollectionId || this.ids;
+      examTearcherGet(examCollectionId).then(response => {
+        this.form = response.data;
+        this.form.examTime= [response.data.startTime,response.data.endTime];
         // this.postOptions = response.posts;
         // this.roleOptions = response.roles;
         // this.$set(this.form, "postIds", response.postIds);
         // this.$set(this.form, "roleIds", response.roleIds);
         this.open = true;
         this.title = "修改考试";
-        this.form.password = "";
-      // });
+        // this.form.password = "";
+      });
     },
 
     /** 当前考试查询 */
@@ -1072,14 +1093,20 @@ export default {
     submitForm: function() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.userId != undefined) {
-            updateUser(this.form).then(response => {
+          if(this.form.examTime){
+            const start_time = this.form.examTime[0];
+            const end_time = this.form.examTime[1];
+            this.form.startTime = start_time;
+            this.form.endTime = end_time;
+          }
+          if (this.form.examCollectionId != undefined) {
+            examTearcherupdate(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addUser(this.form).then(response => {
+            examTearcheradd(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -1088,11 +1115,13 @@ export default {
         }
       });
     },
+
+
     /** 删除按钮操作 */
     handleDelete(row) {
-      const userIds = row.userId || this.ids;
-      this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
-        return delUser(userIds);
+      const examCollectionIds = row.examCollectionId || this.ids;
+      this.$modal.confirm('是否确认删除编号为"' + examCollectionIds + '"的数据项?').then(function() {
+        return examTearcherdel(examCollectionIds);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 31 - 4
ruoyi-ui/src/views/peoples/student/index.vue

@@ -33,6 +33,21 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
+          <el-form-item label="状态" prop="status">
+            <el-select
+              v-model="queryParams.status"
+              placeholder="用户状态"
+              clearable
+              style="width: 240px"
+            >
+              <el-option
+                v-for="dict in dict.type.sys_normal_disable"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
           <el-form-item label="创建时间">
             <el-date-picker
               v-model="dateRange"
@@ -94,6 +109,17 @@
           <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">
+            <template slot-scope="scope">
+              <el-switch
+                v-model="scope.row.status"
+                active-value="0"
+                inactive-value="1"
+                @change="handleStatusChange(scope.row)"
+              ></el-switch>
+            </template>
+          </el-table-column>
+
           <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -169,13 +195,11 @@
                   v-for="(item, index) in postOptions.slice(1)"
                   :key="item.sysDept.deptId"
                   :label="item.sysDept.deptName"
-                  :value="item.sysDept.deptName"
+                  :value="item.sysDept.deptId"
                   :v-if="!hideFirstOption"
                 ></el-option>
               </el-select>
             </el-form-item>
-
-
           </el-col>
         </el-row>
         <el-row>
@@ -210,6 +234,8 @@
 
 <script>
 import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
+import { resetUserPwd, changeUserStatus } from "@/api/system/user";
+
 
 import { listClassMajor } from "@/api/sim/teacher";
 
@@ -276,7 +302,8 @@ export default {
         { key: 3, label: `班级名称`, visible: true },
         { key: 4, label: `专业`, visible: true },
         { key: 5, label: `备注`, visible: true },
-        { key: 6, label: `创建时间`, visible: true }
+        { key: 6, label: `创建时间`, visible: true },
+        { key: 7, label: `状态`, visible: true }
       ],
       // 表单校验
       rules: {

+ 80 - 73
ruoyi-ui/src/views/peoples/task/index.vue

@@ -134,7 +134,7 @@
                 icon="el-icon-delete"
                 @click="handleDelete(scope.row)"
               >删除</el-button>
-              
+
             </template>
           </el-table-column>
         </el-table>
@@ -154,7 +154,7 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="型号" prop="simType">
-              <el-select v-model="form.simType"  placeholder="请选择模拟器型号" @selection-change="selectedEquip">
+              <el-select v-model="form.simType"  placeholder="请选择模拟器型号" @change="selectSimType">
                 <el-option
                   v-for="dict in dict.type.sim_sim_type"
                   :key="dict.value"
@@ -174,10 +174,10 @@
             <el-button @click="toggleSelection()">取消选择</el-button>
           </div>
         </el-row>
-       
-        <el-table 
-          :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
-          :span-method="objectSpanMethod" 
+
+        <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"
@@ -209,7 +209,6 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="型号" prop="simType">
-              <!-- v-model="form.monitype" -->
               <el-select v-model="selectedEquip"  placeholder="请选择模拟器型号">
                 <el-option
                   value="请选择"
@@ -233,11 +232,11 @@
             <el-button @click="toggleSelection()">取消选择</el-button>
           </div>
         </el-row>
-        
-       
-        <el-table 
-          :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
-          :span-method="objectSpanMethod" 
+
+
+        <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"
@@ -463,7 +462,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-    
+
   </div>
 </template>
 <style>
@@ -475,7 +474,7 @@
   }
 </style>
 <script>
-import { listTask,simTypeTask,addTask } from "@/api/sim/task";
+import { listTask,simTypeTask,addTask,updateTask,delTask,getTask } from "@/api/sim/task";
 import { getToken } from "@/utils/auth";
 
 export default {
@@ -584,7 +583,7 @@ export default {
         //   xianxiang: '无法开机',
         //   name: '13.DC/DC',
         // },
-        
+
         // {
         //   ids:31,
         //   xinghao: '防化兵用毒剂报警器',
@@ -792,7 +791,7 @@ export default {
         name7:7,
         name8:7,
         name9:7,
-        name10:7, 
+        name10:7,
         value1:1,
         value2:1,
         value3:2,
@@ -1198,8 +1197,8 @@ export default {
         value9:1,
         value10:1,
       },
-      
-      
+
+
       {
         gzxx: '仪器无法开机',
         buwei: '1.FFC排线',
@@ -1562,7 +1561,7 @@ export default {
         value9:1,
         value10:2,
       },
-      
+
       ],
       // 遮罩层
       loading: true,
@@ -1796,7 +1795,7 @@ export default {
           name7:7,
           name8:7,
           name9:7,
-          name10:7, 
+          name10:7,
           value1:1,
           value2:1,
           value3:2,
@@ -2568,20 +2567,43 @@ export default {
   },
   created() {
     this.getList();
-    //this.getDeptTree();
-    this.getConfigKey("sys.user.initPassword").then(response => {
-      this.initPassword = response.msg;
-    });
   },
   methods: {
-
     // 选择型号,循环故障清单
-    selectedEquip(val) {
+    selectSimType(val){
       console.log(val);
       console.log('newValue');
-      // 根据newValue更新tableData
+      simTypeTask(val).then(response => {
+        console.log(response.data)
+        console.log('response')
+        // let jsonString = '';
+        // const obj = {};
+        // for (let i = 0; i < 6; i++) {
+        //   obj[i] = response.data.selectedData[i]['name'];
+        // }
+        // console.log(obj)
+        // jsonString = JSON.stringify(obj);
+
+        const arr = [];
+        arr['ids'] = 1;
+        arr['xinghao'] = 'FZD04B型侦毒器';
+        arr['xianxiang'] = '开机无响应';
+        arr['name'] = '1.电源开关';
+        console.log(arr);
+        console.log(JSON.stringify(arr));
+        this.tableData = arr;
+      });
+
+      // {
+        //   ids:1,
+        //   xinghao: 'FZD04B型侦毒器',
+        //   xianxiang: '开机无响应',
+        //   name: '1.电源开关',
+        // },
+
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      // console.log(this.selectedEquip+'@@@')
       //第一列型号
       if(columnIndex === 0) {
         if(this.selectedEquip==2){
@@ -2617,7 +2639,7 @@ export default {
             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 };
@@ -2629,7 +2651,7 @@ export default {
             return { rowspan: 1, colspan: 1 };
           }else{
             return { rowspan: 0, colspan: 0 };
-          } 
+          }
         }else{
           if(rowIndex<7 && rowIndex % 2 === 0){
             return { rowspan: 2, colspan: 1 };
@@ -2645,14 +2667,14 @@ export default {
             return { rowspan: 0, colspan: 0 };
           }
         }
-        
+
       }
       //故障部位 和 选择
       if(columnIndex === 2 || columnIndex === 3){
         //return { rowspan: 1, colspan: 1 };
       }
     },
-    
+
     objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
       //第二列故障现象
       if(columnIndex === 0) {
@@ -2707,22 +2729,6 @@ export default {
       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" ? "启用" : "停用";
-      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";
-      });
-    },
     //清除故障
     clearFaultChange(row,number,nametext){
       console.log()
@@ -2774,7 +2780,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.userId);
+      this.ids = selection.map(item => item.taskId);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
@@ -2800,7 +2806,7 @@ export default {
     },
     /* 故障设置自检 **/
     handleInspect() {
-      //this.reset();
+      this.reset();
       // getUser().then(response => {
         //this.postOptions = response.posts;
         //this.roleOptions = response.roles;
@@ -2812,23 +2818,23 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const userId = row.userId || this.ids;
-      getUser(userId).then(response => {
+      const taskId = row.taskId || this.ids;
+      getTask(taskId).then(response => {
         this.form = response.data;
-        this.postOptions = response.posts;
-        this.roleOptions = response.roles;
-        this.$set(this.form, "postIds", response.postIds);
-        this.$set(this.form, "roleIds", response.roleIds);
+        // this.postOptions = response.posts;
+        // this.roleOptions = response.roles;
+        // this.$set(this.form, "postIds", response.postIds);
+        // this.$set(this.form, "roleIds", response.roleIds);
         this.open = true;
-        this.title = "修改用户";
-        this.form.password = "";
+        this.title = "修改任务";
+        // this.form.password = "";
       });
     },
     /** 详情按钮操作 */
     handleView(row) {
       this.reset();
-      const userId = row.userId || this.ids;
-      getUser(userId).then(response => {
+      const taskId = row.taskId || this.ids;
+      getUser(taskId).then(response => {
         this.form = response.data;
         this.openview = true;
         this.title = "任务详情";
@@ -2839,7 +2845,7 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.taskId != undefined) {
-            updateUser(this.form).then(response => {
+            updateTask(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -2856,24 +2862,25 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const userIds = row.userId || this.ids;
-      this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
-        return delUser(userIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    //训练任务下发
-    handleIssued(row) {
-      const userIds = row.userId || this.ids;
-      this.$modal.confirm('是否确定编号为"' + userIds + '"的训练任务?').then(function() {
-        //return delUser(userIds);
+      const taskIds = row.taskId || this.ids;
+      this.$modal.confirm('是否确认删除编号为"' + taskIds + '"的数据项?').then(function() {
+        return delTask(taskIds);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
+    // //训练任务下发
+    // handleIssued(row) {
+    //   const userIds = row.userId || this.ids;
+    //   this.$modal.confirm('是否确定编号为"' + userIds + '"的训练任务?').then(function() {
+    //     //return delUser(userIds);
+    //   }).then(() => {
+    //     this.getList();
+    //     this.$modal.msgSuccess("删除成功");
+    //   }).catch(() => {});
+    // },
+
   }
 };
 </script>

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

@@ -225,6 +225,7 @@
 
 <script>
 import { listTeacher, getTeacher, delTeacher, addTeacher, updateTeacher } from "@/api/sim/teacher";
+import { resetUserPwd, changeUserStatus } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 
 export default {