refs #7136 use paginate when url exists
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Javier Segarra 2024-04-05 13:59:23 +02:00
parent 3159c1c049
commit 243d66b592
2 changed files with 40 additions and 44 deletions

View File

@ -60,7 +60,7 @@ const $props = defineProps({
},
limit: {
type: [Number, String],
default: '30',
default: '4',
},
fetchRef: {
type: Object,
@ -165,11 +165,12 @@ async function onScroll(scrollEv) {
const lastIndex = myOptions.value.length - 1;
const optionIndex = ref.getOptionIndex();
if (!$props.fetchRef) return;
if (!$props.url && !$props.fetchRef) return;
if (direction === 'decrease') return;
if (optionIndex > 0 && to === lastIndex && isLoading.value === false) {
isLoading.value = true;
await $props.fetchRef.paginate();
!$props.url && (await $props.fetchRef.paginate());
$props.url && (await dataRef.value.paginate());
}
}
</script>

View File

@ -30,7 +30,6 @@ const suppliersRef = ref();
limit="30"
auto-load
@on-fetch="(data) => (suppliers = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
@ -71,19 +70,15 @@ const suppliersRef = ref();
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('From')"
v-model="params.from"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
</QItemSection>
</QItem>
<QItemSection>
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
@ -115,33 +110,33 @@ const suppliersRef = ref();
</QItem>
<QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
v-model="params.fi"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.serialNumber')"
v-model="params.serialNumber"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
v-model="params.fi"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.serialNumber')"
v-model="params.serialNumber"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput