diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 0a306dc5f..dfe0e57ab 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -64,10 +64,12 @@ onMounted(() => { }); const isLoading = ref(false); - async function search() { isLoading.value = true; const params = { ...userParams.value }; + store.userParamsChanged = true; + store.filter.skip = 0; + store.skip = 0; const { params: newParams } = await arrayData.addFilter({ params }); userParams.value = newParams; @@ -89,7 +91,9 @@ async function reload() { async function clearFilters() { isLoading.value = true; - + store.userParamsChanged = true; + store.filter.skip = 0; + store.skip = 0; // Filtrar los params no removibles const removableFilters = Object.keys(userParams.value).filter((param) => props.unremovableParams.includes(param) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 1aa99ea0c..4c38c1c1a 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -104,6 +104,8 @@ async function paginate() { await arrayData.loadMore(); if (!arrayData.hasMoreData.value) { + if (store.userParamsChanged) arrayData.hasMoreData.value = true; + store.userParamsChanged = false; isLoading.value = false; return; } @@ -129,9 +131,9 @@ async function onLoad(...params) { pagination.value.page = pagination.value.page + 1; await paginate(); - - const endOfPages = !arrayData.hasMoreData.value; - done(endOfPages); + let isDone = false; + if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value; + done(isDone); } @@ -172,7 +174,7 @@ async function onLoad(...params) { v-if="store.data" @load="onLoad" :offset="offset" - class="full-width full-height overflow-auto" + class="full-width full-height" >
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 9f66a0e89..3f031f1d1 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -142,7 +142,8 @@ export function useArrayData(key, userOptions) { userParams = sanitizerParams(userParams, store?.exprBuilder); store.userParams = userParams; - + store.skip = 0; + store.filter.skip = 0; await fetch({ append: false }); return { filter, params }; } diff --git a/src/pages/Claim/Card/ClaimNotes.vue b/src/pages/Claim/Card/ClaimNotes.vue index 35ecb0451..eeaffc85a 100644 --- a/src/pages/Claim/Card/ClaimNotes.vue +++ b/src/pages/Claim/Card/ClaimNotes.vue @@ -30,7 +30,7 @@ const body = {