fix: refs #7524 dynamic fetch
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-02-06 10:09:30 +01:00
parent a88696d590
commit 80337c61df
1 changed files with 4 additions and 23 deletions

View File

@ -1,35 +1,16 @@
<script setup>
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'src/components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { QCheckbox } from 'quasar';
import VnInputTime from 'src/components/common/VnInputTime.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const route = useRoute();
const { t } = useI18n();
const agencyFilter = {
fields: ['id', 'name'],
order: 'name ASC',
limit: 30,
};
const agencyOptions = ref([]);
</script>
<template>
<FetchData
:filter="agencyFilter"
@on-fetch="(data) => (agencyOptions = data)"
auto-load
url="AgencyModes/isActive"
/>
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
<FormModel :url="`Zones/${$route.params.id}`" auto-load model="zone">
<template #form="{ data, validate }">
<VnRow>
<VnInput
@ -42,16 +23,16 @@ const agencyOptions = ref([]);
<VnRow>
<VnSelect
option-label="name"
option-value="id"
v-model="data.agencyModeFk"
:rules="validate('zone.agencyModeFk')"
:options="agencyOptions"
url="AgencyModes/isActive"
:fields="['id', 'name']"
:label="t('Agency')"
emit-value
map-options
use-input
hide-bottom-space
sort-by="name"
/>
<VnInput
class="mw-10"