瀏覽代碼

Merge branch 'dev' into dev-api

tom 5 月之前
父節點
當前提交
305ca7b821

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/FaultController.java

@@ -103,6 +103,6 @@ public class FaultController extends BaseController {
     @GetMapping("/listAllTreeViaSimType/{simType}")
     @ApiOperation("通过模拟器类型,查询故障列表。")
     public AjaxResult listAllTreeViaSimType(@PathVariable(value = "simType") String simType) {
-        return faultService.listAllTreeStyleBySimType(simType);
+        return faultService.listAllARTreeStyleBySimType(simType);
     }
 }

+ 11 - 27
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TaskController.java

@@ -1,12 +1,14 @@
 package com.ruoyi.sim.controller;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.sim.domain.vo.TaskVo;
+import com.ruoyi.sim.service.impl.SimService;
 import com.ruoyi.sim.service.impl.TaskService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -16,12 +18,8 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.sim.domain.Task;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
@@ -34,55 +32,41 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @RequestMapping("/sim/task")
 @Api("任务Controller")
 public class TaskController extends BaseController {
+
+    protected final Logger l = LoggerFactory.getLogger(this.getClass());
+
     @Autowired
     private TaskService taskService;
 
-    // @PreAuthorize("@ss.hasPermi('sim:task:list')")
     @GetMapping("/list")
     @ApiOperation("查询任务列表")
-    public TableDataInfo list(Task task) {
+    public TableDataInfo list(TaskVo q) {
         startPage();
-        List<Task> list = taskService.selectTaskList(task);
+        List<TaskVo> list = taskService.list(q);
         return getDataTable(list);
     }
 
-    /**
-     * 导出任务列表
-     */
-    // @PreAuthorize("@ss.hasPermi('sim:task:export')")
-    // @Log(title = "任务", businessType = BusinessType.EXPORT)
-    // @PostMapping("/export")
-    public void export(HttpServletResponse response, Task task) {
-        List<Task> list = taskService.selectTaskList(task);
-        ExcelUtil<Task> util = new ExcelUtil<Task>(Task.class);
-        util.exportExcel(response, list, "任务数据");
-    }
-
-    // @PreAuthorize("@ss.hasPermi('sim:task:query')")
     @GetMapping(value = "/{taskId}")
     @ApiOperation("获取任务详细信息")
     public AjaxResult getInfo(@PathVariable("taskId") Long taskId) {
         return taskService.selectTaskByTaskId(taskId);
     }
 
-    // @PreAuthorize("@ss.hasPermi('sim:task:add')")
-    @Log(title = "任务", businessType = BusinessType.INSERT)
+    @Autowired
+    private SimService simService;
+
     @PostMapping
     @ApiOperation("新增任务")
     public AjaxResult add(@RequestBody TaskVo tv) {
         return taskService.insertTaskByTeacher(tv);
     }
 
-    // @PreAuthorize("@ss.hasPermi('sim:task:edit')")
-    @Log(title = "任务", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation("修改任务")
     public AjaxResult edit(@RequestBody TaskVo tv) {
         return taskService.updateTaskByTeacher(tv);
     }
 
-    // @PreAuthorize("@ss.hasPermi('sim:task:remove')")
-    @Log(title = "任务", businessType = BusinessType.DELETE)
     @DeleteMapping("/{taskIds}")
     @ApiOperation("批量删除任务")
     public AjaxResult remove(@PathVariable Long[] taskIds) {

+ 24 - 5
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Fault.java

@@ -1,6 +1,8 @@
 package com.ruoyi.sim.domain;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -208,12 +210,29 @@ public class Fault extends BaseEntity implements Comparable<Fault> {
         }
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Fault fault = (Fault) o;
+
+        return new EqualsBuilder().append(faultId, fault.faultId).isEquals();
+    }
 
-    public static String TYPE_1 = "1";
-    public static String TYPE_2 = "2";
-    public static String TYPE_3 = "3";
-    public static String TYPE_4 = "4";
-    public static String TYPE_5 = "5";
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37).append(faultId).toHashCode();
+    }
+
+    public interface Type {
+        String TYPE_GZXX = "1";
+        String TYPE_2 = "2";
+        String TYPE_GZBW = "3";
+        String TYPE_4 = "4";
+        String TYPE_5 = "5";
+    }
 
     public interface State {
         String ENABLE = "0";

+ 10 - 12
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Task.java

@@ -44,6 +44,9 @@ public class Task extends BaseEntity {
     @Excel(name = "创建教师ID/用户ID")
     private Long createByUserId;
 
+    public Task() {
+    }
+
     public void setTaskId(Long taskId) {
         this.taskId = taskId;
     }
@@ -83,20 +86,15 @@ public class Task extends BaseEntity {
     public Long getCreateByUserId() {
         return createByUserId;
     }
-
+    
     @Override
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("taskId", getTaskId())
-                .append("simType", getSimType())
-                .append("taskType", getTaskType())
-                .append("name", getName())
-                .append("createByUserId", getCreateByUserId())
-                .append("createBy", getCreateBy())
-                .append("createTime", getCreateTime())
-                .append("updateBy", getUpdateBy())
-                .append("updateTime", getUpdateTime())
-                .append("remark", getRemark())
+        return new ToStringBuilder(this)
+                .append("taskId", taskId)
+                .append("simType", simType)
+                .append("taskType", taskType)
+                .append("name", name)
+                .append("createByUserId", createByUserId)
                 .toString();
     }
 

+ 28 - 3
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/TaskVo.java

@@ -2,7 +2,6 @@ package com.ruoyi.sim.domain.vo;
 
 import com.ruoyi.sim.domain.Task;
 import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 
 import java.util.List;
 
@@ -13,6 +12,13 @@ public class TaskVo extends Task {
      */
     private List<FaultTreeVo> selectedData;
 
+    private int countGZXX;
+
+    private int countGZBW;
+
+    public TaskVo() {
+    }
+
     public List<FaultTreeVo> getSelectedData() {
         return selectedData;
     }
@@ -21,9 +27,28 @@ public class TaskVo extends Task {
         this.selectedData = selectedData;
     }
 
+    public int getCountGZXX() {
+        return countGZXX;
+    }
+
+    public void setCountGZXX(int countGZXX) {
+        this.countGZXX = countGZXX;
+    }
+
+    public int getCountGZBW() {
+        return countGZBW;
+    }
+
+    public void setCountGZBW(int countGZBW) {
+        this.countGZBW = countGZBW;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("selectedData", selectedData).toString();
+        return new ToStringBuilder(this)
+                .append("selectedData", selectedData)
+                .append("countGZXX", countGZXX)
+                .append("countGZBW", countGZBW)
+                .toString();
     }
 }

+ 1 - 4
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/CommSendService.java

@@ -1,16 +1,13 @@
 package com.ruoyi.sim.service.impl;
 
-import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.sim.config.SimConfig;
 import com.ruoyi.sim.domain.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -119,7 +116,7 @@ public class CommSendService {
                 Sim s = simService.selectSimBySimId(e.getSimId());
                 Fault f = faultService.selectFaultByFaultId(ref.getFaultId());
                 if (f != null &&
-                        Fault.TYPE_3.equals(f.getFaultType()) &&
+                        Fault.Type.TYPE_GZBW.equals(f.getFaultType()) &&
                         Fault.State.ENABLE.equals(f.getFaultState())
                 ) {
                     readOneFaultResistance(s, ref, f, RealExamFault.State.LOOP_READ);

+ 44 - 9
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/FaultService.java

@@ -118,27 +118,32 @@ public class FaultService {
     public List<Fault> listAllType3EnableBySimType(final String simType) {
         Fault q = new Fault();
         q.setSimType(simType);
-        q.setFaultType(Fault.TYPE_3);
+        q.setFaultType(Fault.Type.TYPE_GZBW);
         q.setFaultState(Fault.State.ENABLE);
         return selectFaultList(q);
     }
 
-    public List<Fault> listAllType3And4EnableBySimType(final String simType) {
+    public List<Fault> listAllType1And3EnableBySimType(final String simType) {
         List<Fault> list = new ArrayList<>();
         listAllEnable(simType)
                 .stream()
                 .filter(Objects::nonNull)
-                .filter(f -> (Fault.TYPE_1.equals(f.getFaultType()) || Fault.TYPE_3.equals(f.getFaultType())))
+                .filter(f ->
+                        (Fault.State.ENABLE.equals(f.getFaultState()))
+                )
+                .filter(f ->
+                        (Fault.Type.TYPE_GZXX.equals(f.getFaultType()) || Fault.Type.TYPE_GZBW.equals(f.getFaultType()))
+                )
                 .forEach(list::add);
         return list;
     }
 
     /**
-     * 查询故障列表tree
+     * 根据模拟器型号,查询故障列表tree
      *
-     * @return 故障
+     * @param simType
      */
-    public AjaxResult listAllTreeStyleBySimType(final String simType) {
+    public AjaxResult listAllARTreeStyleBySimType(final String simType) {
         // check
         if (StringUtils.isEmpty(simType)) {
             return AjaxResult.error("simType empty!");
@@ -146,8 +151,17 @@ public class FaultService {
         if (!simService.checkSimTypeOk(simType)) {
             return AjaxResult.error("simType value error!");
         }
-        List<Fault> list = listAllType3And4EnableBySimType(simType);
-        // 按照faultId升序排序
+        return AjaxResult.success(listAllListTreeStyleBySimType(simType));
+    }
+
+    /**
+     * 根据模拟器型号,查询故障列表tree。
+     *
+     * @param simType
+     */
+    public List<FaultTreeVo> listAllListTreeStyleBySimType(final String simType) {
+        List<Fault> list = listAllType1And3EnableBySimType(simType);
+        // 排序。按照faultId升序排序
         Collections.sort(list);
         List<FaultTreeVo> tempListNode = new ArrayList<>();
         for (Fault s : list) {
@@ -158,7 +172,28 @@ public class FaultService {
         l.info(Objects.requireNonNull(tempListNode).toString());
         List<FaultTreeVo> tree = toTree(tempListNode, Fault.ROOT_FAULT_ID);
         l.info(Objects.requireNonNull(tree).toString());
-        return AjaxResult.success(tree);
+        return tree;
+    }
+
+    public Set<Fault> listType1ByType3(final String[] faultType3Ids) {
+        Set<Fault> set = new HashSet<>();
+        for (String id : faultType3Ids) {
+            Fault t3 = selectFaultByFaultId(id);
+            Fault t1 = selectFaultByFaultId(t3.getParentFaultId());
+            set.add(t1);
+        }
+        return set;
+    }
+
+    public boolean isType(String faultId, String type) {
+        if (StringUtils.isBlank(type)) {
+            return false;
+        }
+        Fault f = selectFaultByFaultId(faultId);
+        if (f == null) {
+            return false;
+        }
+        return type.equals(f.getFaultType());
     }
 
 

+ 26 - 3
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskFaultService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.sim.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.ruoyi.common.utils.DateUtils;
@@ -94,13 +95,11 @@ public class TaskFaultService {
         }
     }
 
-
     public int insertTaskFault(Long taskId, String faultId, String flag) {
         TaskFault n = new TaskFault(0L, taskId, faultId, flag);
         return insertTaskFault(n);
     }
 
-
     public int updateTaskFault(Long relId, Long taskId, String faultId, String flag) {
         TaskFault f = selectTaskFaultByRelId(relId);
         f.setTaskId(taskId);
@@ -109,7 +108,6 @@ public class TaskFaultService {
         return updateTaskFault(f);
     }
 
-
     public int insertOrUpdateTaskFault(TaskFault tf) {
         TaskFault f = selectUniqueTaskFault(tf.getTaskId(), tf.getFaultId());
         if (f == null) {
@@ -131,4 +129,29 @@ public class TaskFaultService {
         }
         return list.size();
     }
+
+    public int countTypeGZBW(Long taskId) {
+        TaskFault q = new TaskFault();
+        q.setTaskId(taskId);
+        q.setFlag(TaskFault.YES);
+        List<TaskFault> list = selectTaskFaultList(q);
+        if (list == null || list.isEmpty()) {
+            return 0;
+        } else {
+            return list.size();
+        }
+    }
+
+    public List<TaskFault> listType3(Long taskId) {
+        TaskFault q = new TaskFault();
+        q.setTaskId(taskId);
+        q.setFlag(TaskFault.YES);
+        List<TaskFault> list1 = selectTaskFaultList(q);
+        List<TaskFault> list2 = new ArrayList<TaskFault>();
+
+
+
+
+        return list2;
+    }
 }

+ 35 - 15
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.sim.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -59,14 +60,14 @@ public class TaskService {
         String simType = t.getSimType();
         BeanUtils.copyProperties(t, vo);
         // 查询获得数据结构。
-        List<FaultTreeVo> listToQ = (List<FaultTreeVo>) faultService.listAllTreeStyleBySimType(simType).get(AjaxResult.DATA_TAG);
+        List<FaultTreeVo> listToQ = (List<FaultTreeVo>) faultService.listAllARTreeStyleBySimType(simType).get(AjaxResult.DATA_TAG);
         // 变成扁平list
         List<FaultTreeVo> listToF = FaultService.flatten(listToQ);
         for (FaultTreeVo o : listToF) {
             if (o == null) {
                 continue;
             }
-            if (Fault.TYPE_3.equals(o.getFaultType())) {
+            if (Fault.Type.TYPE_GZBW.equals(o.getFaultType())) {
                 TaskFault tf = o.getTaskFault();
                 TaskFault tfQ = taskFaultService.selectUniqueTaskFault(taskId, tf.getFaultId());
                 // 存在就设置上数据库中TaskFault值。
@@ -84,11 +85,31 @@ public class TaskService {
     /**
      * 查询任务列表
      *
-     * @param task 任务
+     * @param q 任务
      * @return 任务
      */
-    public List<Task> selectTaskList(Task task) {
-        return taskMapper.selectTaskList(task);
+    public List<TaskVo> list(TaskVo q) {
+        Task qT = new Task();
+        BeanUtils.copyProperties(q, qT);
+        List<Task> listT = taskMapper.selectTaskList(qT);
+        List<TaskVo> listTVo = new ArrayList<>(listT.size());
+        Long taskId = q.getTaskId();
+        listT.stream().forEach(t -> {
+            TaskVo vo = new TaskVo();
+            BeanUtils.copyProperties(t, vo);
+            {
+                int countGZXX = 0;
+                int countGZBW = 0;
+                //
+                countGZBW = taskFaultService.countTypeGZBW(taskId);
+                // todo:故障现象
+                // countGZXX = faultService.listType1ByType3
+                vo.setCountGZXX(countGZXX);
+                vo.setCountGZBW(countGZBW);
+            }
+            listTVo.add(vo);
+        });
+        return listTVo;
     }
 
     /**
@@ -104,7 +125,7 @@ public class TaskService {
             return AjaxResult.error("TaskVo empty!");
         }
         if (!simService.checkSimTypeOk(tv.getSimType())) {
-            return AjaxResult.error("simType error!");
+            return AjaxResult.error("getSimType error!");
         }
         if (!Task.Type.TEACHER_ADD.equals(tv.getTaskType())) {
             return AjaxResult.error("taskType value error!");
@@ -128,7 +149,7 @@ public class TaskService {
                 if (ftv == null) {
                     continue;
                 }
-                if (!Fault.TYPE_3.equals(ftv.getFaultType())) {
+                if (!Fault.Type.TYPE_GZBW.equals(ftv.getFaultType())) {
                     continue;
                 }
                 TaskFault tf = ftv.getTaskFault();
@@ -194,19 +215,18 @@ public class TaskService {
      */
     @Transactional
     public AjaxResult insertTaskByTeacher(TaskVo tv) {
-        l.info("insertTaskByTeacher " + tv);
         // check
         if (tv == null) {
             return AjaxResult.error("TaskVo empty!");
         }
         if (!simService.checkSimTypeOk(tv.getSimType())) {
-            return AjaxResult.error("simType error!");
+            return AjaxResult.error("getSimType error!");
         }
         if (!Task.Type.TEACHER_ADD.equals(tv.getTaskType())) {
-            return AjaxResult.error("taskType value error!");
+            return AjaxResult.error("getTaskType value error!");
         }
         if (StringUtils.isEmpty(tv.getName())) {
-            return AjaxResult.error("name isEmpty!");
+            return AjaxResult.error("getName isEmpty!");
         }
         //
         tv.setCreateByUserId(SecurityUtils.getUserId());
@@ -214,7 +234,6 @@ public class TaskService {
         tv.setCreateTime(DateUtils.getNowDate());
         tv.setUpdateBy(SecurityUtils.getUsername());
         tv.setUpdateTime(DateUtils.getNowDate());
-        tv.setRemark("");
         taskMapper.insertTask(tv);
         List<FaultTreeVo> selectedData = tv.getSelectedData();
         if (selectedData != null) {
@@ -223,7 +242,7 @@ public class TaskService {
                 if (ftv == null) {
                     continue;
                 }
-                if (!Fault.TYPE_3.equals(ftv.getFaultType())) {
+                if (!Fault.Type.TYPE_GZBW.equals(ftv.getFaultType())) {
                     continue;
                 }
                 TaskFault tf = ftv.getTaskFault();
@@ -243,7 +262,7 @@ public class TaskService {
                 }
                 // todo:选中数量限制
 
-                // todo:故障部位冲突
+                // 故障部位冲突 暂时没有故障部位冲突。
                 tf.setTaskId(tv.getTaskId());
                 taskFaultService.insertOrUpdateTaskFault(tf);
             }
@@ -265,9 +284,10 @@ public class TaskService {
             return AjaxResult.error("simType value error!");
         }
         // query obj.
-        List<FaultTreeVo> ftList = (List<FaultTreeVo>) faultService.listAllTreeStyleBySimType(simType).get(AjaxResult.DATA_TAG);
+        List<FaultTreeVo> ftList = faultService.listAllListTreeStyleBySimType(simType);
         TaskVo t = new TaskVo();
         t.setTaskId(Task.EMPTY_TASK_ID);
+        t.setSimType(simType);
         t.setSelectedData(ftList);
         return AjaxResult.success(t);
     }

+ 8 - 0
ruoyi-ui/src/api/login.js

@@ -57,4 +57,12 @@ export function getCodeImg() {
     method: 'get',
     timeout: 20000
   })
+}
+
+// 获取用户登陆账号角色info
+export function getroleinfo() {
+  return request({
+    url: '/sim/add-on-user/roleInfo/',
+    method: 'get'
+  })
 }

+ 13 - 13
ruoyi-ui/src/router/index.js

@@ -61,19 +61,19 @@ export const constantRoutes = [
     component: () => import('@/views/error/401'),
     hidden: true
   },
-  {
-    path: '',
-    component: Layout,
-    redirect: 'index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/system/user/profile/index'),
-        name: 'Index',
-        meta: { title: '个人中心', icon: 'dashboard', affix: true }
-      }
-    ]
-  },
+  // {
+  //   path: '',
+  //   component: Layout,
+  //   redirect: 'index',
+  //   children: [
+  //     {
+  //       path: 'index',
+  //       component: () => import('@/views/system/user/profile/index'),
+  //       name: 'Index',
+  //       meta: { title: '个人中心', icon: 'dashboard', affix: true }
+  //     }
+  //   ]
+  // },
   {
     path: '/user',
     component: Layout,

+ 15 - 9
ruoyi-ui/src/views/login.vue

@@ -63,7 +63,7 @@
 </template>
 
 <script>
-import { getCodeImg } from "@/api/login";
+import { getCodeImg,getroleinfo,getInfo } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from '@/utils/jsencrypt'
 
@@ -145,14 +145,20 @@ export default {
           console.log(this.loginForm.code)
           console.log('this.loginForm.code')
           this.$store.dispatch("Login", this.loginForm).then((res) => {
-            // console.log(res.username)
-            // console.log('res.username')
-            // console.log(res.code)
-            // console.log(this.loginForm)
-            // console.log('this.loginForm')
-            // console.log(this.redirect)
-            // console.log('this.redirect')
-            this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
+
+            getroleinfo().then(res => {
+              if(res.code=200){
+                // 学员登录成功跳转
+                if(res.data.roleId==101){
+                  this.$router.push({ path: "exam/exam" }).catch(()=>{});
+                }
+                // 教师和管理列表、超管
+                if(res.data.roleId==100 || res.data.roleId==102 || res.data.roleId==1){
+                  this.$router.push({ path: "score" }).catch(()=>{});
+                }
+              } 
+            });
+            // this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
           }).catch(() => {
             this.loading = false;
             if (this.captchaEnabled) {

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

@@ -23,10 +23,10 @@
               end-placeholder="结束日期"
             ></el-date-picker>
           </el-form-item>
-          <el-form-item label="模拟器型" prop="simType">
+          <el-form-item label="模拟器型" prop="simType">
             <el-select
               v-model="queryParams.simType"
-              placeholder="模拟器型"
+              placeholder="模拟器型"
               clearable
               style="width: 240px"
               @keyup.enter.native="handleQuery"

+ 5 - 8
ruoyi-ui/src/views/peoples/student/index.vue

@@ -31,9 +31,9 @@
       <!--用户数据-->
       <el-col :span="20" :xs="24">
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
-          <el-form-item label="学号" prop="UserName">
+          <el-form-item label="学号" prop="userName">
             <el-input
-              v-model="queryParams.UserName"
+              v-model="queryParams.userName"
               placeholder="请输入学号"
               clearable
               style="width: 240px"
@@ -306,7 +306,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         userName: undefined,
-        phonenumber: undefined,
+        nickName: undefined,
         status: undefined,
         deptId: undefined
       },
@@ -401,7 +401,6 @@ export default {
         deptId: undefined,
         userName: undefined,
         nickName: undefined,
-        password: undefined,
         status: "0",
         remark: undefined,
       };
@@ -452,10 +451,8 @@ export default {
       const userId = row.userId || this.ids;
       getStudent(userId).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.roleOptions = response.roles;
+        this.$set(this.form, "roleIds", response.roleIds);
         this.open = true;
         this.title = "修改学员";
         this.form.password = "";

+ 3 - 3
ruoyi-ui/src/views/system/dept/index.vue

@@ -214,9 +214,9 @@ export default {
         deptName: [
           { required: true, message: "名称不能为空", trigger: "blur" }
         ],
-        orderNum: [
-          { required: true, message: "显示排序不能为空", trigger: "blur" }
-        ],
+        // orderNum: [
+        //   { required: true, message: "显示排序不能为空", trigger: "blur" }
+        // ],
         // email: [
         //   {
         //     type: "email",

+ 6 - 37
ruoyi-ui/src/views/teacher/index.vue

@@ -98,7 +98,6 @@
           </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
-
         <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"  width="80"/>
@@ -226,11 +225,10 @@
 <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 {
   name: "Teacher",
-  dicts: ['sys_normal_disable', 'sys_user_sex'],
+  dicts: ['sys_normal_disable'],
   data() {
     return {
       // 遮罩层
@@ -249,46 +247,26 @@ export default {
       userList: null,
       // 弹出层标题
       title: "",
-      // 部门树选项
-      deptOptions: undefined,
       // 是否显示弹出层
       open: false,
-      // 部门名称
-      deptName: undefined,
       // 默认密码
       initPassword: undefined,
-      // 日期范围
-      dateRange: [],
-      // 岗位选项
-      postOptions: [],
       // 角色选项
       roleOptions: [],
+      // 日期范围
+      dateRange: [],
       // 表单参数
       form: {},
       defaultProps: {
         children: "children",
         label: "label"
       },
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/system/user/importData"
-      },
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         userName: undefined,
+        nickName:undefined,
         phonenumber: undefined,
         status: undefined,
       },
@@ -370,7 +348,6 @@ export default {
         phonenumber: undefined,
         status: "0",
         remark: undefined,
-        postIds: [],
         roleIds: []
       };
       this.resetForm("form");
@@ -384,7 +361,6 @@ export default {
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
-      this.$refs.tree.setCurrentKey(null);
       this.handleQuery();
     },
     // 多选框选中数据
@@ -409,13 +385,9 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
-      // getUser().then(response => {
-      //   this.postOptions = response.posts;
-      //   this.roleOptions = response.roles;
         this.open = true;
         this.title = "添加教师";
         this.form.password = this.initPassword;
-      // });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -423,13 +395,10 @@ export default {
       const userId = row.userId || this.ids;
       getTeacher(userId).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.roleOptions = response.roles;
+        this.$set(this.form, "roleIds", response.roleIds);
         this.open = true;
         this.title = "修改";
-        // this.form.password = "";
       });
     },
     /** 重置密码按钮操作 */