@@ -48,9 +48,9 @@ const projects = ref([])
|
||||
//Functions
|
||||
const setupPage = async () => {
|
||||
if(mode.value === "show" ){
|
||||
itemInfo.value = await useSupabaseSelectSingle("trackingtripsgen",route.params.id,"*, trackingDevice(*, vehicle(*))")
|
||||
itemInfo.value = await useSupabaseSelectSingle("trackingtrips",route.params.id,"*, trackingDevice(*, vehicle(*))")
|
||||
} else if(mode.value === "edit") {
|
||||
itemInfo.value = await useSupabaseSelectSingle("trackingtripsgen",route.params.id,"*")
|
||||
itemInfo.value = await useSupabaseSelectSingle("trackingtrips",route.params.id,"*")
|
||||
|
||||
}
|
||||
|
||||
@@ -141,6 +141,8 @@ const zoom = ref(6)
|
||||
</template>
|
||||
</UDashboardNavbar>
|
||||
|
||||
|
||||
|
||||
<UTabs
|
||||
:items="[{label: 'Informationen'}]"
|
||||
v-if="mode === 'show' && itemInfo.id"
|
||||
@@ -190,9 +192,9 @@ const zoom = ref(6)
|
||||
|
||||
</UCard>
|
||||
<UCard class="mt-5">
|
||||
<Map :markers="[[itemInfo.startLat, itemInfo.startLon],[itemInfo.endLat, itemInfo.endLon]]"
|
||||
:startMarker="[itemInfo.startLat, itemInfo.startLon]"
|
||||
:endMarker="[itemInfo.endLat, itemInfo.endLon]"
|
||||
<Map :markers="[[itemInfo.startLatitude, itemInfo.startLongitude],[itemInfo.endLatitude, itemInfo.endLongitude]]"
|
||||
:startMarker="[itemInfo.startLatitude, itemInfo.startLongitude]"
|
||||
:endMarker="[itemInfo.endLatitude, itemInfo.endLongitude]"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
@@ -57,12 +57,8 @@
|
||||
<template #endTime-data="{row}">
|
||||
{{dayjs(row.endTime).format("DD.MM.YY HH:mm")}}
|
||||
</template>
|
||||
<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 #distance-data="{row}">
|
||||
{{row.distance > 0 ? (row.distance/1000).toFixed(2) : 0 }} km
|
||||
</template>
|
||||
</UTable>
|
||||
</template>
|
||||
@@ -110,8 +106,7 @@ const items = ref([])
|
||||
const selectedItem = ref(0)
|
||||
|
||||
const setupPage = async () => {
|
||||
items.value = await useSupabaseSelect("trackingtripsgen","*, trackingDevice(*), vehicle(*)","startTime",false)
|
||||
console.log(items.value)
|
||||
items.value = await useSupabaseSelect("trackingtrips","*, trackingDevice(*), vehicle (*)","startTime",false)
|
||||
}
|
||||
|
||||
setupPage()
|
||||
@@ -142,13 +137,9 @@ const templateColumns = [
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "gpsDistance",
|
||||
key: "distance",
|
||||
label: "Entfernung:",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "usedFuel",
|
||||
label: "Kraftstoff:"
|
||||
}
|
||||
]
|
||||
const selectedColumns = ref(templateColumns)
|
||||
|
||||
Reference in New Issue
Block a user