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

@@ -33,6 +33,7 @@
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
<el-table v-loading="loading" :data="HealthDiseasesList" @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="type">
<template #default="scope">
@@ -52,7 +53,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>
<!-- 添加或修改常见疾病治疗对话框 -->
@@ -213,6 +221,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)