Prepracovana prace s datem, lepsi input na datetime
This commit is contained in:
@@ -42,10 +42,10 @@ const confirmDelete = (id) => {
|
||||
<template v-else>
|
||||
<q-breadcrumbs>
|
||||
<q-breadcrumbs-el :to="{name: 'aircrafts'}">Letadla</q-breadcrumbs-el>
|
||||
<q-breadcrumbs-el>{{ aircraft.name }}</q-breadcrumbs-el>
|
||||
<q-breadcrumbs-el>{{ aircraft.callSign }}</q-breadcrumbs-el>
|
||||
</q-breadcrumbs>
|
||||
|
||||
<h1>{{ aircraft.name }}</h1>
|
||||
<h1>{{ aircraft.callSign }}</h1>
|
||||
|
||||
{{ aircraft.photoUrl }}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import {useRoute} from "vue-router";
|
||||
import {onMounted, reactive, ref} from "vue";
|
||||
import {formatDate, minutesToHumanReadable} from "src/composables/datetimeUtils";
|
||||
import {formatDatetime, minutesToHumanReadable} from "src/composables/datetimeUtils";
|
||||
import FlightDetailSkeleton from "components/flights/FlightDetailSkeleton.vue";
|
||||
import AddFAB from "components/AddFAB.vue";
|
||||
|
||||
@@ -27,13 +27,13 @@ onMounted(() => {
|
||||
<article v-html="flight.description" />
|
||||
|
||||
<q-icon name="calendar"/>
|
||||
{{ formatDate(flight.takeoffDatetime) }}
|
||||
{{ formatDatetime(flight.takeoffDatetime) }}
|
||||
{{ minutesToHumanReadable(flight.durationMinCalculated) }}
|
||||
|
||||
<!-- <q-icon name="weather"/>-->
|
||||
<!-- Clouds: few-->
|
||||
<!-- Wind: 220/12kt-->
|
||||
<!-- Temp: 12°C-->
|
||||
<!-- <q-icon name="weather"/>-->
|
||||
<!-- Clouds: few-->
|
||||
<!-- Wind: 220/12kt-->
|
||||
<!-- Temp: 12°C-->
|
||||
|
||||
|
||||
<AddFAB :router-link="{name: 'flightEdit', params:{id: flight.id}}" label="Upravit"/>
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
<q-skeleton v-if="!loadedAircraft"/>
|
||||
|
||||
<template v-if="loadedAircraft">
|
||||
<h1>Editace letadla {{ loadedAircraft.name }}</h1>
|
||||
<h1>Editace letadla {{ loadedAircraft.callSign }}</h1>
|
||||
|
||||
<AircraftForm @save="handleSave" :default-values="loadedAircraft" :is-request-pending="isRequestPending"/>
|
||||
</template>
|
||||
|
||||
@@ -14,6 +14,7 @@ import FlightFormCopilot from "components/flights/form/FlightFormCopilot.vue";
|
||||
import {useSecondPilotsStore} from "stores/SecondPilots";
|
||||
import FlightFormNotes from "components/flights/form/FlightFormNotes.vue";
|
||||
import FlightFormPhotos from "components/flights/form/FlightFormPhotos.vue";
|
||||
import {usePhotosStore} from "stores/Photo";
|
||||
|
||||
useMeta({title: "Editace letu"});
|
||||
|
||||
@@ -45,7 +46,6 @@ onMounted(() => {
|
||||
|
||||
useAircraftsStore().fetch();
|
||||
usePointsOfInterestStore().fetch();
|
||||
useFlightsStore().fetch();
|
||||
useAirportsStore().fetch();
|
||||
useSecondPilotsStore().fetch();
|
||||
|
||||
@@ -59,6 +59,22 @@ const handleFlightEdit = (data) => {
|
||||
fetchFlight(flightId);
|
||||
})
|
||||
}
|
||||
|
||||
const handlePhotosUpload = (data) => {
|
||||
|
||||
console.log(data);
|
||||
|
||||
const promises = [];
|
||||
for (const photo of data.photos) {
|
||||
promises.push(usePhotosStore().upload(flightId, {photo}));
|
||||
}
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
$q.notify({message: "Uspesne nahrano", position: "top", color: "positive"});
|
||||
|
||||
fetchFlight(flightId);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -90,8 +106,9 @@ const handleFlightEdit = (data) => {
|
||||
|
||||
<q-tab-panel name="photos">
|
||||
<FlightFormPhotos
|
||||
@save="handleFlightEdit"
|
||||
:flight="flight" />
|
||||
:flight="flight"
|
||||
@save="handlePhotosUpload"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="notes">
|
||||
|
||||
@@ -6,7 +6,6 @@ import {useRouter} from "vue-router";
|
||||
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useMeta} from "quasar";
|
||||
import FlightForm from "components/flights/__FlightForm.vue";
|
||||
import {useAirportsStore} from "stores/Airports";
|
||||
import FlightFormSteps from "components/flights/form/FlightFormSteps.vue";
|
||||
import FlightFormBasic from "components/flights/form/FlightFormBasic.vue";
|
||||
|
||||
Reference in New Issue
Block a user