#7136 - Enable paginate event in VnSelectFilter #255

Closed
jsegarra wants to merge 86 commits from 7136_vnselectFilter_paginate into dev
2 changed files with 6 additions and 12 deletions
Showing only changes of commit 7292dca197 - Show all commits

View File

@ -36,10 +36,10 @@ const $props = defineProps({
const emit = defineEmits(['onFetch']);
defineExpose({ fetch });
const fetchData = useFetchData({ ...$props });
// const fetchData = useFetchData({ ...$props });
onMounted(async () => {
if ($props.autoLoad) {
await fetchData.fetch();
await fetch();
}
});

View File

@ -7,11 +7,10 @@ import { useRole } from 'src/composables/useRole';
import FormModel from 'components/FormModel.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import { useArrayData } from 'src/composables/useArrayData';
import FetchData from 'components/FetchData.vue';
import { useAxios } from 'src/composables/useAxios';
const { hasAny } = useRole();
const { t } = useI18n();
const fetchData = ref();
const originaLockerId = ref();
const lockers = ref([]);
const { store } = useArrayData('Worker');
@ -27,21 +26,14 @@ const save = async (data) => {
const lockerId = data.id ?? originaLockerId.value;
const workerFk = lockerId == originaLockerId.value ? null : entityId.value;
return axios.patch(`Lockers/${lockerId}`, { workerFk });
return useAxios(`Lockers/${lockerId}`).push('PATCH', { workerFk });
};
const init = async (data) => {
await fetchData.value.fetch();
originaLockerId.value = data.id;
};
</script>
<template>
<FetchData
ref="fetchData"
url="Lockers/codes"
:filter="filter"
@on-fetch="(data) => (lockers = data)"
/>
<FormModel
:url="`Workers/${entityId}/locker`"
model="worker"
@ -51,6 +43,8 @@ const init = async (data) => {
>
<template #form="{ data }">
<VnSelect
url="Lockers/codes"
:filter="filter"
:label="t('Locker')"
v-model="data.id"
:options="lockers"