Help Slideover and trackingtrips

This commit is contained in:
2024-09-27 21:12:47 +02:00
parent f31e76ac3a
commit f9995505a8
4 changed files with 57 additions and 10 deletions

View File

@@ -43,6 +43,7 @@ const itemInfo = ref({
const oldItemInfo = ref({})
const profiles = ref([])
const projects = ref([])
//Functions
const setupPage = async () => {
@@ -56,6 +57,7 @@ const setupPage = async () => {
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
profiles.value = await useSupabaseSelect("profiles","*")
projects.value = await useSupabaseSelect("projects","*")
}
const cancelEditorCreate = () => {
@@ -102,8 +104,8 @@ const zoom = ref(6)
<template #center>
<h1
v-if="itemInfo"
:class="['text-xl','font-medium', ...itemInfo.fixed ? ['text-primary-500'] : ['text-rose-600'] ]"
>{{itemInfo ? `Fahrt vom: ${dayjs(itemInfo.startTime).format("DD.MM.YY HH:mm")} über ${(itemInfo.distance/1000).toFixed(2)} km` : '' }}</h1>
:class="['text-xl','font-medium' ]"
><UIcon name="i-heroicons-lock-closed" v-if="itemInfo.fixed"/><UIcon name="i-heroicons-lock-open" v-else/> {{itemInfo ? `Fahrt vom: ${dayjs(itemInfo.startTime).format("DD.MM.YY HH:mm")} über ${(itemInfo.distance/1000).toFixed(2)} km` : '' }} </h1>
</template>
<template #right>
<UButton
@@ -190,7 +192,13 @@ const zoom = ref(6)
</UCard>
<UCard class="mt-5">
<Map :markers="[[itemInfo.startLatitude, itemInfo.startLongitude],[itemInfo.endLatitude, itemInfo.endLongitude]]"/>
<Map :markers="[[itemInfo.startLatitude, itemInfo.startLongitude],[itemInfo.endLatitude, itemInfo.endLongitude]]"
:startMarker="[itemInfo.startLatitude, itemInfo.startLongitude]"
:endMarker="[itemInfo.endLatitude, itemInfo.endLongitude]"
/>
</UCard>
</div>
@@ -243,6 +251,17 @@ const zoom = ref(6)
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
v-model="itemInfo.project"
:options="projects"
option-attribute="name"
value-attribute="id"
/>
</UFormGroup>
<UFormGroup
label="Beschreibung:"
>

View File

@@ -43,6 +43,10 @@
@select="(i) => router.push(`/trackingTrips/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Fahrten anzuzeigen' }"
>
<template #fixed-data="{row}">
<UIcon name="i-heroicons-lock-closed" v-if="row.fixed"/>
<div v-else></div>
</template>
<template #licensePlate-data="{row}">
<span v-if="row === filteredRows[selectedItem]" class="font-bold text-primary-500">{{row.vehicle.licensePlate}}</span>
<span v-else>{{row.vehicle.licensePlate}}</span>
@@ -108,6 +112,10 @@ const setupPage = async () => {
setupPage()
const templateColumns = [
{
key: 'fixed',
label: ""
},
{
key: 'licensePlate',
label: "Kennzeichen:",