fix: 投资记账管理系统,分页统一修复。

This commit is contained in:
tianyongbao
2025-05-10 18:49:11 +08:00
parent ec1e8536e4
commit 2331a71233
34 changed files with 4926 additions and 49 deletions

View File

@@ -34,6 +34,7 @@
<div class="content-con" v-loading="loading">
<el-table v-loading="loading" :data="bankcardList" @selection-change="handleSelectionChange" 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="储蓄账户名称" align="center" width="180" prop="name" />
<el-table-column label="储蓄账户卡号" align="center" prop="code" />
<el-table-column label="储蓄账户类型" width="150" align="center" prop="debitType">
@@ -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>
<!-- 添加或修改储蓄账户信息对话框 -->
@@ -235,6 +243,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)