fix: 健康管理系统,分页统一修复。

This commit is contained in:
tianyongbao
2025-05-10 18:46:58 +08:00
parent 935f1cd60c
commit addf3589d4
14 changed files with 297 additions and 16 deletions

View File

@@ -32,6 +32,7 @@
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
<el-table v-loading="loading" :data="personList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
<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="姓名" align="center" prop="name" />
<el-table-column label="昵称" align="center" prop="nickName" />
<el-table-column label="类型" align="center" prop="type">
@@ -63,7 +64,14 @@
</template>
</el-table-column>
</el-table>
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
<el-pagination
small
background
layout="total,sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
<!-- 添加或修改成员管理对话框 -->
@@ -232,6 +240,18 @@ const handleCurrentChange = (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 // 这里可以理解成一个公式
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id)