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