Drobne upravy ve vizualu, oprava comboboxu, funkcni prakticky cela editace letu

This commit is contained in:
Michal Kváček
2023-07-18 10:21:40 +02:00
parent 2d76d136cf
commit 4648c30f90
21 changed files with 233 additions and 132 deletions
@@ -4,7 +4,7 @@ import {useRoute} from "vue-router";
import {onMounted, reactive, ref} from "vue";
import {formatDatetime, minutesToHumanReadable} from "src/composables/datetimeUtils";
import FlightDetailSkeleton from "components/flights/FlightDetailSkeleton.vue";
import AddFAB from "components/AddFAB.vue";
import FAB from "components/FAB.vue";
const route = useRoute();
const loading = ref(false)
@@ -36,6 +36,6 @@ onMounted(() => {
<!-- Temp: 12°C-->
<AddFAB :router-link="{name: 'flightEdit', params:{id: flight.id}}" label="Upravit"/>
<FAB mode="edit" :router-link="{name: 'flightEdit', params:{id: flight.id}}"/>
</template>
</template>
@@ -1,12 +1,12 @@
<script setup>
import {useSecondPilotsStore} from "stores/SecondPilots";
import {useCopilotsStore} from "stores/Copilots";
import {useRoute} from "vue-router";
import {useFlightsStore} from "stores/Flights";
import {computed, onMounted} from "vue";
import {storeToRefs} from "pinia";
import {minutesToHumanReadable} from "src/composables/datetimeUtils";
const secondPilotStore = useSecondPilotsStore();
const secondPilotStore = useCopilotsStore();
const flightsStore = useFlightsStore();
const route = useRoute();
+3 -4
View File
@@ -11,7 +11,7 @@ import {useMeta, useQuasar} from "quasar";
import {storeToRefs} from "pinia";
import {flightName} from "src/composables/flight";
import FlightFormCopilot from "components/flights/form/FlightFormCopilot.vue";
import {useSecondPilotsStore} from "stores/SecondPilots";
import {useCopilotsStore} from "stores/Copilots";
import FlightFormNotes from "components/flights/form/FlightFormNotes.vue";
import FlightFormPhotos from "components/flights/form/FlightFormPhotos.vue";
import {usePhotosStore} from "stores/Photo";
@@ -29,7 +29,7 @@ const flightId = parseInt(route.params.id);
const aircrafts = storeToRefs(useAircraftsStore()).items;
const locations = storeToRefs(usePointsOfInterestStore()).items;
const airports = storeToRefs(useAirportsStore()).items;
const copilots = storeToRefs(useSecondPilotsStore()).items;
const copilots = storeToRefs(useCopilotsStore()).items;
let flight = ref({});
const disabledSteps = computed(() => flight.value.solo ? ["copilot"] : [flight.value.solo]);
@@ -51,13 +51,12 @@ onMounted(() => {
useAircraftsStore().fetch();
usePointsOfInterestStore().fetch();
useAirportsStore().fetch();
useSecondPilotsStore().fetch();
useCopilotsStore().fetch();
fetchFlight(flightId);
});
const handleFlightEdit = (data) => {
console.log(data);
useFlightsStore().update(flightId, data).then(() => {
$q.notify(successObject("Úspěšně upraveno"));
fetchFlight(flightId);
+2 -2
View File
@@ -3,7 +3,7 @@ import {useAircraftsStore} from "stores/Aircrafts";
import {onMounted, ref} from "vue";
import {storeToRefs} from "pinia";
import AircraftsList from "components/aircrafts/AircraftsList.vue";
import AddFAB from "components/AddFAB.vue";
import AddFAB from "components/FAB.vue";
import AircraftsListSkeleton from "components/aircrafts/AircraftsListSkeleton.vue";
const aircraftStore = useAircraftsStore();
@@ -24,5 +24,5 @@ onMounted(() => {
<AircraftsListSkeleton v-if="loading" />
<AircraftsList :items="aircrafts" v-if="!loading"/>
<AddFAB :router-link="{name: 'addAircraft'}"/>
<AddFAB mode="add" :router-link="{name: 'addAircraft'}"/>
</template>
+2 -2
View File
@@ -5,7 +5,7 @@ import {useMeta} from "quasar";
import FlightsList from "components/flights/FlightsList.vue";
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
import {storeToRefs} from "pinia";
import AddFAB from "components/AddFAB.vue";
import AddFAB from "components/FAB.vue";
useMeta({title: "Moje lety"});
@@ -39,5 +39,5 @@ onMounted(() => {
<FlightsList :items="flights" v-else/>
<AddFAB :router-link="{name: 'addFlight'}"/>
<AddFAB mode="add" :router-link="{name: 'addFlight'}"/>
</template>
+2 -2
View File
@@ -1,9 +1,9 @@
<script setup>
import {storeToRefs} from "pinia";
import {useSecondPilotsStore} from "stores/SecondPilots";
import {useCopilotsStore} from "stores/Copilots";
import {onMounted} from "vue";
const pilotsStore = useSecondPilotsStore();
const pilotsStore = useCopilotsStore();
onMounted(() => {
pilotsStore.fetch();