Start for Dev Branch

This commit is contained in:
2024-12-20 18:46:52 +01:00
parent a6c1eaf69f
commit acf5d1c2ea
16 changed files with 599 additions and 171 deletions

View File

@@ -48,9 +48,9 @@ const projects = ref([])
//Functions
const setupPage = async () => {
if(mode.value === "show" ){
itemInfo.value = await useSupabaseSelectSingle("trackingtrips",route.params.id,"*, trackingDevice(*, vehicle(*))")
itemInfo.value = await useSupabaseSelectSingle("trackingtripsgen",route.params.id,"*, trackingDevice(*, vehicle(*))")
} else if(mode.value === "edit") {
itemInfo.value = await useSupabaseSelectSingle("trackingtrips",route.params.id,"*")
itemInfo.value = await useSupabaseSelectSingle("trackingtripsgen",route.params.id,"*")
}
@@ -141,8 +141,6 @@ const zoom = ref(6)
</template>
</UDashboardNavbar>
<UTabs
:items="[{label: 'Informationen'}]"
v-if="mode === 'show' && itemInfo.id"
@@ -192,9 +190,9 @@ const zoom = ref(6)
</UCard>
<UCard class="mt-5">
<Map :markers="[[itemInfo.startLatitude, itemInfo.startLongitude],[itemInfo.endLatitude, itemInfo.endLongitude]]"
:startMarker="[itemInfo.startLatitude, itemInfo.startLongitude]"
:endMarker="[itemInfo.endLatitude, itemInfo.endLongitude]"
<Map :markers="[[itemInfo.startLat, itemInfo.startLon],[itemInfo.endLat, itemInfo.endLon]]"
:startMarker="[itemInfo.startLat, itemInfo.startLon]"
:endMarker="[itemInfo.endLat, itemInfo.endLon]"
/>

View File

@@ -57,8 +57,12 @@
<template #endTime-data="{row}">
{{dayjs(row.endTime).format("DD.MM.YY HH:mm")}}
</template>
<template #distance-data="{row}">
{{row.distance > 0 ? (row.distance/1000).toFixed(2) : 0 }} km
<template #gpsDistance-data="{row}">
{{row.gpsDistance > 0 ? (row.gpsDistance/1000).toFixed(2) : 0 }} km
</template>
<template #usedFuel-data="{row}">
<span v-if="row.endFuelLevel - row.startFuelLevel < 0">{{row.endFuelLevel - row.startFuelLevel}} / {{(row.vehicle.tankSize / 100 * Math.abs(row.endFuelLevel - row.startFuelLevel)).toFixed(2)}}</span>
<span v-else>0</span>
</template>
</UTable>
</template>
@@ -106,7 +110,8 @@ const items = ref([])
const selectedItem = ref(0)
const setupPage = async () => {
items.value = await useSupabaseSelect("trackingtrips","*, trackingDevice(*), vehicle (*)","startTime",false)
items.value = await useSupabaseSelect("trackingtripsgen","*, trackingDevice(*), vehicle(*)","startTime",false)
console.log(items.value)
}
setupPage()
@@ -137,9 +142,13 @@ const templateColumns = [
sortable: true
},
{
key: "distance",
key: "gpsDistance",
label: "Entfernung:",
sortable: true
},
{
key: "usedFuel",
label: "Kraftstoff:"
}
]
const selectedColumns = ref(templateColumns)