Browse Source

fix:切换分页问题

zhangyong/milestone-20250913-现金管理
lihui 2 months ago
parent
commit
1693a3422d
  1. 14
      src/views/permissions/rolePermission.vue

14
src/views/permissions/rolePermission.vue

@ -23,13 +23,9 @@ const admin = ref({
const role = ref({ const role = ref({
name: '' name: ''
}) })
const getObj = ref({
pageNum: 1,
pageSize: 10
})
const getRoleObj = ref({ const getRoleObj = ref({
pageNum: 1, pageNum: 1,
pageSize: 10
pageSize: 20
}) })
const permissionAddVisible = ref(false) const permissionAddVisible = ref(false)
const addRole = ref({ const addRole = ref({
@ -47,9 +43,9 @@ const getRoleList = async function (val) {
} }
try { try {
if (typeof val === 'number') { if (typeof val === 'number') {
getObj.value.pageNum = val
getRoleObj.value.pageNum = val
} }
console.log('搜索参数', getObj.value, role.value)
console.log('搜索参数', getRoleObj.value, role.value)
const result = await request({ const result = await request({
url: '/role/selectBy', url: '/role/selectBy',
data: { data: {
@ -93,7 +89,7 @@ const trimJwCode = () => {
} }
const searchRole = function () { const searchRole = function () {
trimJwCode(); trimJwCode();
getObj.value.pageNum = 1
getRoleObj.value.pageNum = 1
getRoleList() getRoleList()
} }
// //
@ -637,7 +633,7 @@ onMounted(async function () {
</div> </div>
<div style="margin-top: 20px;display: flex;"> <div style="margin-top: 20px;display: flex;">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
<el-pagination background :page-size="getRoleObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="roleTotal" @size-change="handleRolePageSizeChange" layout="total, sizes, prev, pager, next, jumper" :total="roleTotal" @size-change="handleRolePageSizeChange"
@current-change="handleRoleCurrentChange"></el-pagination> @current-change="handleRoleCurrentChange"></el-pagination>
</div> </div>

Loading…
Cancel
Save