jinxia.mo 1 месяц назад
Родитель
Сommit
0ff2ac2e89

+ 56 - 4
back-ui/src/views/system/user/index.vue

@@ -21,7 +21,7 @@
                 <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter="handleQuery" />
               </el-form-item>
               <el-form-item label="用户类型" prop="userType">
-                <el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
+                <el-select v-model="queryParams.userType" placeholder="请选择用户类型" clearable style="width: 240px">
                   <el-option v-for="dict in user_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                 </el-select>
               </el-form-item>
@@ -79,7 +79,11 @@
                   <dict-tag :options="user_type" :value="scope.row.userType" />
                 </template>
               </el-table-column>
-              <el-table-column label="考生类型" align="center" key="examType" prop="examType" />
+              <el-table-column label="考生类型" align="center" key="examType" v-if="columns.examType.visible">
+                <template #default="scope">
+                  <dict-tag :options="exam_type" :value="scope.row.examType" />
+                </template>
+              </el-table-column>
               <el-table-column label="平台机构" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
               <el-table-column label="代理商" align="center" key="deptName" prop="deptName" />
               <el-table-column label="邀请码" align="center" key="inviteCode" prop="inviteCode" />
@@ -116,7 +120,7 @@
                 </template>
               </el-table-column>
             </el-table>
-            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="handlePagination" />
           </el-col>
         </pane>
       </splitpanes>
@@ -244,7 +248,7 @@ import "splitpanes/dist/splitpanes.css"
 const router = useRouter()
 const appStore = useAppStore()
 const { proxy } = getCurrentInstance()
-const { sys_normal_disable, sys_user_sex, user_type } = proxy.useDict("sys_normal_disable", "sys_user_sex", "user_type")
+const { sys_normal_disable, sys_user_sex, user_type, exam_type } = proxy.useDict("sys_normal_disable", "sys_user_sex", "user_type", "exam_type")
 
 const userList = ref([])
 const open = ref(false)
@@ -285,6 +289,7 @@ const columns = ref({
   deptName: { label: '机构', visible: true },
   phonenumber: { label: '手机号码', visible: true },
   status: { label: '状态', visible: true },
+  examType: { label: '考生类型', visible: true },
   createTime: { label: '创建时间', visible: true }
 })
 
@@ -294,6 +299,7 @@ const data = reactive({
     pageNum: 1,
     pageSize: 10,
     userName: undefined,
+    userType: undefined,
     phonenumber: undefined,
     status: undefined,
     deptId: undefined
@@ -330,6 +336,13 @@ function getList() {
   })
 }
 
+/** 分页事件处理 */
+function handlePagination(pagination) {
+  queryParams.value.pageNum = pagination.page
+  queryParams.value.pageSize = pagination.limit
+  getList()
+}
+
 /** 查询机构下拉树结构 */
 function getDeptTree() {
   deptTreeSelect().then(response => {
@@ -578,3 +591,42 @@ onMounted(() => {
   })
 })
 </script>
+
+<style scoped>
+/* 确保 splitpanes 的 pane 可以滚动 */
+:deep(.splitpanes__pane) {
+  overflow: auto !important;
+  height: 100%;
+}
+
+/* 确保 el-col 内容正常显示,不被遮挡 */
+:deep(.splitpanes__pane .el-col) {
+  padding: 0;
+  overflow: visible;
+}
+
+/* 确保表格容器可以正常显示滚动条 */
+.app-container {
+  height: 100%;
+}
+
+.app-container .el-row {
+  height: 100%;
+}
+
+.app-container .el-table {
+  width: 100%;
+}
+
+/* 确保表格内容区域可以滚动 */
+:deep(.el-table__body-wrapper) {
+  overflow-x: auto !important;
+}
+
+/* 确保按钮区域有足够的空间,不被遮挡 */
+.mb8 {
+  margin-bottom: 8px;
+  position: relative;
+  z-index: 1;
+}
+</style>

+ 12 - 4
ie-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -80,18 +80,24 @@ public class SysUserController extends BaseController
         }
         startPage();
         List<SysUser> list = userService.selectUserList(user);
+        // 先获取分页信息,再处理数据
+        TableDataInfo dataTable = getDataTable(list);
+        // 处理用户信息(填充学校名称、班级名称等)
         list = processUserInfo(list);
-        return getDataTable(list);
+        dataTable.setRows(list);
+        return dataTable;
     }
 
     private List<SysUser> processUserInfo(List<SysUser> list) {
         if (CollectionUtils.isNotEmpty(list)) {
-            List<Long> userIds = list.stream().map(SysUser::getUserId).filter(userId -> userId != null)
-                    .distinct().collect(Collectors.toList());
-
             List<Long> cardIds = list.stream().map(SysUser::getCardId).filter(cardId -> cardId != null)
                     .distinct().collect(Collectors.toList());
 
+            // 如果cardIds为空,直接返回,不进行后续处理
+            if (CollectionUtils.isEmpty(cardIds)) {
+                return list;
+            }
+
             List<DzCards> cards = cardsService.selectCardsByCardIds(cardIds);
             //将里面的campusId与schoolId汇总为一个list后,通过schoolService查询所有学校的信息List<DzSchool>
             List<Long> schoolIds = cards.stream().map(DzCards::getSchoolId).filter(schoolId -> schoolId != null).collect(Collectors.toList());
@@ -137,6 +143,7 @@ public class SysUserController extends BaseController
                 if (user.getCardId() != null) {
                     DzCards card = cardMap.get(user.getCardId());
                     if (card != null) {
+                        user.setCardNo(card.getCardNo());
                         // 设置注册学校名称(schoolId对应的学校名称)
                         if (card.getSchoolId() != null) {
                             user.setSchoolName(schoolMap.get(card.getSchoolId()));
@@ -167,6 +174,7 @@ public class SysUserController extends BaseController
     public void export(HttpServletResponse response, SysUser user)
     {
         List<SysUser> list = userService.selectUserList(user);
+        list = processUserInfo(list);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.exportExcel(response, list, "用户数据");
     }

+ 11 - 0
ie-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -140,6 +140,9 @@ public class SysUser extends BaseEntity
 
     private Long cardId;
 
+    /** 卡号 */
+    private String cardNo;
+
     /** 注册学校名称 */
     private String schoolName;
     /** 学校班级名称 */
@@ -495,6 +498,14 @@ public class SysUser extends BaseEntity
         this.cardId = cardId;
     }
 
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+
     public String getSchoolName() {
         return schoolName;
     }

+ 2 - 1
ie-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -73,7 +73,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.user_type, u.user_type_id, u.account_type from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.user_type, u.user_type_id, u.account_type
+		,u.card_id,u.end_year,u.location,u.invite_code,u.exam_type from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">