Browse Source

Merge pull request #4692 from willnewii/fix/search_cannot_paging

fix: search result can’t paging
pull/4697/merge
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
1b9a114534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/nc-gui/components/tabs/auth/UserManagement.vue

13
packages/nc-gui/components/tabs/auth/UserManagement.vue

@ -44,7 +44,7 @@ let isLoading = $ref(false)
let totalRows = $ref(0) let totalRows = $ref(0)
const currentPage = $ref(1) let currentPage = $ref(1)
const currentLimit = $ref(10) const currentLimit = $ref(10)
@ -58,7 +58,7 @@ const loadUsers = async (page = currentPage, limit = currentLimit) => {
const response: any = await api.auth.projectUserList(project.value?.id, { const response: any = await api.auth.projectUserList(project.value?.id, {
query: { query: {
limit, limit,
offset: searchText.value.length === 0 ? (page - 1) * limit : 0, offset: (page - 1) * limit,
query: searchText.value, query: searchText.value,
}, },
} as RequestParams) } as RequestParams)
@ -160,7 +160,14 @@ onBeforeMount(async () => {
} }
}) })
watchDebounced(searchText, () => loadUsers(), { debounce: 300, maxWait: 600 }) watchDebounced(
searchText,
() => {
currentPage = 1
loadUsers()
},
{ debounce: 300, maxWait: 600 },
)
const isSuperAdmin = (user: { main_roles?: string }) => { const isSuperAdmin = (user: { main_roles?: string }) => {
return user.main_roles?.split(',').includes(OrgUserRoles.SUPER_ADMIN) return user.main_roles?.split(',').includes(OrgUserRoles.SUPER_ADMIN)

Loading…
Cancel
Save