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

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

View File

@@ -54,6 +54,7 @@
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
<el-table v-loading="loading" :data="marRecordList" @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="60"></el-table-column>
<el-table-column label="人员姓名" align="center" width="120" prop="personName" />
<el-table-column label="健康档案" align="center" width="180" prop="healthRecordName" />
<el-table-column label="用药名称" align="center" prop="name" />
@@ -89,7 +90,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>
<!-- 添加或修改用药记录对话框 -->
@@ -377,6 +385,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)