54 lines
1.7 KiB
Vue
54 lines
1.7 KiB
Vue
<script setup>
|
|
import DatetimePicker from "components/inputs/DatetimePicker.vue";
|
|
import {computed, reactive} from "vue";
|
|
import {commonProps} from "src/composables/inputs";
|
|
import FormWrapper from "components/FormWrapper.vue";
|
|
import {useFlightPlanCalculations, useFlightPlanUtils} from "src/composables/flightPlan";
|
|
|
|
const props = defineProps({
|
|
flightPlan: {
|
|
type: Object,
|
|
required: true
|
|
}
|
|
});
|
|
|
|
const {getTotalDuration} = useFlightPlanCalculations();
|
|
|
|
const formData = reactive({
|
|
gpxTrackFile: null,
|
|
takeoffDatetime: props.flightPlan.plannedTakeoffDatetime,
|
|
landingDatetime: new Date((new Date(props.flightPlan.plannedTakeoffDatetime)).getTime() + 60 * 1000 * getTotalDuration(props.flightPlan)),
|
|
copyTrack: true,
|
|
createPointsOfInterests: true,
|
|
flightPlan: props.flightPlan,
|
|
});
|
|
|
|
const {getMarkersFrom} = useFlightPlanUtils();
|
|
|
|
const hasGeocodeInTrack = computed(() => {
|
|
return !!getMarkersFrom(props.flightPlan).find(point => point.type === 'geocode');
|
|
});
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<FormWrapper v-model="formData" :save-button="{label: 'Vytvořit let z plánu', icon: 'save'}">
|
|
<template v-if="!formData.gpxTrackFile">
|
|
<DatetimePicker v-model="formData.takeoffDatetime" label="Čas vzletu"/>
|
|
<DatetimePicker v-model="formData.landingDatetime" label="Čas přistání"/>
|
|
</template>
|
|
|
|
<q-file
|
|
v-bind="commonProps"
|
|
v-model="formData.gpxTrackFile"
|
|
label="Trasa v GPX"
|
|
hint="Z trasy se načtou letiště a časy vzletu a přistání. Tyto hodnoty je možné později upravit."
|
|
/>
|
|
|
|
<q-checkbox
|
|
v-model="formData.copyTrack"
|
|
label="Zkopírovat otočné body (letiště a POI)?"
|
|
/>
|
|
</FormWrapper>
|
|
</template>
|