瀏覽代碼

Merge branch 'dev-web' into dev

tom 5 月之前
父節點
當前提交
3c1588a11b

+ 18 - 0
ruoyi-ui/src/api/sim/fault.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 查询故障列表
+export function listFault(query) {
+  return request({
+    url: '/sim/fault/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询故障详细 
+export function getFault(majorId) {
+  return request({
+    url: '/sim/fault/listAllTreeViaSimType/' + majorId,
+    method: 'get'
+  })
+}

+ 15 - 1
ruoyi-ui/src/api/sim/student.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
 
 // 查询学生列表
 export function listStudent(query) {
@@ -12,7 +13,7 @@ export function listStudent(query) {
 // 查询学生详细
 export function getStudent(userId) {
   return request({
-    url: '/sim/student/' + userId,
+    url: '/sim/student/' + parseStrEmpty(userId),
     method: 'get'
   })
 }
@@ -42,3 +43,16 @@ export function delStudent(userId) {
     method: 'delete'
   })
 }
+
+// 学生密码重置
+export function resetStudentPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: '/sim/student/resetPwd',
+    method: 'put',
+    data: data
+  })
+}

+ 52 - 0
ruoyi-ui/src/api/sim/task.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
+
+// 查询任务列表
+export function listTask(query) {
+    return request({
+      url: '/sim/task/list',
+      method: 'get',
+      params: query
+    })
+  }
+  
+// 查询任务详细
+export function getTask(taskId) {
+    return request({
+      url: '/sim/task/' + parseStrEmpty(taskId),
+      method: 'get'
+    })
+  }
+  
+  // 新增任务
+  export function addTask(data) {
+    return request({
+      url: '/sim/task',
+      method: 'post',
+      data: data
+    })
+  }
+
+  // 修改任务
+export function updateTask(data) {
+    return request({
+      url: '/sim/task',
+      method: 'put',
+      data: data
+    })
+  }
+  
+  // 删除任务
+  export function delTask(taskId) {
+    return request({
+      url: '/sim/task/' + taskId,
+      method: 'delete'
+    })
+  }
+  // 获取空白的任务详细信息
+  export function simTypeTask(simType) {
+    return request({
+      url: '/sim/task/getInfoForAdd/' + simType,
+      method: 'get'
+    })
+  }

+ 9 - 0
ruoyi-ui/src/api/sim/teacher.js

@@ -9,6 +9,15 @@ export function listTeacher(query) {
   })
 }
 
