Changed STore Type and corrected all Pages

Added HistoryDisplay.vue
Added NumberRanges
This commit is contained in:
2023-12-27 21:52:55 +01:00
parent 9e092823e4
commit c41b99f29d
33 changed files with 1094 additions and 812 deletions

View File

@@ -90,14 +90,14 @@
label="Benutzer ändern:"
>
<USelectMenu
:options="profiles"
:options="dataStore.profiles"
@change="updateTask"
v-model="taskData.user"
option-attribute="firstName"
value-attribute="id"
>
<template #label>
{{profiles.find(profile => profile.id === taskData.user) ? profiles.find(profile => profile.id === taskData.user).firstName : 'Kein Benutzer ausgewählt'}}
{{dataStore.profiles.find(profile => profile.id === taskData.user) ? dataStore.profiles.find(profile => profile.id === taskData.user).fullName : 'Kein Benutzer ausgewählt'}}
</template>
</USelectMenu>
</UFormGroup>
@@ -130,7 +130,7 @@
{{ dayjs(row.created_at).format("DD.MM.YY HH:mm") }}
</template>
<template #user-data="{row}">
{{profiles.find(profile => profile.id === row.user ) ? profiles.find(profile => profile.id === row.user ).firstName : row.user}}
{{dataStore.profiles.find(profile => profile.id === row.user ) ? dataStore.profiles.find(profile => profile.id === row.user ).fullName : row.user}}
</template>
</UTable>
@@ -148,10 +148,9 @@ definePageMeta({
middleware: "auth",
})
const dataStore = useDataStore()
const toast = useToast()
const supabase = useSupabaseClient()
const {tasks, profiles} = storeToRefs(useDataStore())
const {fetchTasks} = useDataStore()
const taskColumns = [
{
@@ -185,7 +184,7 @@ const showDoneTasks = ref(false)
const searchString = ref("")
const filteredRows = computed(() => {
let filteredTasks = tasks.value.filter(task => !showDoneTasks.value ? task.categorie !== "Erledigt" : task.categorie === "Erledigt")
let filteredTasks = dataStore.tasks.value.filter(task => !showDoneTasks.value ? task.categorie !== "Erledigt" : task.categorie === "Erledigt")
if(!searchString.value) {
return filteredTasks
@@ -224,7 +223,7 @@ const createTask = async () => {
showCreateTask.value = false
createTaskData.value = {}
fetchTasks()
dataStore.fetchTasks()
}
const updateTask = async () => {
@@ -243,7 +242,7 @@ const updateTask = async () => {
toast.add({title: "Aufgabe aktualisiert"})
taskData.value = {}
showTaskModal.value = false
fetchTasks()
dataStore.fetchTasks()
}
}