Corrected Empty Slot for Tables

This commit is contained in:
2023-12-21 16:17:43 +01:00
parent 1573cb2b1e
commit 3625db30ec
10 changed files with 210 additions and 216 deletions

View File

@@ -17,7 +17,7 @@
:rows="filteredRows"
:columns="itemColumns"
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #customer-data="{row}">
{{customers.find(customer => customer.id === row.customer) ? customers.find(customer => customer.id === row.customer).name : row.customer }}

View File

@@ -18,6 +18,7 @@
:columns="customerColumns"
@select="selectCustomer"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/>
</div>

View File

@@ -16,7 +16,7 @@
:rows="filteredRows"
:columns="itemColumns"
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/>

View File

@@ -7,7 +7,7 @@
:rows="jobs"
:columns="columns"
@select="selectJob"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/>
</div>

View File

@@ -16,6 +16,7 @@
:rows="filteredRows"
:columns="itemColumns"
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #tags-data="{row}">
<UBadge

View File

@@ -124,6 +124,7 @@
:rows="filteredRows"
:columns="taskColumns"
@select="inspectTask"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #created_at-data="{row}">
{{ dayjs(row.created_at).format("DD.MM.YY HH:mm") }}

View File

@@ -24,6 +24,18 @@ const timeInfo = ref({
type: null
})
const filteredRows = computed(() => {
if(user.value && times.value) {
return times.value.filter(time => time.user === user.value.id)
} else {
return []
}
})
const createTimeInfo = ref({
user: "",
start: new Date(),
@@ -65,13 +77,9 @@ const columns = [
}
]
const runningTimeInfo = ref({
})
const runningTimeInfo = ref({})
const showAddTimeModal = ref(false)
const addTimeInfo = ref({
})
const startTime = async () => {
@@ -160,7 +168,7 @@ const selectStartedTime = () => {
</script>
<template>
<div>
<div class="flex items-center gap-1">
<UButton
class="controlButton"
@click="startTime"
@@ -175,18 +183,56 @@ const selectStartedTime = () => {
>
Stop
</UButton>
<!--<UButton
class="controlButton"
@click="selectStartedTime"
>
Zeit Wählen
</UButton>-->
<UButton
class="controlButton"
@click="showAddTimeModal = true"
>
Erstellen
</UButton>
</div>
<div v-if="runningTimeInfo.id" class="mt-3">
Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}}
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="runningTimeInfo.notes"
/>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
:options="projects"
option-attribute="name"
value-attribute="id"
v-model="runningTimeInfo.projectId"
>
<template #label>
{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "Projekt auswählen" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Kategorie:"
>
<USelectMenu
v-model="runningTimeInfo.type"
:options="timeTypes"
option-attribute="label"
value-attribute="label"
>
<template #label>
{{runningTimeInfo.type ? runningTimeInfo.type : "Kategorie auswählen"}}
</template>
</USelectMenu>
</UFormGroup>
</div>
<UModal
v-model="showAddTimeModal"
@@ -294,66 +340,13 @@ const selectStartedTime = () => {
</UCard>
</UModal>
<div>
<div v-if="runningTimeInfo.id" class="mt-3">
Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}}
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="runningTimeInfo.notes"
/>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
:options="projects"
option-attribute="name"
value-attribute="id"
v-model="runningTimeInfo.projectId"
>
<template #label>
{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "Projekt auswählen" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Kategorie:"
>
<USelectMenu
v-model="runningTimeInfo.type"
:options="timeTypes"
option-attribute="label"
value-attribute="label"
>
<template #label>
{{runningTimeInfo.type ? runningTimeInfo.type : "Kategorie auswählen"}}
</template>
</USelectMenu>
</UFormGroup>
</div>
</div>
<UDivider class="mt-3"/>
<UTable
class="mt-3"
v-if="times && user"
:columns="columns"
:rows="times.filter(time => time.user === user.id)"
:rows="filteredRows"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #user-data="{row}">
{{profiles.find(profile => profile.id === row.user) ? profiles.find(profile => profile.id === row.user).firstName + " " + profiles.find(profile => profile.id === row.user).lastName : row.user }}
@@ -369,8 +362,6 @@ const selectStartedTime = () => {
{{projects.find(project => project.id === row.projectId) ? projects.find(project => project.id === row.projectId).name : ""}}
</template>
</UTable>
</div>
</template>
<style scoped>

View File

@@ -16,7 +16,7 @@
:rows="filteredRows"
:columns="itemColumns"
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/>

View File

@@ -17,7 +17,7 @@
:rows="filteredRows"
:columns="itemColumns"
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/>
</div>

View File

@@ -133,7 +133,7 @@ export const useDataStore = defineStore('data', {
},
async fetchVendors() {
// @ts-ignore
this.vendors = (await supabase.from("vendors").select()).data
this.vendors = (await supabase.from("vendors").select().order('vendorNumber',{ascending: true})).data
},
async fetchVendorInvoices() {
// @ts-ignore