Redesign sidebaru v planovaci, fix fullsreenu, zobrazovani mista kliku na mape
This commit is contained in:
@@ -33,7 +33,7 @@ const formData = reactive({
|
|||||||
id: props.flightPlan.aircraft.id, name: props.flightPlan.aircraft.callSign
|
id: props.flightPlan.aircraft.id, name: props.flightPlan.aircraft.callSign
|
||||||
} : null,
|
} : null,
|
||||||
plannedSpeed: props.flightPlan.plannedSpeed || 150,
|
plannedSpeed: props.flightPlan.plannedSpeed || 150,
|
||||||
description: props.flightPlan.description || null,
|
description: props.flightPlan.description || '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const {user} = storeToRefs(useLoggedUserStore());
|
const {user} = storeToRefs(useLoggedUserStore());
|
||||||
@@ -41,19 +41,23 @@ const {user} = storeToRefs(useLoggedUserStore());
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FormWrapper v-model="formData" :is-request-pending="isRequestPending">
|
<FormWrapper v-model="formData" :is-request-pending="isRequestPending">
|
||||||
<q-input v-model="formData.name" label="Jméno letu" v-if="!formData.isDefaultName" v-bind="commonProps"/>
|
|
||||||
<q-checkbox v-model="formData.isDefaultName" label="Použít automatické jméno"/>
|
<div class="row">
|
||||||
|
<div class="col-sm-8 col-md-10" v-if="!formData.isDefaultName">
|
||||||
|
<q-input v-model="formData.name" label="Jméno letu" v-bind="commonProps"/>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<q-checkbox v-model="formData.isDefaultName" label="Automatické jméno" v-bind="commonProps"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-checkbox v-model="formData.isPublic" label="Zveřejnit"/>
|
<q-checkbox v-model="formData.isPublic" label="Zveřejnit"/>
|
||||||
|
|
||||||
<CopyLinkButton
|
<CopyLinkButton
|
||||||
v-if="flightPlan.isPublic"
|
v-if="flightPlan.isPublic"
|
||||||
:route="{name: 'publicFlightPlanDetail', params: {username: user.publicUsername, id: flightPlan.id}}"
|
:route="{name: 'publicFlightPlanDetail', params: {username: user.publicUsername, id: flightPlan.id}}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-editor v-model="formData.description" label="Popis" v-bind="commonProps" />
|
<q-editor v-model="formData.description" label="Popis" v-bind="commonProps"/>
|
||||||
|
|
||||||
<!-- <q-checkbox v-model="formData.isEditableByCopilot" label="Kopilot může upravovat"/>-->
|
|
||||||
<DatetimePicker v-model="formData.plannedTakeoffDatetime" label="Plánovaný datum a čas vzletu" v-bind="commonProps"/>
|
<DatetimePicker v-model="formData.plannedTakeoffDatetime" label="Plánovaný datum a čas vzletu" v-bind="commonProps"/>
|
||||||
<ComboboxInput v-model="formData.aircraft" :options="aircrafts" label="Letadlo" v-bind="commonProps"/>
|
<ComboboxInput v-model="formData.aircraft" :options="aircrafts" label="Letadlo" v-bind="commonProps"/>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(["open", "change-insert-position", "fullscren-toggle"])
|
const emits = defineEmits(["open", "change-insert-position", "fullscreen-toggle"])
|
||||||
|
|
||||||
const {getDuration, getTotalDistance, getTotalDuration} = useFlightPlanCalculations();
|
const {getDuration, getTotalDistance, getTotalDuration} = useFlightPlanCalculations();
|
||||||
const totalDistance = computed(() => getTotalDistance(props.flightPlan));
|
const totalDistance = computed(() => getTotalDistance(props.flightPlan));
|
||||||
@@ -54,23 +54,23 @@ const totalDistance = computed(() => getTotalDistance(props.flightPlan));
|
|||||||
<q-item dense>
|
<q-item dense>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>{{ segment.from.name }}</q-item-label>
|
<q-item-label>{{ segment.from.name }}</q-item-label>
|
||||||
<q-item-label caption class="q-py-sm" v-if="segment.distance">
|
<q-item-label caption class="q-pa-sm q-ml-sm" style="border-left: solid 1px" v-if="segment.distance">
|
||||||
|
|
||||||
{{ segment.bearing }}°,
|
{{ segment.bearing }}°,
|
||||||
{{ segment.distance }} km,
|
{{ segment.distance }} km,
|
||||||
{{ minutesToHumanReadable(getDuration(segment.distance, props.flightPlan.plannedSpeed)) }}
|
{{ minutesToHumanReadable(getDuration(segment.distance, props.flightPlan.plannedSpeed)) }}
|
||||||
</q-item-label>
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="emits('change-insert-position', i+1)"
|
@click="emits('change-insert-position', i+1)"
|
||||||
icon="add"
|
icon="add"
|
||||||
size="xs"
|
size="xs"
|
||||||
:round="insertPosition !== i+1"
|
round
|
||||||
outline
|
class="q-ml-sm"
|
||||||
class="q-ml-lg q-mb-sm"
|
|
||||||
:color="insertPosition === i+1 ? 'primary' : 'grey'"
|
:color="insertPosition === i+1 ? 'primary' : 'grey'"
|
||||||
>
|
/>
|
||||||
<template v-if="insertPosition === i+1">Přidávám sem</template>
|
</q-item-label>
|
||||||
</q-btn>
|
<q-item-label>
|
||||||
|
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const {getIcon} = useFlightPlanUtils();
|
|||||||
const {searchPlaceName} = useGeocode()
|
const {searchPlaceName} = useGeocode()
|
||||||
|
|
||||||
const title = ref(null);
|
const title = ref(null);
|
||||||
|
const isOpened = ref(props.infoWindow.active);
|
||||||
watch(() => props.infoWindow.position, async () => {
|
watch(() => props.infoWindow.position, async () => {
|
||||||
if (props.infoWindow.title) {
|
if (props.infoWindow.title) {
|
||||||
title.value = props.infoWindow.title
|
title.value = props.infoWindow.title
|
||||||
@@ -57,7 +57,13 @@ const addPoint = () => {
|
|||||||
gpsLongitude: props.infoWindow.position.lng
|
gpsLongitude: props.infoWindow.position.lng
|
||||||
}
|
}
|
||||||
emits("add-to-route", point)
|
emits("add-to-route", point)
|
||||||
emits("close");
|
closeInfoWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeInfoWindow = () => {
|
||||||
|
emits('close');
|
||||||
|
isOpened.value = false;
|
||||||
|
console.log("is opened? ", isOpened.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const removePoint = () => {
|
const removePoint = () => {
|
||||||
@@ -95,7 +101,8 @@ const openedTab = ref("info");
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<InfoWindow
|
<InfoWindow
|
||||||
@close="emits('close')"
|
@close="closeInfoWindow"
|
||||||
|
v-model="isOpened"
|
||||||
:options="{position: infoWindow.position}"
|
:options="{position: infoWindow.position}"
|
||||||
>
|
>
|
||||||
<q-tabs v-model="openedTab">
|
<q-tabs v-model="openedTab">
|
||||||
@@ -201,17 +208,20 @@ const openedTab = ref("info");
|
|||||||
</q-btn>
|
</q-btn>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<CustomMarker :options="{position: infoWindow.position, anchorPoint: 'CENTER'}" v-if="isOpened">
|
||||||
|
<div class="info-window-position"></div>
|
||||||
|
</CustomMarker>
|
||||||
</InfoWindow>
|
</InfoWindow>
|
||||||
<CustomMarker :options="{position: infoWindow.position, anchorPoint: 'CENTER'}">
|
|
||||||
<div class="info-window-position"></div>
|
|
||||||
</CustomMarker>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.info-window-position {
|
.info-window-position {
|
||||||
border: solid 2px orange;
|
border: solid 4px orange;
|
||||||
|
outline: solid 1px black;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
padding: 3px;
|
padding: 4px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ const getAirspacesAtCoordinates = (clickCoordinates) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {infoWindowObject} = useFlightPlanObjects();
|
const {infoWindowObject} = useFlightPlanObjects();
|
||||||
const infoWindow = ref(infoWindowObject({}));
|
const infoWindow = ref({...infoWindowObject({})});
|
||||||
|
|
||||||
const openInfoWindow = (data) => {
|
const openInfoWindow = (data) => {
|
||||||
infoWindow.value = infoWindowObject({active: true, ...data});
|
infoWindow.value = infoWindowObject({active: true, ...data});
|
||||||
@@ -250,7 +250,7 @@ const isControlsOpened = ref(false);
|
|||||||
:max-zoom="13"
|
:max-zoom="13"
|
||||||
ref="mapRef"
|
ref="mapRef"
|
||||||
>
|
>
|
||||||
TODO: pridavani a odebirani z trasy resit pres slot
|
<!-- TODO: pridavani a odebirani z trasy resit pres slot-->
|
||||||
<AirspaceInfoWindow
|
<AirspaceInfoWindow
|
||||||
v-if="showInfoWindow && infoWindow.active"
|
v-if="showInfoWindow && infoWindow.active"
|
||||||
:info-window="infoWindow"
|
:info-window="infoWindow"
|
||||||
|
|||||||
@@ -98,8 +98,9 @@ const fullscreen = ref(false);
|
|||||||
<q-tab-panels v-model="openedTab">
|
<q-tab-panels v-model="openedTab">
|
||||||
<q-tab-panel name="route">
|
<q-tab-panel name="route">
|
||||||
<div :class="{row: true, fullscreen}">
|
<div :class="{row: true, fullscreen}">
|
||||||
<div class="col" style="min-width: 1px">
|
<div class="col map--wrapper" style="min-width: 1px">
|
||||||
<FlightPlanMap
|
<FlightPlanMap
|
||||||
|
class="map"
|
||||||
:insert-position="insertAtPosition"
|
:insert-position="insertAtPosition"
|
||||||
:airspace-data="airspacesData"
|
:airspace-data="airspacesData"
|
||||||
:airports="airports"
|
:airports="airports"
|
||||||
@@ -176,6 +177,14 @@ const fullscreen = ref(false);
|
|||||||
left: 0;
|
left: 0;
|
||||||
z-index: 2001;
|
z-index: 2001;
|
||||||
|
|
||||||
|
.map--wrapper {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.map {
|
||||||
|
height: 100vh !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.markers-control {
|
.markers-control {
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user