fix: 框架系统,分页统一修复。

This commit is contained in:
tianyongbao
2025-05-10 18:50:20 +08:00
parent 2331a71233
commit e3096da25c
12 changed files with 154 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
<div class="content-con" v-loading="loading">
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" stripe height="calc(100% - 0.62rem)">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
@@ -155,6 +156,18 @@ const handleCurrentChange = (val) => {
queryParams.value.pageNum = val
getList()
}
//每页显示条数改变
const handleSizeChange = (val) => {
queryParams.value.pageSize = val
getList()
}
// 序号翻页递增
const indexMethod = (index) => {
const nowPage = queryParams.value.pageNum //当前第几页,根据组件取值即可
const nowLimit = queryParams.value.pageSize //当前每页显示几条,根据组件取值即可
return index + 1 + (nowPage - 1) * nowLimit // 这里可以理解成一个公式
}
onMounted(() => {
mainStyleHeight.value = `calc(100% - ${(searchHeightRef.value.clientHeight + 10) / 100}rem)`
getList()