This commit is contained in:
2024-03-03 20:38:59 +01:00
parent b4b70d8e7c
commit 8e69cda09b
84 changed files with 43 additions and 33167 deletions

View File

@@ -37,23 +37,21 @@
</UDashboardToolbar>
<div class="table">
<UTable
:rows="filteredRows"
:columns="columns"
class="w-full"
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
@select="(i) => router.push(`/services/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }"
>
<template #sellingPrice-data="{row}">
{{row.sellingPrice ? Number(row.sellingPrice).toFixed(2) + " €" : ""}}
</template>
<template #unit-data="{row}">
{{dataStore.units.find(unit => unit.id === row.unit) ? dataStore.units.find(unit => unit.id === row.unit).name : row.unit}}
</template>
</UTable>
</div>
<UTable
:rows="filteredRows"
:columns="columns"
class="w-full"
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
@select="(i) => router.push(`/services/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }"
>
<template #sellingPrice-data="{row}">
{{row.sellingPrice ? Number(row.sellingPrice).toFixed(2) + " €" : ""}}
</template>
<template #unit-data="{row}">
{{dataStore.units.find(unit => unit.id === row.unit) ? dataStore.units.find(unit => unit.id === row.unit).name : row.unit}}
</template>
</UTable>
</template>

View File

@@ -3,7 +3,7 @@ import dayjs from "dayjs";
const dataStore = useDataStore()
const timeColumns = [
const templateColumns = [
{
key: "state",
label: "Status"
@@ -20,8 +20,13 @@ const timeColumns = [
}, {
key: "end",
label: "Ende"
}, {
key: "device",
label: "Gerät"
}
]
const selectedColumns = ref(templateColumns)
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
</script>
@@ -29,13 +34,33 @@ const timeColumns = [
<UDashboardNavbar title="Anwesenheiten">
</UDashboardNavbar>
<UDashboardToolbar>
<template #right>
<USelectMenu
v-model="selectedColumns"
icon="i-heroicons-adjustments-horizontal-solid"
:options="templateColumns"
multiple
class="hidden lg:block"
by="key"
>
<template #label>
Spalten
</template>
</USelectMenu>
</template>
</UDashboardToolbar>
<UTable
:rows="dataStore.workingtimes"
:columns="timeColumns"
:columns="columns"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Anwesenheiten anzuzeigen' }"
>
<template #user-data="{row}">
{{dataStore.getProfileById(row.user).fullName }}
</template>
<template #device-data="{row}">
<!-- TODO: Load devices -->
</template>
</UTable>
</template>