+export function listClassMajor(query) {
+  return request({
+    url: '/sim/teacher/class-major/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询教师详细
 export function getTeacher(userId) {
   return request({

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

@@ -321,7 +321,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const majorIds = row.userId || this.ids;
+      const majorIds = row.majorId || this.ids;
       this.$modal.confirm('是否确认删除编号为"' + majorIds + '"的数据项?').then(function() {
         return delMajor(majorIds);
       }).then(() => {

+ 38 - 53
ruoyi-ui/src/views/peoples/student/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-row :gutter="20">
-      <!--用户数据1-->
+      <!--用户数据-->
       <el-col :xs="24">
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
           <el-form-item label="学号" prop="UserName">
@@ -24,7 +24,7 @@
             />
           </el-form-item>
 
-          <!-- <el-form-item label="班级名称" prop="className">
+          <el-form-item label="班级名称" prop="className">
             <el-input
               v-model="queryParams.className"
               placeholder="请输入班级名称"
@@ -33,16 +33,6 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="专业名称" prop="majorName">
-            <el-input
-              v-model="queryParams.userName"
-              placeholder="请输入专业名称"
-              clearable
-              style="width: 200px"
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item> -->
-        
           <el-form-item label="创建时间">
             <el-date-picker
               v-model="dateRange"
@@ -68,6 +58,7 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd"
+              v-hasPermi="['sim:student:add']"
             >新增</el-button>
           </el-col>
           <el-col :span="1.5">
@@ -78,6 +69,7 @@
               size="mini"
               :disabled="single"
               @click="handleUpdate"
+              v-hasPermi="['sim:student:edit']"
             >修改</el-button>
           </el-col>
           <el-col :span="1.5">
@@ -88,6 +80,7 @@
               size="mini"
               :disabled="multiple"
               @click="handleDelete"
+              v-hasPermi="['sim:student:remove']"
             >删除</el-button>
           </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
@@ -98,8 +91,8 @@
           <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" />
           <el-table-column label="姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" />
-          <el-table-column label="区队/班级" align="center" key="className" prop="className" v-if="columns[3].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="专业名称" align="center" key="majorName" prop="majorName" v-if="columns[4].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" prop="createTime" v-if="columns[6].visible" width="160">
             <template slot-scope="scope">
@@ -118,11 +111,13 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
+                v-hasPermi="['sim:student:edit']"
               >修改</el-button>
               <el-button
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
+                v-hasPermi="['sim:student:remove']"
               >删除</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>
@@ -149,6 +144,7 @@
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
+
           <el-col :span="12">
             <el-form-item v-if="form.userId == undefined" label="学号" prop="userName">
               <el-input v-model="form.userName" placeholder="请输入学号" maxlength="30" />
@@ -166,15 +162,24 @@
               <el-input v-model="form.nickName" placeholder="请输入姓名" maxlength="30" />
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="12">
-            <el-form-item label="手机号码" prop="phonenumber">
-              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
+          <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.deptName"
+                  :v-if="!hideFirstOption"
+                ></el-option>
+              </el-select>
             </el-form-item>
-          </el-col> 
-        </el-row>
 
-        <el-row>-->
-          <el-col :span="12">
+
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
             <el-form-item label="状态">
               <el-radio-group v-model="form.status">
                 <el-radio
@@ -186,25 +191,10 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-form-item label="角色">
-              <el-select v-model="form.roleIds" multiple placeholder="请选择角色">
-                <el-option
-                  v-for="item in roleOptions"
-                  :key="item.roleId"
-                  :label="item.roleName"
-                  :value="item.roleId"
-                  :disabled="item.status == 1"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row> -->
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注">
-              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
+              <el-input v-model="form.remark" type="textarea" placeholder="请输入备注"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -215,12 +205,15 @@
       </div>
     </el-dialog>
 
-    
   </div>
 </template>
 
 <script>
 import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
+
+import { listClassMajor } from "@/api/sim/teacher";
+
+
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -265,6 +258,7 @@ export default {
         children: "children",
         label: "label"
       },
+      hideFirstOption: true, // 控制是否隐藏第一个选项
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -279,8 +273,8 @@ export default {
         { key: 0, label: `编号`, visible: true },
         { key: 1, label: `编号`, visible: true },
         { key: 2, label: `姓名`, visible: true },
-        { key: 3, label: `班级名称`, visible: false },
-        { key: 4, label: `专业`, visible: false },
+        { key: 3, label: `班级名称`, visible: true },
+        { key: 4, label: `专业`, visible: true },
         { key: 5, label: `备注`, visible: true },
         { key: 6, label: `创建时间`, visible: true }
       ],
@@ -382,9 +376,6 @@ export default {
         case "handleResetPwd":
           this.handleResetPwd(row);
           break;
-        case "handleAuthRole":
-          this.handleAuthRole(row);
-          break;
         default:
           break;
       }
@@ -392,13 +383,12 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
-      // getUser().then(response => {
-        // this.postOptions = response.posts;
-        // this.roleOptions = response.roles;
+      listClassMajor().then(response => {
+        this.postOptions = response;
         this.open = true;
         this.title = "添加学员";
-        this.form.password = this.initPassword;
-      // });
+        // this.form.password = this.initPassword;
+      });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -434,11 +424,6 @@ export default {
           });
         }).catch(() => {});
     },
-    /** 分配角色操作 */
-    handleAuthRole: function(row) {
-      const userId = row.userId;
-      this.$router.push("/system/user-auth/role/" + userId);
-    },
     /** 提交按钮 */
     submitForm: function() {
       this.$refs["form"].validate(valid => {

+ 197 - 450
ruoyi-ui/src/views/peoples/task/index.vue

@@ -1,7 +1,7 @@
 <template>
   <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-item label="任务名称" prop="userName">
             <el-input
@@ -103,12 +103,12 @@
 
         <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="mingc" prop="mingc" v-if="columns[1].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="模拟器型号" align="center" key="mingc" prop="mingc" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="编号" align="center" key="taskId" prop="taskId" v-if="columns[0].visible" />
+          <el-table-column label="任务名称" align="center" key="name" prop="name" 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="xianxiang" prop="xianxiang" v-if="columns[3].visible" :show-overflow-tooltip="true" />
           <el-table-column label="故障部位数量" align="center" key="buwei" prop="buwei" v-if="columns[4].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="创建者" align="center" key="creater" prop="creater" v-if="columns[5].visible" :show-overflow-tooltip="true" />
+          <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="remark" prop="remark" v-if="columns[6].visible" :show-overflow-tooltip="true" />
           <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[7].visible" width="160">
             <template slot-scope="scope">
@@ -153,14 +153,10 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="型号">
-              <!-- v-model="form.monitype" -->
-              <el-select v-model="selectedEquip"  placeholder="请选择模拟器型号">
+            <el-form-item label="型号" prop="simType">
+              <el-select v-model="form.simType"  placeholder="请选择模拟器型号" @selection-change="selectedEquip">
                 <el-option
-                  value="请选择"
-                >请选择</el-option>
-                <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"
@@ -169,8 +165,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="任务名称" prop="userName">
-              <el-input  placeholder="请输入任务名称" maxlength="30" />
+            <el-form-item label="任务名称" prop="name">
+              <el-input  placeholder="请输入任务名称" v-model="form.name"/>
             </el-form-item>
           </el-col>
           <div style="text-align: right;">
@@ -178,7 +174,6 @@
             <el-button @click="toggleSelection()">取消选择</el-button>
           </div>
         </el-row>
-        
        
         <el-table 
           :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow" 
@@ -213,7 +208,7 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="型号">
+            <el-form-item label="型号" prop="simType">
               <!-- v-model="form.monitype" -->
               <el-select v-model="selectedEquip"  placeholder="请选择模拟器型号">
                 <el-option
@@ -268,8 +263,6 @@
       </div>
     </el-dialog>
 
-
-
     <!-- 故障设置自检 -->
     <el-dialog :title="title" :visible.sync="zijianopen" width="88%" append-to-body>
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -281,7 +274,7 @@
                   value="请选择"
                 >请选择</el-option>
                 <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"
@@ -482,178 +475,175 @@
   }
 </style>
 <script>
-import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
+import { listTask,simTypeTask,addTask } from "@/api/sim/task";
 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'],
-  components: { Treeselect },
+  dicts: ['sim_sim_type'],
   data() {
     return {
       multipleSelection: [],
       selectedEquip: '',
       selectedZjEquip: '',
       tableData: [
-        {
-          ids:1,
-          xinghao: 'FZD04B型侦毒器',
-          xianxiang: '开机无响应',
-          name: '1.电源开关',
-        },{
-          ids:2,
-          name: '2.DC/DC转换芯片',
-        },{
-          ids:3,
-          xianxiang: '开机后按抽气开关,微电机不工作',
-          name: '3.微电机',
-        },{
-          ids:4,
-          name: '4.Q2',
-        },{
-          ids:5,
-          xianxiang: '抽气流量不足',
-          name: '5.滤网',
-        },{
-          ids:6,
-          name: '6.调速电位器',
-        },{
-          ids:7,
-          xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
-          name: '7.加热指示灯',
-        },{
-          ids:8,
-          name: '8.热敏开关',
-        },
-        {
-          ids:9,
-          xianxiang: '不能正常工作',
-          name: '9.外壳及零件',
-        },{
-          ids:10,
-          xianxiang: '电压低',
-          name: '10.供电模块',
-        },{
-          ids:11,
-          xianxiang: '抽气指示灯不亮',
-          name: '11.抽气指示灯',
-        },
+        // {
+        //   ids:1,
+        //   xinghao: 'FZD04B型侦毒器',
+        //   xianxiang: '开机无响应',
+        //   name: '1.电源开关',
+        // },{
+        //   ids:2,
+        //   name: '2.DC/DC转换芯片',
+        // },{
+        //   ids:3,
+        //   xianxiang: '开机后按抽气开关,微电机不工作',
+        //   name: '3.微电机',
+        // },{
+        //   ids:4,
+        //   name: '4.Q2',
+        // },{
+        //   ids:5,
+        //   xianxiang: '抽气流量不足',
+        //   name: '5.滤网',
+        // },{
+        //   ids:6,
+        //   name: '6.调速电位器',
+        // },{
+        //   ids:7,
+        //   xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
+        //   name: '7.加热指示灯',
+        // },{
+        //   ids:8,
+        //   name: '8.热敏开关',
+        // },
+        // {
+        //   ids:9,
+        //   xianxiang: '不能正常工作',
+        //   name: '9.外壳及零件',
+        // },{
+        //   ids:10,
+        //   xianxiang: '电压低',
+        //   name: '10.供电模块',
+        // },{
+        //   ids:11,
+        //   xianxiang: '抽气指示灯不亮',
+        //   name: '11.抽气指示灯',
+        // },
 
-        {
-          ids:21,
-          xinghao:'FZB006型毒剂报警器',
-          xianxiang: '仪器无法开机',
-          name: '1.薄膜开关FPC排线',
-        },{
-          ids:22,
-          name: '2.主控板开机电路',
-        },
-        {
-          ids:23,
-          xianxiang: '蜂鸣器自检时,声音异常',
-          name: '3.蜂鸣器出声口',
-        },{
-          ids:24,
-          name: '4.接口接线板',
-        },{
-          ids:25,
-          xianxiang: '仪器进入检测界面后,通入检测剂不报警',
-          name: '5.检测剂',
-        },{
-          ids:26,
-          name: '6.主控板信号采集电路',
-        },
-        {
-          ids:27,
-          xianxiang: '显示屏无显示',
-          name: '7.主控板显示屏供电电路',
-        },{
-          ids:28,
-          name: '8.显示屏',
-        },
-        {
-          ids:29,
-          xianxiang: '长时间不进入“检测中”',
-          name: '9.干燥管',
-        },{
-          ids:210,
-          name: '10.维护管',
-        },
-        {
-          ids:211,
-          xianxiang: '不能正常工作',
-          name: '11.外壳及零件',
-        },{
-          ids:212,
-          xianxiang: '电压低',
-          name: '12.供电模块',
-        },{
-          ids:213,
-          xianxiang: '无法开机',
-          name: '13.DC/DC',
-        },
+        // {
+        //   ids:21,
+        //   xinghao:'FZB006型毒剂报警器',
+        //   xianxiang: '仪器无法开机',
+        //   name: '1.薄膜开关FPC排线',
+        // },{
+        //   ids:22,
+        //   name: '2.主控板开机电路',
+        // },
+        // {
+        //   ids:23,
+        //   xianxiang: '蜂鸣器自检时,声音异常',
+        //   name: '3.蜂鸣器出声口',
+        // },{
+        //   ids:24,
+        //   name: '4.接口接线板',
+        // },{
+        //   ids:25,
+        //   xianxiang: '仪器进入检测界面后,通入检测剂不报警',
+        //   name: '5.检测剂',
+        // },{
+        //   ids:26,
+        //   name: '6.主控板信号采集电路',
+        // },
+        // {
+        //   ids:27,
+        //   xianxiang: '显示屏无显示',
+        //   name: '7.主控板显示屏供电电路',
+        // },{
+        //   ids:28,
+        //   name: '8.显示屏',
+        // },
+        // {
+        //   ids:29,
+        //   xianxiang: '长时间不进入“检测中”',
+        //   name: '9.干燥管',
+        // },{
+        //   ids:210,
+        //   name: '10.维护管',
+        // },
+        // {
+        //   ids:211,
+        //   xianxiang: '不能正常工作',
+        //   name: '11.外壳及零件',
+        // },{
+        //   ids:212,
+        //   xianxiang: '电压低',
+        //   name: '12.供电模块',
+        // },{
+        //   ids:213,
+        //   xianxiang: '无法开机',
+        //   name: '13.DC/DC',
+        // },
         
-        {
-          ids:31,
-          xinghao: '防化兵用毒剂报警器',
-          xianxiang: '仪器无法开机',
-          name: '1.FFC排线',
-        },{
-          ids:32,
-          name: '2.汇总主控板',
-        },{
-          ids:33,
-          xianxiang: '开机后,显示屏无显示',
-          name: '3.显控报警板',
-        },{
-          ids:34,
-          name: '4.显示屏',
-        },{
-          ids:35,
-          xianxiang: '检测状态下模拟剂不报警',
-          name: '5.汇总主控板信号采集电路',
-        },{
-          ids:36,
-          name: '6.检测剂',
-        },{
-          ids:37,
-          xianxiang: '长时间不能进入检测状态',
-          name: '7.干燥管',
-        },{
-          ids:38,
-          name: '8.维护管',
-        },{
-          ids:39,
-          xianxiang: '固液检测/气体检测模式切换失败',
-          name: '9.固液检测单元与主控板连接线',
-        },{
-          ids:310,
-          name: '10.汇总主控板固液通信电路',
-        },{
-          ids:311,
-          name: '11.切换按键',
-        },{
-          ids:312,
-          xianxiang: '有毒有害气体检测模块不报警',
-          name: '12.高压驱动板与汇总主控板连接线',
-        },{
-          ids:313,
-          name: '13.汇总主控板毒害模块通信电路',
-        },{
-          ids:314,
-          xianxiang: '不能正常工作',
-          name: '14.外壳及零件',
-        },{
-          ids:315,
-          xianxiang: '电压低',
-          name: '15.供电模块',
-        },{
-          ids:316,
-          xianxiang: '无法开机',
-          name: '16.DC/DC',
-        },
+        // {
+        //   ids:31,
+        //   xinghao: '防化兵用毒剂报警器',
+        //   xianxiang: '仪器无法开机',
+        //   name: '1.FFC排线',
+        // },{
+        //   ids:32,
+        //   name: '2.汇总主控板',
+        // },{
+        //   ids:33,
+        //   xianxiang: '开机后,显示屏无显示',
+        //   name: '3.显控报警板',
+        // },{
+        //   ids:34,
+        //   name: '4.显示屏',
+        // },{
+        //   ids:35,
+        //   xianxiang: '检测状态下模拟剂不报警',
+        //   name: '5.汇总主控板信号采集电路',
+        // },{
+        //   ids:36,
+        //   name: '6.检测剂',
+        // },{
+        //   ids:37,
+        //   xianxiang: '长时间不能进入检测状态',
+        //   name: '7.干燥管',
+        // },{
+        //   ids:38,
+        //   name: '8.维护管',
+        // },{
+        //   ids:39,
+        //   xianxiang: '固液检测/气体检测模式切换失败',
+        //   name: '9.固液检测单元与主控板连接线',
+        // },{
+        //   ids:310,
+        //   name: '10.汇总主控板固液通信电路',
+        // },{
+        //   ids:311,
+        //   name: '11.切换按键',
+        // },{
+        //   ids:312,
+        //   xianxiang: '有毒有害气体检测模块不报警',
+        //   name: '12.高压驱动板与汇总主控板连接线',
+        // },{
+        //   ids:313,
+        //   name: '13.汇总主控板毒害模块通信电路',
+        // },{
+        //   ids:314,
+        //   xianxiang: '不能正常工作',
+        //   name: '14.外壳及零件',
+        // },{
+        //   ids:315,
+        //   xianxiang: '电压低',
+        //   name: '15.供电模块',
+        // },{
+        //   ids:316,
+        //   xianxiang: '无法开机',
+        //   name: '16.DC/DC',
+        // },
       ],
       tableData1: [{
         gzxx: '开机无响应',
@@ -1609,26 +1599,13 @@ export default {
       // 角色选项
       roleOptions: [],
       // 表单参数
-      form: {},
+      form: {
+        simType:''
+      },
       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,
@@ -1651,6 +1628,13 @@ export default {
       ],
       // 表单校验
       rules: {
+        name: [
+          { required: true, message: "任务名称不能为空", trigger: "blur" },
+        ],
+        simType: [
+          { required: true, message: "模拟器型号不能为空", trigger: "change"}
+        ],
+
       }
     };
   },
@@ -1659,172 +1643,6 @@ export default {
     deptName(val) {
       this.$refs.tree.filter(val);
     },
-    selectedEquip(newValue) {
-      // console.log(newValue);
-      // 根据newValue更新tableData
-      // this.tableData = this.getNewTableData(newValue);
-      // console.log(this.getNewTableData(newValue);
-      if(newValue == 1){
-        this.tableData = [{
-          ids:1,
-          xinghao: 'FZD04B型侦毒器',
-          xianxiang: '开机无响应',
-          name: '1.电源开关',
-        },{
-          ids:2,
-          name: '2.DC/DC转换芯片',
-        },{
-          ids:3,
-          xianxiang: '开机后按抽气开关,微电机不工作',
-          name: '3.微电机',
-        },{
-          ids:4,
-          name: '4.Q2',
-        },{
-          ids:5,
-          xianxiang: '抽气流量不足',
-          name: '5.滤网',
-        },{
-          ids:6,
-          name: '6.调速电位器',
-        },{
-          ids:7,
-          xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
-          name: '7.加热指示灯',
-        },{
-          ids:8,
-          name: '8.热敏开关',
-        },
-        {
-          ids:9,
-          xianxiang: '不能正常工作',
-          name: '9.外壳及零件',
-        },{
-          ids:10,
-          xianxiang: '电压低',
-          name: '10.供电模块',
-        },{
-          ids:11,
-          xianxiang: '抽气指示灯不亮',
-          name: '11.抽气指示灯',
-        }];
-      }else if(newValue == 2){
-        this.tableData = [{
-          ids:21,
-          xinghao:'FZB006型毒剂报警器',
-          xianxiang: '仪器无法开机',
-          name: '1.薄膜开关FPC排线',
-        },{
-          ids:22,
-          name: '2.主控板开机电路',
-        },
-        {
-          ids:23,
-          xianxiang: '蜂鸣器自检时,声音异常',
-          name: '3.蜂鸣器出声口',
-        },{
-          ids:24,
-          name: '4.接口接线板',
-        },{
-          ids:25,
-          xianxiang: '仪器进入检测界面后,通入检测剂不报警',
-          name: '5.检测剂',
-        },{
-          ids:26,
-          name: '6.主控板信号采集电路',
-        },
-        {
-          ids:27,
-          xianxiang: '显示屏无显示',
-          name: '7.主控板显示屏供电电路',
-        },{
-          ids:28,
-          name: '8.显示屏',
-        },
-        {
-          ids:29,
-          xianxiang: '长时间不进入“检测中”',
-          name: '9.干燥管',
-        },{
-          ids:210,
-          name: '10.维护管',
-        },
-        {
-          ids:211,
-          xianxiang: '不能正常工作',
-          name: '11.外壳及零件',
-        },{
-          ids:212,
-          xianxiang: '电压低',
-          name: '12.供电模块',
-        },{
-          ids:213,
-          xianxiang: '无法开机',
-          name: '13.DC/DC',
-        }]
-      }else if(newValue == 3){
-        this.tableData = [{
-          ids:31,
-          xinghao: '防化兵用毒剂报警器',
-          xianxiang: '仪器无法开机',
-          name: '1.FFC排线',
-        },{
-          ids:32,
-          name: '2.汇总主控板',
-        },{
-          ids:33,
-          xianxiang: '开机后,显示屏无显示',
-          name: '3.显控报警板',
-        },{
-          ids:34,
-          name: '4.显示屏',
-        },{
-          ids:35,
-          xianxiang: '检测状态下模拟剂不报警',
-          name: '5.汇总主控板信号采集电路',
-        },{
-          ids:36,
-          name: '6.检测剂',
-        },{
-          ids:37,
-          xianxiang: '长时间不能进入检测状态',
-          name: '7.干燥管',
-        },{
-          ids:38,
-          name: '8.维护管',
-        },{
-          ids:39,
-          xianxiang: '固液检测/气体检测模式切换失败',
-          name: '9.固液检测单元与主控板连接线',
-        },{
-          ids:310,
-          name: '10.汇总主控板固液通信电路',
-        },{
-          ids:311,
-          name: '11.切换按键',
-        },{
-          ids:312,
-          xianxiang: '有毒有害气体检测模块不报警',
-          name: '12.高压驱动板与汇总主控板连接线',
-        },{
-          ids:313,
-          name: '13.汇总主控板毒害模块通信电路',
-        },{
-          ids:314,
-          xianxiang: '不能正常工作',
-          name: '14.外壳及零件',
-        },{
-          ids:315,
-          xianxiang: '电压低',
-          name: '15.供电模块',
-        },{
-          ids:316,
-          xianxiang: '无法开机',
-          name: '16.DC/DC',
-        }]
-      }
-
-    },
     selectedZjEquip(newValue) {
       // console.log(newValue);
       // 根据newValue更新tableData
@@ -2756,8 +2574,14 @@ export default {
     });
   },
   methods: {
+
+    // 选择型号,循环故障清单
+    selectedEquip(val) {
+      console.log(val);
+      console.log('newValue');
+      // 根据newValue更新tableData
+    },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      // console.log(this.selectedEquip+'@@@')
       //第一列型号
       if(columnIndex === 0) {
         if(this.selectedEquip==2){
@@ -2847,13 +2671,6 @@ export default {
         }
       }
     },
-    // 根据选择的option获取新的数据
-    // getNewTableData(option) {
-    //   // 逻辑处理返回新的数据数组
-    //   return [
-    //     // ...新数据
-    //   ];
-    // },
     toggleSelection(rows) {
       if (rows) {
         rows.forEach(row => {
@@ -2871,7 +2688,7 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      listTask(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           //将返回值注释
           this.userList = response.rows;
           this.total = response.total;
@@ -2934,18 +2751,11 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        userId: undefined,
-        deptId: undefined,
-        userName: undefined,
-        nickName: undefined,
-        password: undefined,
-        phonenumber: undefined,
-        email: undefined,
-        sex: undefined,
-        status: "0",
-        remark: undefined,
-        postIds: [],
-        roleIds: []
+        taskId: undefined,
+        name: undefined,
+        simType:undefined,
+        // postIds: [],
+        // roleIds: []
       };
       this.resetForm("form");
     },
@@ -2983,15 +2793,10 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-
+      // this.$tab.openPage("用户管理", "/system/user");
       this.reset();
-      // getUser().then(response => {
-        // this.postOptions = response.posts;
-        // this.roleOptions = response.roles;
-        this.open = true;
-        this.title = "新增训练任务";
-        this.form.password = this.initPassword;
-      // });
+      this.open = true;
+      this.title = "新增训练任务";
     },
     /* 故障设置自检 **/
     handleInspect() {
@@ -3029,43 +2834,18 @@ export default {
         this.title = "任务详情";
       });
     },
-
-    /** 重置密码按钮操作 */
-    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(() => {});
-    },
-    /** 分配角色操作 */
-    handleAuthRole: function(row) {
-      const userId = row.userId;
-      this.$router.push("/simulator/user-auth/role/" + userId);
-    },
     /** 提交按钮 */
     submitForm: function() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.userId != undefined) {
+          if (this.form.taskId != undefined) {
             updateUser(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addUser(this.form).then(response => {
+            addTask(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -3094,39 +2874,6 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
-
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('simulator/user/export', {
-        ...this.queryParams
-      }, `user_${new Date().getTime()}.xlsx`)
-    },
-    /** 导入按钮操作 */
-    handleImport() {
-      this.upload.title = "用户导入";
-      this.upload.open = true;
-    },
-    /** 下载模板操作 */
-    importTemplate() {
-      this.download('simulator/user/importTemplate', {
-      }, `user_template_${new Date().getTime()}.xlsx`)
-    },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload.open = false;
-      this.upload.isUploading = false;
-      this.$refs.upload.clearFiles();
-      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
-      this.getList();
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
-    }
   }
 };
 </script>

+ 1 - 1
ruoyi-ui/src/views/system/user/index.vue

@@ -269,7 +269,7 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="岗位">
-              <el-select v-model="form.postIds" multiple placeholder="请选择岗位">
+              <el-select v-model="form.postIds" placeholder="请选择岗位">
                 <el-option
                   v-for="item in postOptions"
                   :key="item.postId"

+ 5 - 1
ruoyi-ui/src/views/system/user/profile/index.vue

@@ -12,10 +12,14 @@
             </div>
             <ul class="list-group list-group-striped">
               <li class="list-group-item">
-                <svg-icon icon-class="user" />用户名称
+                <svg-icon icon-class="user" />账号
                 <div class="pull-right">{{ user.userName }}</div>
               </li>
               <li class="list-group-item">
+                <svg-icon icon-class="user" />用户名称
+                <div class="pull-right">{{ user.nickName }}</div>
+              </li>
+              <li class="list-group-item">
                 <svg-icon icon-class="phone" />手机号码
                 <div class="pull-right">{{ user.phonenumber }}</div>
               </li>

+ 0 - 117
ruoyi-ui/src/views/teacher/authRole.vue

@@ -1,117 +0,0 @@
-<template>
-  <div class="app-container">
-    <h4 class="form-header h4">基本信息</h4>
-    <el-form ref="form" :model="form" label-width="80px">
-      <el-row>
-        <el-col :span="8" :offset="2">
-          <el-form-item label="用户昵称" prop="nickName">
-            <el-input v-model="form.nickName" disabled />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8" :offset="2">
-          <el-form-item label="登录账号" prop="userName">
-            <el-input  v-model="form.userName" disabled />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-
-    <h4 class="form-header h4">角色信息</h4>
-    <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
-      <el-table-column label="序号" type="index" align="center">
-        <template slot-scope="scope">
-          <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
-      <el-table-column label="角色编号" align="center" prop="roleId" />
-      <el-table-column label="角色名称" align="center" prop="roleName" />
-      <el-table-column label="权限字符" align="center" prop="roleKey" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
-
-    <el-form label-width="100px">
-      <el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;">
-        <el-button type="primary" @click="submitForm()">提交</el-button>
-        <el-button @click="close()">返回</el-button>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-import { getAuthRole, updateAuthRole } from "@/api/system/user";
-
-export default {
-  name: "AuthRole",
-  data() {
-    return {
-       // 遮罩层
-      loading: true,
-      // 分页信息
-      total: 0,
-      pageNum: 1,
-      pageSize: 10,
-      // 选中角色编号
-      roleIds:[],
-      // 角色信息
-      roles: [],
-      // 用户信息
-      form: {}
-    };
-  },
-  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;
-      });
-    }
-  },
-  methods: {
-    /** 单击选中行数据 */
-    clickRow(row) {
-      this.$refs.table.toggleRowSelection(row);
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.roleIds = selection.map((item) => item.roleId);
-    },
-    // 保存选中的数据编号
-    getRowKey(row) {
-      return row.roleId;
-    },
-    /** 提交按钮 */
-    submitForm() {
-      const userId = this.form.userId;
-      const roleIds = this.roleIds.join(",");
-      updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
-        this.$modal.msgSuccess("授权成功");
-        this.close();
-      });
-    },
-    /** 关闭按钮 */
-    close() {
-      const obj = { path: "/system/user" };
-      this.$tab.closeOpenPage(obj);
-    },
-  },
-};
-</script>

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

@@ -206,21 +206,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-form-item label="角色">
-              <el-select v-model="form.roleIds" multiple placeholder="请选择角色">
-                <el-option
-                  v-for="item in roleOptions"
-                  :key="item.roleId"
-                  :label="item.roleName"
-                  :value="item.roleId"
-                  :disabled="item.status == 1"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row> -->
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注">
@@ -241,13 +226,10 @@
 <script>
 import { listTeacher, getTeacher, delTeacher, addTeacher, updateTeacher } from "@/api/sim/teacher";
 import { getToken } from "@/utils/auth";
-// import Treeselect from "@riophae/vue-treeselect";
-// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Teacher",
   dicts: ['sys_normal_disable', 'sys_user_sex'],
-  // components: { Treeselect },
   data() {
     return {
       // 遮罩层
@@ -343,14 +325,9 @@ export default {
     };
   },
   watch: {
-    // 根据名称筛选部门树
-    // deptName(val) {
-    //   this.$refs.tree.filter(val);
-    // }
   },
   created() {
     this.getList();
-    // this.getDeptTree();
     this.getConfigKey("sys.user.initPassword").then(response => {
       this.initPassword = response.msg;
     });
@@ -473,11 +450,6 @@ export default {
           });
         }).catch(() => {});
     },
-    /** 分配角色操作 */
-    handleAuthRole: function(row) {
-      const userId = row.userId;
-      this.$router.push("/system/user-auth/role/" + userId);
-    },
     /** 提交按钮 */
     submitForm: function() {
       this.$refs["form"].validate(valid => {

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

@@ -1,91 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-row :gutter="20">
-      <el-col :span="6" :xs="24">
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <span>个人信息</span>
-          </div>
-          <div>
-            <div class="text-center">
-              <userAvatar />
-            </div>
-            <ul class="list-group list-group-striped">
-              <li class="list-group-item">
-                <svg-icon icon-class="user" />用户名称
-                <div class="pull-right">{{ user.userName }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="phone" />手机号码
-                <div class="pull-right">{{ user.phonenumber }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="email" />用户邮箱
-                <div class="pull-right">{{ user.email }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="tree" />所属部门
-                <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="peoples" />所属角色
-                <div class="pull-right">{{ roleGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="date" />创建日期
-                <div class="pull-right">{{ user.createTime }}</div>
-              </li>
-            </ul>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18" :xs="24">
-        <el-card>
-          <div slot="header" class="clearfix">
-            <span>基本资料</span>
-          </div>
-          <el-tabs v-model="activeTab">
-            <el-tab-pane label="基本资料" name="userinfo">
-              <userInfo :user="user" />
-            </el-tab-pane>
-            <el-tab-pane label="修改密码" name="resetPwd">
-              <resetPwd />
-            </el-tab-pane>
-          </el-tabs>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import userAvatar from "./userAvatar";
-import userInfo from "./userInfo";
-import resetPwd from "./resetPwd";
-import { getUserProfile } from "@/api/system/user";
-
-export default {
-  name: "Profile",
-  components: { userAvatar, userInfo, resetPwd },
-  data() {
-    return {
-      user: {},
-      roleGroup: {},
-      postGroup: {},
-      activeTab: "userinfo"
-    };
-  },
-  created() {
-    this.getUser();
-  },
-  methods: {
-    getUser() {
-      getUserProfile().then(response => {
-        this.user = response.data;
-        this.roleGroup = response.roleGroup;
-        this.postGroup = response.postGroup;
-      });
-    }
-  }
-};
-</script>

+ 0 - 69
ruoyi-ui/src/views/teacher/profile/resetPwd.vue

@@ -1,69 +0,0 @@
-<template>
-  <el-form ref="form" :model="user" :rules="rules" label-width="80px">
-    <el-form-item label="旧密码" prop="oldPassword">
-      <el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item label="新密码" prop="newPassword">
-      <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item label="确认密码" prop="confirmPassword">
-      <el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserPwd } from "@/api/system/user";
-
-export default {
-  data() {
-    const equalToPassword = (rule, value, callback) => {
-      if (this.user.newPassword !== value) {
-        callback(new Error("两次输入的密码不一致"));
-      } else {
-        callback();
-      }
-    };
-    return {
-      user: {
-        oldPassword: undefined,
-        newPassword: undefined,
-        confirmPassword: undefined
-      },
-      // 表单校验
-      rules: {
-        oldPassword: [
-          { required: true, message: "旧密码不能为空", trigger: "blur" }
-        ],
-        newPassword: [
-          { required: true, message: "新密码不能为空", trigger: "blur" },
-          { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" },
-          { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
-        ],
-        confirmPassword: [
-          { required: true, message: "确认密码不能为空", trigger: "blur" },
-          { required: true, validator: equalToPassword, trigger: "blur" }
-        ]
-      }
-    };
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
-            this.$modal.msgSuccess("修改成功");
-          });
-        }
-      });
-    },
-    close() {
-      this.$tab.closePage();
-    }
-  }
-};
-</script>

+ 0 - 184
ruoyi-ui/src/views/teacher/profile/userAvatar.vue

@@ -1,184 +0,0 @@
-<template>
-  <div>
-    <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
-    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"  @close="closeDialog">
-      <el-row>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <vue-cropper
-            ref="cropper"
-            :img="options.img"
-            :info="true"
-            :autoCrop="options.autoCrop"
-            :autoCropWidth="options.autoCropWidth"
-            :autoCropHeight="options.autoCropHeight"
-            :fixedBox="options.fixedBox"
-            :outputType="options.outputType"
-            @realTime="realTime"
-            v-if="visible"
-          />
-        </el-col>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <div class="avatar-upload-preview">
-            <img :src="previews.url" :style="previews.img" />
-          </div>
-        </el-col>
-      </el-row>
-      <br />
-      <el-row>
-        <el-col :lg="2" :sm="3" :xs="3">
-          <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
-            <el-button size="small">
-              选择
-              <i class="el-icon-upload el-icon--right"></i>
-            </el-button>
-          </el-upload>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 2}" :sm="2" :xs="2">
-          <el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2">
-          <el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2">
-          <el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2">
-          <el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 2, offset: 6}" :sm="2" :xs="2">
-          <el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
-        </el-col>
-      </el-row>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import store from "@/store";
-import { VueCropper } from "vue-cropper";
-import { uploadAvatar } from "@/api/system/user";
-import { debounce } from '@/utils'
-
-export default {
-  components: { VueCropper },
-  data() {
-    return {
-      // 是否显示弹出层
-      open: false,
-      // 是否显示cropper
-      visible: false,
-      // 弹出层标题
-      title: "修改头像",
-      options: {
-        img: store.getters.avatar,  //裁剪图片的地址
-        autoCrop: true,             // 是否默认生成截图框
-        autoCropWidth: 200,         // 默认生成截图框宽度
-        autoCropHeight: 200,        // 默认生成截图框高度
-        fixedBox: true,             // 固定截图框大小 不允许改变
-        outputType:"png",           // 默认生成截图为PNG格式
-        filename: 'avatar'          // 文件名称
-      },
-      previews: {},
-      resizeHandler: null
-    };
-  },
-  methods: {
-    // 编辑头像
-    editCropper() {
-      this.open = true;
-    },
-    // 打开弹出层结束时的回调
-    modalOpened() {
-      this.visible = true;
-      if (!this.resizeHandler) {
-        this.resizeHandler = debounce(() => {
-          this.refresh()
-        }, 100)
-      }
-      window.addEventListener("resize", this.resizeHandler)
-    },
-    // 刷新组件
-    refresh() {
-      this.$refs.cropper.refresh();
-    },
-    // 覆盖默认的上传行为
-    requestUpload() {
-    },
-    // 向左旋转
-    rotateLeft() {
-      this.$refs.cropper.rotateLeft();
-    },
-    // 向右旋转
-    rotateRight() {
-      this.$refs.cropper.rotateRight();
-    },
-    // 图片缩放
-    changeScale(num) {
-      num = num || 1;
-      this.$refs.cropper.changeScale(num);
-    },
-    // 上传预处理
-    beforeUpload(file) {
-      if (file.type.indexOf("image/") == -1) {
-        this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
-      } else {
-        const reader = new FileReader();
-        reader.readAsDataURL(file);
-        reader.onload = () => {
-          this.options.img = reader.result;
-          this.options.filename = file.name;
-        };
-      }
-    },
-    // 上传图片
-    uploadImg() {
-      this.$refs.cropper.getCropBlob(data => {
-        let formData = new FormData();
-        formData.append("avatarfile", data, this.options.filename);
-        uploadAvatar(formData).then(response => {
-          this.open = false;
-          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
-          store.commit('SET_AVATAR', this.options.img);
-          this.$modal.msgSuccess("修改成功");
-          this.visible = false;
-        });
-      });
-    },
-    // 实时预览
-    realTime(data) {
-      this.previews = data;
-    },
-    // 关闭窗口
-    closeDialog() {
-      this.options.img = store.getters.avatar
-      this.visible = false;
-      window.removeEventListener("resize", this.resizeHandler)
-    }
-  }
-};
-</script>
-<style scoped lang="scss">
-.user-info-head {
-  position: relative;
-  display: inline-block;
-  height: 120px;
-}
-
-.user-info-head:hover:after {
-  content: '+';
-  position: absolute;
-  left: 0;
-  right: 0;
-  top: 0;
-  bottom: 0;
-  color: #eee;
-  background: rgba(0, 0, 0, 0.5);
-  font-size: 24px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  cursor: pointer;
-  line-height: 110px;
-  border-radius: 50%;
-}
-</style>

+ 0 - 88
ruoyi-ui/src/views/teacher/profile/userInfo.vue

@@ -1,88 +0,0 @@
-<template>
-  <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-    <el-form-item label="用户昵称" prop="nickName">
-      <el-input v-model="form.nickName" maxlength="30" />
-    </el-form-item> 
-    <el-form-item label="手机号码" prop="phonenumber">
-      <el-input v-model="form.phonenumber" maxlength="11" />
-    </el-form-item>
-    <el-form-item label="邮箱" prop="email">
-      <el-input v-model="form.email" maxlength="50" />
-    </el-form-item>
-    <el-form-item label="性别">
-      <el-radio-group v-model="form.sex">
-        <el-radio label="0">男</el-radio>
-        <el-radio label="1">女</el-radio>
-      </el-radio-group>
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserProfile } from "@/api/system/user";
-
-export default {
-  props: {
-    user: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      form: {},
-      // 表单校验
-      rules: {
-        nickName: [
-          { required: true, message: "用户昵称不能为空", trigger: "blur" }
-        ],
-        email: [
-          { required: true, message: "邮箱地址不能为空", trigger: "blur" },
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"]
-          }
-        ],
-        phonenumber: [
-          { required: true, message: "手机号码不能为空", trigger: "blur" },
-          {
-            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-            message: "请输入正确的手机号码",
-            trigger: "blur"
-          }
-        ]
-      }
-    };
-  },
-  watch: {
-    user: {
-      handler(user) {
-        if (user) {
-          this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex };
-        }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserProfile(this.form).then(response => {
-            this.$modal.msgSuccess("修改成功");
-            this.user.phonenumber = this.form.phonenumber;
-            this.user.email = this.form.email;
-          });
-        }
-      });
-    },
-    close() {
-      this.$tab.closePage();
-    }
-  }
-};
-</script>