From df5b61dcf9d7c6a71ba919b0556ea9aa43aa3f76 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期一, 08 五月 2023 10:00:43 +0800
Subject: [PATCH] 修改展示

---
 src/views/system/user/index.vue |   51 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index ec5954b..473f805 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -2,7 +2,10 @@
     <div class="system-user-container">
         <el-card shadow="hover">
             <div class="system-user-search mb15">
-                <el-input size="default" v-model.trim="searchName" placeholder="真实姓名" style="max-width: 180px"> </el-input>
+                <el-input size="default" v-model.trim="userTableData.listQuery.searchParams.realName" placeholder="真实姓名" style="max-width: 180px;margin-right: 10px"> </el-input>
+                <el-select v-model="userTableData.listQuery.searchParams.roleId" placeholder="角色类型" clearable class="w100" style="max-width: 180px" size="default">
+                  <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+                </el-select>
                 <el-button size="default" type="primary" class="ml10" @click="searchByName()">
                     <el-icon>
                         <ele-Search />
@@ -95,6 +98,7 @@
               roleId: number | null;
               name: string
               realName: string
+              userIndentityId: number | null;
             }
         };
     };
@@ -102,7 +106,7 @@
     depList: [];
     roleList: [];
     expList: [];
-    searchName:string
+    searchType: null | number
 }
 
 export default defineComponent({
@@ -121,7 +125,8 @@
                   searchParams:{
                     roleId: null,
                     name: '',
-                    realName: ''
+                    realName: '',
+                    userIndentityId: null
                   }
                 }
             },
@@ -134,7 +139,7 @@
             depList: [],
             roleList: [],
             expList: [],
-            searchName: ''
+            searchType:null
         });
         // 初始化表格数据
         const initUserTableData = async () => {
@@ -149,28 +154,33 @@
                 });
             }
         };
-
-        const searchByName = async () =>{
-          if(state.searchName == ''){
+        const initRoleTableData = async () => {
+          let res = await useRoleApi().getRoleList();
+          if (res.data.code === 100) {
+            state.roleList = res.data.data;
+          } else {
             ElMessage({
               type: 'warning',
-              message: '请输入搜索内容'
+              message: res.data.msg
             });
-          }else{
-            let res = await userApi().getUserLByRealName(state.searchName);
-            if (res.data.code === 100) {
-              state.userTableData.data = res.data.data
-            } else {
-              ElMessage({
-                type: 'warning',
-                message: res.data.msg
-              });
-            }
           }
-        }
+        };
+
+      const searchByName = ()=>{
+        initUserTableData()
+      }
 
         const reset = () =>{
-          state.searchName = ''
+          state.userTableData.listQuery = {
+            pageIndex: 1,
+                pageSize: 10,
+                searchParams:{
+                  roleId: null,
+                  name: '',
+                  realName: '',
+                  userIndentityId: null
+                }
+          }
           initUserTableData()
         }
 
@@ -253,6 +263,7 @@
         // 页面加载时
         onMounted(() => {
             initUserTableData();
+            initRoleTableData();
             getRoleData();
             getExpertsData();
             getDepList()

--
Gitblit v1.9.2