Upravy UI, refaktoring, davkove upravy a mazani fotek
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import {onMounted} from "vue";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {useAircraftsStore} from "stores/Aircrafts";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import {useRouter} from "vue-router";
|
||||
@@ -9,13 +9,20 @@ import {useAirportsStore} from "stores/Airports";
|
||||
import FlightFormSteps from "components/flights/form/FlightFormSteps.vue";
|
||||
import FlightFormBasic from "components/flights/form/FlightFormBasic.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {isRequestPending} from "src/composables/objects/flight";
|
||||
import FlightEditSkeleton from "components/flights/FlightEditSkeleton.vue";
|
||||
|
||||
|
||||
const loading = ref(true);
|
||||
onMounted(() => {
|
||||
useAircraftsStore().fetch();
|
||||
usePointsOfInterestStore().fetch();
|
||||
useFlightsStore().fetch();
|
||||
useAirportsStore().fetch();
|
||||
const promises = [
|
||||
useAircraftsStore().fetch(),
|
||||
usePointsOfInterestStore().fetch(),
|
||||
useFlightsStore().fetch(),
|
||||
useAirportsStore().fetch(),
|
||||
];
|
||||
|
||||
loading.value = true;
|
||||
Promise.all(promises).finally(() => loading.value = false);
|
||||
|
||||
useAppStore().setPageTitle("Nový let");
|
||||
useAppStore().setBreadcrumbs([
|
||||
@@ -38,10 +45,15 @@ const handleSave = (formData) => {
|
||||
|
||||
<template>
|
||||
<FlightFormSteps :disabled="['copilot', 'track', 'photos', 'notes']"/>
|
||||
<FlightFormBasic
|
||||
@save="handleSave"
|
||||
:aircrafts="aircrafts"
|
||||
:airports="airports"
|
||||
:locations="locations"
|
||||
/>
|
||||
|
||||
<FlightEditSkeleton v-if="loading"/>
|
||||
<template v-else>
|
||||
<FlightFormBasic
|
||||
@save="handleSave"
|
||||
:is-request-pending="isRequestPending"
|
||||
:aircrafts="aircrafts"
|
||||
:airports="airports"
|
||||
:locations="locations"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user