Sfoglia il codice sorgente

vue 20241223 页面 修改

贾小兵 5 mesi fa
parent
commit
91acb963df

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

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

+ 12 - 4
ruoyi-ui/src/views/peoples/exams/index.vue

@@ -114,7 +114,7 @@
 
         <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="50" align="center" />
-          <el-table-column label="编号" align="center" key="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" />
+          <el-table-column label="编号" align="center" key="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" width="80"/>
           <el-table-column label="考试名称" align="center" key="examCollectionName" prop="examCollectionName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
           <el-table-column label="考试时长" align="center" key="limitDuration" prop="limitDuration" v-if="columns[2].visible" :show-overflow-tooltip="true" />
           <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[3].visible" :show-overflow-tooltip="true" >
@@ -181,14 +181,22 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="考试名称" prop="examCollectionName">
-              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName"/>
+              <el-input  placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName" style="width: 85%;"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="考试时长" prop="limitDuration">
-              <el-input  placeholder="请输入考试时长" maxlength="30" v-model="form.limitDuration"/>
+              <el-input v-model="form.limitDuration" placeholder="请输入考试时长" style="width: 85%;">
+                <template slot="append">
+                  <el-button type="primary">
+                    单位(分)
+                  </el-button>
+                </template>
+              </el-input>
             </el-form-item>
           </el-col>
+
+
           <el-col :span="8">
             <el-form-item label="考试时间" prop="examTime">
               <el-date-picker type="daterange" v-model="form.examTime" format="yyyy-MM-dd"
@@ -199,7 +207,7 @@
           
           <el-col :span="8" >
             <el-form-item label="型号" prop="simType">
-              <el-select v-model="form.simType"  placeholder="请选择模拟器类型" style="width: 100%;">
+              <el-select v-model="form.simType"  placeholder="请选择模拟器类型" style="width: 85%;">
                 <el-option
                   v-for="dict in dict.type.sim_sim_type"
                   :key="dict.value"

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

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