|
@@ -14,7 +14,8 @@
|
|
|
<div class="page_search">
|
|
<div class="page_search">
|
|
|
<div class="search_content">
|
|
<div class="search_content">
|
|
|
<div class="content_left">
|
|
<div class="content_left">
|
|
|
- <FormSearchGroup :searchList="searchList"></FormSearchGroup>
|
|
|
|
|
|
|
+ <FormSearchGroup :searchList="searchList"
|
|
|
|
|
+ @searchChange="HandleUserSearchChange"></FormSearchGroup>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -24,38 +25,107 @@
|
|
|
:pageSize="pageSize"
|
|
:pageSize="pageSize"
|
|
|
:totalNum="totalNum"
|
|
:totalNum="totalNum"
|
|
|
:tableColumns="tableColumns"
|
|
:tableColumns="tableColumns"
|
|
|
- :tableData="userTableData">
|
|
|
|
|
|
|
+ :tableData="userTableData"
|
|
|
|
|
+ @paginationChange="HandlePaginationChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #identity="{row}">
|
|
|
|
|
+ {{ IdentityTypeNumToName(row.identity)?.label }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #status="{row}">
|
|
|
|
|
+ <TableRowStatus :statusMsg="userStatusMsg" :useStatus="row.status"></TableRowStatus>
|
|
|
|
|
+ </template>
|
|
|
</Table>
|
|
</Table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
import Table from '@/baseComponents/Table.vue';
|
|
import Table from '@/baseComponents/Table.vue';
|
|
|
|
|
|
|
|
-import {searchList} from './formSearchGroup'
|
|
|
|
|
|
|
+import TableRowStatus from '@/baseComponents/TableRowStatus.vue';
|
|
|
|
|
|
|
|
|
|
+import {getUserInfoApi} from '@/api/userSearch'
|
|
|
|
|
+import {searchList} from './formSearchGroup'
|
|
|
import {tableColumns} from './table'
|
|
import {tableColumns} from './table'
|
|
|
|
|
|
|
|
const currentPage = ref(1)
|
|
const currentPage = ref(1)
|
|
|
const totalNum = ref(0)
|
|
const totalNum = ref(0)
|
|
|
const pageSize = ref(20)
|
|
const pageSize = ref(20)
|
|
|
|
|
|
|
|
-const userTableData = ref([
|
|
|
|
|
- {
|
|
|
|
|
- account: 'teacher01',
|
|
|
|
|
- name: '白语忱',
|
|
|
|
|
- userType: '教师',
|
|
|
|
|
- school: '北京师范大学',
|
|
|
|
|
- wechatName: '', // 图片中该列为空白
|
|
|
|
|
- phone: '13459607083',
|
|
|
|
|
- status: '启用',
|
|
|
|
|
|
|
+// 用户表格数据
|
|
|
|
|
+const userTableData = ref([])
|
|
|
|
|
+// 查询参数
|
|
|
|
|
+const searchParams = ref({})
|
|
|
|
|
+// 获取用户信息
|
|
|
|
|
+const GetUserInfo = async ()=>{
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ pageNum:currentPage.value,
|
|
|
|
|
+ pageSize:pageSize.value,
|
|
|
|
|
+ userAccount:searchParams.value.userAccount,
|
|
|
|
|
+ phone:searchParams.value.phone,
|
|
|
}
|
|
}
|
|
|
-])
|
|
|
|
|
|
|
+ let res = await getUserInfoApi(params)
|
|
|
|
|
+
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ userTableData.value = res.data.records
|
|
|
|
|
+ totalNum.value = res.data.total
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 处理搜索项变化
|
|
|
|
|
+const HandleUserSearchChange = async (params,key)=>{
|
|
|
|
|
+ console.log('查询参数',params)
|
|
|
|
|
+ console.log('查询key',key)
|
|
|
|
|
+ searchParams.value = {...params}
|
|
|
|
|
+ await GetUserInfo()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+// 处理分页变化
|
|
|
|
|
+const HandlePaginationChange = async (params)=>{
|
|
|
|
|
+ const {type,val} = params
|
|
|
|
|
+ if(type == 'currentPage'){
|
|
|
|
|
+ currentPage.value = val
|
|
|
|
|
+ }
|
|
|
|
|
+ await GetUserInfo()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// 用户身份类型状态转换
|
|
|
|
|
+const IdentityTypeNumToName = (type)=>{
|
|
|
|
|
+ switch(type){
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ return {
|
|
|
|
|
+ label:'学校管理人员'
|
|
|
|
|
+ }
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ return {
|
|
|
|
|
+ label:'教师'
|
|
|
|
|
+ }
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ return {
|
|
|
|
|
+ label:'学生'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const userStatusMsg = ref([
|
|
|
|
|
+ {
|
|
|
|
|
+ statusFlag:0,
|
|
|
|
|
+ title:'禁用',
|
|
|
|
|
+ themeClass: 'abnormal_icon'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ statusFlag:1,
|
|
|
|
|
+ title:'启用',
|
|
|
|
|
+ themeClass: 'normal_icon'
|
|
|
|
|
+ },
|
|
|
|
|
+])
|
|
|
|
|
+onMounted(async ()=>{
|
|
|
|
|
+ // 初次加载不查询
|
|
|
|
|
+ // await GetUserInfo()
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|