| | |
| | | <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 /> |
| | |
| | | roleId: number | null; |
| | | name: string |
| | | realName: string |
| | | userIndentityId: number | null; |
| | | } |
| | | }; |
| | | }; |
| | |
| | | depList: []; |
| | | roleList: []; |
| | | expList: []; |
| | | searchName:string |
| | | searchType: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | |
| | | searchParams:{ |
| | | roleId: null, |
| | | name: '', |
| | | realName: '' |
| | | realName: '', |
| | | userIndentityId: null |
| | | } |
| | | } |
| | | }, |
| | |
| | | depList: [], |
| | | roleList: [], |
| | | expList: [], |
| | | searchName: '' |
| | | searchType:null |
| | | }); |
| | | // 初始化表格数据 |
| | | const initUserTableData = async () => { |
| | |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | 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() |
| | | } |
| | | |
| | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initUserTableData(); |
| | | initRoleTableData(); |
| | | getRoleData(); |
| | | getExpertsData(); |
| | | getDepList() |