Vkladani mista na konkretni pozici

This commit is contained in:
Michal Kváček
2024-04-18 16:37:46 +02:00
parent de0b75163d
commit bc0b5e2f15
6 changed files with 132 additions and 64 deletions
@@ -29,6 +29,7 @@ import PublishButton from "components/inputs/PublishButton.vue";
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
import {TOGGLE_FLIGHT_PUBLISH} from "src/graphql/mutations/flight";
import {useAirspacesStore} from "stores/Airspaces";
import {useAirportsStore} from "stores/Airports";
const flightId = parseInt(useRoute().params.id);
const loggedUser = storeToRefs(useLoggedUserStore()).user;
@@ -53,9 +54,11 @@ const handleDeleteAndRedirect = () => {
});
};
const {airspaces: airspacesData} = storeToRefs(useAirspacesStore());
const {airspaces} = storeToRefs(useAirspacesStore());
const {airports} = storeToRefs(useAirportsStore());
onMounted(() => {
useAirspacesStore().fetch();
useAirportsStore().fetch();
});
const togglePublicVisibility = (variables) => toggleVisibility({
@@ -147,7 +150,8 @@ const togglePublicVisibility = (variables) => toggleVisibility({
<q-no-ssr v-else>
<FlightTrackMap
:airspaces-data="airspacesData"
:airspaces-data="airspaces"
:airports="airports"
:flight="flight"
:photos="flight.photos"
/>
@@ -77,7 +77,7 @@ const handleMarkersChanges = (markers) => {
};
const handleFlightPlanInfoSave = () => useFlightPlansStore().update(flightPlan.value.id, formData.value);
const insertAtPosition = ref(flightPlanMarkers.value.length);
</script>
<template>
@@ -98,16 +98,20 @@ const handleFlightPlanInfoSave = () => useFlightPlansStore().update(flightPlan.v
<div class="row">
<div class="col" style="min-width: 1px">
<FlightPlanMap
:insert-position="insertAtPosition"
:airspace-data="airspacesData"
:airports="airports"
:points-of-interest="pointsOfInterest"
:flight-plan="flightPlan"
@change-insert-position="insertAtPosition = $event"
@markers-changed="handleMarkersChanges"
/>
</div>
<div class="col-12 col-md-5 col-lg-3">
<FlightPlanMarkersList
:insert-position="insertAtPosition"
:flight-plan="flightPlan"
@change-insert-position="insertAtPosition = $event"
@open="flightPlannerDialogOpen=true"
/>
</div>
@@ -77,7 +77,11 @@ useMeta(() => metaData({
<q-no-ssr>
<q-inner-loading v-if="arePhotosLoading"/>
<PhotoGallery :photos="flightPhotos" v-else-if="!arePhotosLoading && flightPhotos.length > 0"/>
<FlightTrackMap :key="flight.id" :flight="flight" :photos="flightPhotos"/>
<FlightTrackMap
:key="flight.id"
:flight="flight"
:showLayerControls="false"
:photos="flightPhotos"/>
</q-no-ssr>
</q-card-section>
</template>