This commit is contained in:
2023-12-04 20:24:01 +01:00
parent 68a5775717
commit ef9105e286
9 changed files with 443 additions and 134 deletions

38
spaces/app.config.ts Normal file
View File

@@ -0,0 +1,38 @@
export default defineAppConfig({
ui: {
primary: 'green',
gray: 'slate',
tooltip: {
background: '!bg-background'
},
variables: {
dark: {
background: 'var(--color-gray-950)'
},
header: {
height: '5rem'
}
},
notifications: {
// Show toasts at the top right of the screen
position: 'top-0 bottom-auto'
},
icons: {
/*dark: 'i-ph-moon-duotone',
light: 'i-ph-sun-duotone',
search: 'i-ph-magnifying-glass-duotone',
external: 'i-ph-arrow-up-right',
chevron: 'i-ph-caret-down',
hash: 'i-ph-hash-duotone'*/
},
header: {
wrapper: 'lg:mb-0 lg:border-0',
popover: {
links: {
active: 'dark:bg-gray-950/50',
inactive: 'dark:hover:bg-gray-950/50'
}
}
}
}
})

View File

@@ -19,46 +19,46 @@ fetchData()
const navLinks = [ const navLinks = [
{ {
label: "Home", label: "Home",
link: "", to: "/",
icon: 'i-heroicons-home' icon: 'i-heroicons-home'
}, },
{ {
label: "Aufgaben", label: "Aufgaben",
link: "tasks", to: "/tasks",
icon: "i-heroicons-rectangle-stack" icon: "i-heroicons-rectangle-stack"
}, },
{ {
label: "Plantafel", label: "Plantafel",
link: "planningBoard", to: "/planningBoard",
icon: "i-heroicons-calendar-days" icon: "i-heroicons-calendar-days"
}, },
{ {
label: "Kunden", label: "Kunden",
link: "customers", to: "/customers",
icon: "i-heroicons-user-group" icon: "i-heroicons-user-group"
}, },
{ {
label: "Projekte", label: "Projekte",
link: "projects", to: "/projects",
icon: "i-heroicons-clipboard-document-check" icon: "i-heroicons-clipboard-document-check"
}, },
{ {
label: "Zeiterfassung", label: "Zeiterfassung",
link: "timetracking", to: "/timetracking",
icon: "i-heroicons-clock" icon: "i-heroicons-clock"
}, },
{ {
label: "Artikel", label: "Artikel",
link: "products" to: "/products"
}, },
{ {
label: "Dokumente", label: "Dokumente",
link: "documents", to: "/documents",
icon: "i-heroicons-document" icon: "i-heroicons-document"
}, },
{ {
label: "Inventar", label: "Inventar",
link: "inventory" to: "/inventory"
} }
] ]
@@ -121,49 +121,117 @@ const userDropdownItems = [
} }
] ]
] ]
useHead({
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
link: [
{ rel: 'icon', href: '/favicon.ico' }
],
htmlAttrs: {
lang: 'de'
}
})
useSeoMeta({
ogSiteName: 'spaces.software',
twitterCard: 'summary_large_image'
})
</script> </script>
<template> <template>
<UCard id="page"> <UHeader :links="navLinks">
<template #header> <template #right>
<div id="menu"> <UColorModeButton/>
<router-link
v-for="link in navLinks"
:to="'/' + link.link"
class="mr-2"
>
<UButton>{{link.label}}</UButton>
</router-link>
<!--<router-link to="/customers" class="mr-2"><UButton>Kunden</UButton></router-link>
<router-link to="/projects" class="mr-2"><UButton>Projekte</UButton></router-link>
-
<router-link to="/vendorinvoices" class="mr-2"><UButton>Eingangsrechnungen</UButton></router-link>
<router-link to="/timetracking" class="mr-2"><UButton>Zeiterfassung</UButton></router-link>
<router-link to="/products" class="mr-2"><UButton>Artikel</UButton></router-link>
<router-link to="/documents" class="mr-2"><UButton>Dokumente</UButton></router-link>
<router-link to="/inventory" class="mr-2"><UButton>Inventar</UButton></router-link>-->
<UDropdown :items="userDropdownItems" :popper="{placement: 'bottom-start'}">
<UButton color="white" label="Benutzer" trailing-icon="i-heroicons-chevron-down-20-solid" />
</UDropdown>
</div>
<UBreadcrumb
class="my-3"
:links="linksForBreadcrumbs"
/>
</template> </template>
</UHeader>
<div class="m-3" id="contentContainer">
<NuxtPage <NuxtPage
v-if="loaded" v-if="loaded"
/> />
<div </div>
v-else <!-- <UFooter>
> <template #left>
<UProgress animation="carousel" /> <p class="text-gray-500 dark:text-gray-400 text-sm">
</div> Copyright © 2023-{{ new Date().getFullYear() }} <NuxtLink class="hover:underline" to="https://federspiel.tech" target="_blank">
</UCard> Federspiel Technolog UG haftungsbeschränkt
</NuxtLink>
</p>
</template>
<template #right>
</template>
</UFooter>-->
<UNotifications/>
<!-- <UCard id="page">
<template #header>
<div id="menu">
<router-link
v-for="link in navLinks"
:to="link.to"
class="mr-2"
>
<UButton>{{link.label}}</UButton>
</router-link>
&lt;!&ndash;<router-link to="/customers" class="mr-2"><UButton>Kunden</UButton></router-link>
<router-link to="/projects" class="mr-2"><UButton>Projekte</UButton></router-link>
-
<router-link to="/vendorinvoices" class="mr-2"><UButton>Eingangsrechnungen</UButton></router-link>
<router-link to="/timetracking" class="mr-2"><UButton>Zeiterfassung</UButton></router-link>
<router-link to="/products" class="mr-2"><UButton>Artikel</UButton></router-link>
<router-link to="/documents" class="mr-2"><UButton>Dokumente</UButton></router-link>
<router-link to="/inventory" class="mr-2"><UButton>Inventar</UButton></router-link>&ndash;&gt;
<UDropdown :items="userDropdownItems" :popper="{placement: 'bottom-start'}">
<UButton color="white" label="Benutzer" trailing-icon="i-heroicons-chevron-down-20-solid" />
</UDropdown>
</div>
<UBreadcrumb
class="my-3"
:links="linksForBreadcrumbs"
/>
</template>
<NuxtPage
v-if="loaded"
/>
<div
v-else
>
<UProgress animation="carousel" />
</div>
</UCard>-->
</template> </template>
<style > <style>
#contentContainer {
width: 95vw;
height: 85vh;
}
.scrollList {
overflow-y: scroll;
height: 85vh;
margin-top: 1em;
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
.scrollList::-webkit-scrollbar {
display: none;
}
#page { #page {
width: 98vw; width: 98vw;

View File

@@ -1,29 +1,41 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: true }, devtools: {enabled: true},
imports: { imports: {
dirs: ['stores'] dirs: ['stores']
}, },
modules: [ extends: [
'@pinia/nuxt', '@nuxt/ui-pro'
'@nuxt/ui', ],
'@nuxtjs/strapi', modules: [
'@nuxtjs/supabase', '@pinia/nuxt',
"nuxt-editorjs" '@nuxt/ui',
], '@nuxt/content',
routeRules: { '@nuxtjs/strapi',
'/printing': {ssr:false} '@nuxtjs/supabase',
"nuxt-editorjs",
}, '@nuxtjs/fontaine',
supabase: { '@nuxtjs/google-fonts',
key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3cHB2Y3hmbHJjc2lidXpzYmlsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDA5MzgxOTQsImV4cCI6MjAxNjUxNDE5NH0.CkxYSQH0uLfwx9GVUlO6AYMU2FMLAxGMrwEKvyPv7Oo", ],
url: "https://uwppvcxflrcsibuzsbil.supabase.co" routeRules: {
}, '/printing': {ssr: false}
vite: {
optimizeDeps: { },
include: ["@editorjs/editorjs"], supabase: {
key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3cHB2Y3hmbHJjc2lidXpzYmlsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDA5MzgxOTQsImV4cCI6MjAxNjUxNDE5NH0.CkxYSQH0uLfwx9GVUlO6AYMU2FMLAxGMrwEKvyPv7Oo",
url: "https://uwppvcxflrcsibuzsbil.supabase.co"
},
vite: {
optimizeDeps: {
include: ["@editorjs/editorjs"],
},
},
ui: {
icons: ['heroicons']
},
colorMode: {
preference: 'dark'
}, },
},
}) })

View File

@@ -23,7 +23,10 @@
"@fullcalendar/resource": "^6.1.10", "@fullcalendar/resource": "^6.1.10",
"@fullcalendar/resource-timeline": "^6.1.10", "@fullcalendar/resource-timeline": "^6.1.10",
"@fullcalendar/vue3": "^6.1.10", "@fullcalendar/vue3": "^6.1.10",
"@nuxt/ui": "^2.11.0", "@nuxt/content": "^2.9.0",
"@nuxt/ui-pro": "^0.5.0",
"@nuxtjs/fontaine": "^0.4.1",
"@nuxtjs/google-fonts": "^3.1.0",
"@nuxtjs/strapi": "^1.9.3", "@nuxtjs/strapi": "^1.9.3",
"@pinia/nuxt": "^0.5.1", "@pinia/nuxt": "^0.5.1",
"@vicons/ionicons5": "^0.12.0", "@vicons/ionicons5": "^0.12.0",

View File

@@ -3,46 +3,28 @@
<!-- TODO: Kontakte erstellen und dem Kunden zuweisen --> <!-- TODO: Kontakte erstellen und dem Kunden zuweisen -->
<div id="left"> <div id="left">
<UButton @click="showCreateCustomer = true">+ Kunde</UButton> <UButton @click="mode = 'create'">+ Kunde</UButton>
<UModal v-model="showCreateCustomer">
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
Kunde erstellen
</template>
<UForm @submit="createCustomer"> <div class="scrollList">
<UFormGroup label="Name:" required> <a v-for="item in customers" @click="selectItem(item)">
<UInput v-model="customerInfo.name"/> <UCard class="listItem">
</UFormGroup> <UBadge>{{item.customerNumber}}</UBadge> {{item.name}}
<UFormGroup label="Kundenummer:" required> </UCard>
<UInput type="number" v-model="customerInfo.customerNumber"/> </a>
</UFormGroup> </div>
<UButton type="submit">
Erstellen
</UButton>
</UForm>
</UCard>
</UModal>
<a v-for="item in customers" @click="selectItem(item)">
<UCard class="listItem">
<UBadge>{{item.customerNumber}}</UBadge> {{item.name}}
</UCard>
</a>
</div> </div>
<div id="right"> <div id="right">
<UCard v-if="selectedItem.id && mode == 'show'" >
<UCard v-if="selectedItem.id">
<template #header> <template #header>
<UBadge>{{selectedItem.customerNumber}}</UBadge> {{selectedItem.name}} <UBadge>{{selectedItem.customerNumber}}</UBadge> {{selectedItem.name}}
</template> </template>
{{selectedItem.infoData}}<br>
Kontakte:<br> Kontakte:<br>
<!-- <ul> <!-- <ul>
<li v-for="contact in selectedItem.contacts.data">{{contact.lastName}}, {{contact.firstName}}</li> <li v-for="contact in selectedItem.contacts.data">{{contact.lastName}}, {{contact.firstName}}</li>
@@ -56,9 +38,138 @@
<br><br> <br><br>
<template #footer>
<UButton
v-if="mode == 'show' && selectedItem.id"
@click="editCustomer"
>
Bearbeiten
</UButton>
<UButton
@click="cancelEditorCreate"
color="red"
class="ml-2"
disabled
>
Archivieren
</UButton>
<!-- TODO: Kunde archivieren -->
</template>
<!-- TODO: Scrollcontainer -->
</UCard>
<UCard v-else-if="mode == 'edit' || mode == 'create'" >
<template #header>
<UBadge>{{customerInfo.customerNumber}}</UBadge> {{customerInfo.name}}
</template>
<UFormGroup
label="Name:"
>
<UInput
v-model="customerInfo.name"
/>
</UFormGroup>
<UFormGroup
label="Kundennummer:"
>
<UInput
v-model="customerInfo.customerNumber"
/>
</UFormGroup>
<UTooltip text="Ist ein Kunde nicht aktiv so wird er für neue Aufträge gesperrt">
<UFormGroup
label="Kunde aktiv:"
>
<UCheckbox
v-model="customerInfo.active"
/>
</UFormGroup>
</UTooltip>
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="customerInfo.notes"
/>
</UFormGroup>
<UFormGroup
label="Straße + Hausnummer"
>
<UInput
v-model="customerInfo.infoData.street"
/>
</UFormGroup>
<UFormGroup
label="Postleitzahl"
>
<UInput
v-model="customerInfo.infoData.zip"
/>
</UFormGroup>
<UFormGroup
label="Ort"
>
<UInput
v-model="customerInfo.infoData.city"
/>
</UFormGroup>
<UFormGroup
label="Telefon:"
>
<UInput
v-model="customerInfo.infoData.tel"
/>
</UFormGroup>
<UFormGroup
label="E-Mail:"
>
<UInput
v-model="customerInfo.infoData.email"
/>
</UFormGroup>
<UFormGroup
label="Webseite:"
>
<UInput
v-model="customerInfo.infoData.web"
/>
</UFormGroup>
<UFormGroup
label="USt-Id:"
>
<UInput
v-model="customerInfo.infoData.ustid"
/>
</UFormGroup>
<template #footer>
<UButton
v-if="mode == 'edit'"
@click="updateCustomer"
>
Speichern
</UButton>
<UButton
v-else-if="mode == 'create'"
@click="createCustomer"
>
Erstellen
</UButton>
<UButton
@click="cancelEditorCreate"
color="red"
class="ml-2"
>
Abbrechen
</UButton>
</template>
</UCard> </UCard>
</div> </div>
</div> </div>
@@ -70,7 +181,7 @@ definePageMeta({
}) })
const supabase = useSupabaseClient() const supabase = useSupabaseClient()
const toast = useToast()
const {customers } = storeToRefs(useDataStore()) const {customers } = storeToRefs(useDataStore())
const {fetchCustomers} = useDataStore() const {fetchCustomers} = useDataStore()
@@ -78,17 +189,19 @@ const {fetchCustomers} = useDataStore()
let showCreateCustomer = ref(false) let showCreateCustomer = ref(false)
let customerInfo = ref({ let customerInfo = ref({
name: "", name: "",
customerNumber: 0 customerNumber: 0,
infoData: {}
}) })
const mode = ref("show")
let selectedItem = ref({}) let selectedItem = ref({})
const selectItem = (item) => { const selectItem = (item) => {
selectedItem.value = item selectedItem.value = item
window.scrollTo(0,0)
} }
const createCustomer = async () => { /*const createCustomer = async () => {
//await create('customers', customerInfo.value) //await create('customers', customerInfo.value)
const {data,error} = await supabase const {data,error} = await supabase
.from("customers") .from("customers")
@@ -101,8 +214,50 @@ const createCustomer = async () => {
customerInfo.value = {} customerInfo.value = {}
showCreateCustomer.value = false showCreateCustomer.value = false
fetchCustomers() fetchCustomers()
}*/
const createCustomer = async () => {
const {error} = await supabase
.from("customers")
.insert([customerInfo.value])
.select()
if(error) {
console.log(error)
} else {
mode.value = "show"
toast.add({title: "Kunde erfolgreich erstellt"})
fetchCustomers()
}
} }
const editCustomer = async () => {
mode.value = 'edit';
customerInfo.value = selectedItem.value
}
const cancelEditorCreate = () => {
mode.value = "show"
customerInfo.value = {
id: 0,
name: "",
infoData: {}
}
}
const updateCustomer = async () => {
const {error} = await supabase
.from("customers")
.update(customerInfo.value)
.eq('id',customerInfo.value.id)
console.log(error)
mode.value = "show"
toast.add({title: "Kunde erfolgreich gespeichert"})
fetchCustomers()
}
</script> </script>
<style scoped> <style scoped>
@@ -112,8 +267,11 @@ const createCustomer = async () => {
} }
#left { #left {
width: 25vw; width: 25vw;
} }
#right { #right {
width: 60vw; width: 60vw;
padding-left: 3vw; padding-left: 3vw;

View File

@@ -262,6 +262,8 @@ const openDocument = async (document) => {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
height: 85vh;
overflow-y: scroll;
} }
.documentListItem { .documentListItem {

View File

@@ -1,4 +1,8 @@
<script setup > <script setup >
definePageMeta({
layout: "notLoggedIn"
})
const supabase = useSupabaseClient() const supabase = useSupabaseClient()
const user = useSupabaseUser() const user = useSupabaseUser()
const router = useRouter() const router = useRouter()

View File

@@ -58,6 +58,9 @@ const tabItems = [
},{ },{
key: "timetracking", key: "timetracking",
label: "Zeiterfassung" label: "Zeiterfassung"
},{
key: "material",
label: "Material"
} }
] ]
const selectedPhase = ref({}) const selectedPhase = ref({})
@@ -142,7 +145,8 @@ const phaseInfo = ref({
<UTabs :items="tabItems" class="w-full"> <UTabs :items="tabItems" class="w-full">
<template #item="{ item }"> <template #item="{ item }">
<div v-if="item.key === 'phases'" class="space-y-3"> <div v-if="item.key === 'phases'" class="space-y-3">
<div id="phaseList"> <p>Hier wird aktuell noch gearbeitet</p>
<!-- <div id="phaseList">
<a <a
v-for="phase in []" v-for="phase in []"
@click="selectedPhase = phase" @click="selectedPhase = phase"
@@ -158,7 +162,7 @@ const phaseInfo = ref({
<UDivider icon="i-heroicons-plus-circle"/> <UDivider icon="i-heroicons-plus-circle"/>
</a> </a>
</a> </a>
</div> </div>-->
</div> </div>
<div v-else-if="item.key === 'forms'" class="space-y-3"> <div v-else-if="item.key === 'forms'" class="space-y-3">
@@ -222,7 +226,12 @@ const phaseInfo = ref({
</UButton> </UButton>
<client-only><editor-js v-model="newProjectDescription" /></client-only> <client-only><editor-js v-model="newProjectDescription" /></client-only>
</div> </div>
{{item}} <div v-else-if="item.key === 'timetracking'" class="space-y-3">
<p>Hier wird aktuell noch gearbeitet</p>
</div>
<div v-else-if="item.key === 'material'" class="space-y-3">
<p>Hier wird aktuell noch gearbeitet</p>
</div>
</template> </template>
</UTabs> </UTabs>
<!-- <div id="left"> <!-- <div id="left">
@@ -278,7 +287,7 @@ const phaseInfo = ref({
</div> </div>
</template> </template>
<style > <style scoped>
#main { #main {
display: flex; display: flex;

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <UPage>
<!-- TODO: Benutzer Aufgaben zuweisen und nach diesen Filtern --> <!-- TODO: Benutzer Aufgaben zuweisen und nach diesen Filtern -->
<UModal <UModal
v-model="showCreateTask" v-model="showCreateTask"
> >
@@ -76,11 +76,16 @@
{{user}} {{user}}
</UBadge> </UBadge>
<template #footer> <template #footer>
<UButton <UFormGroup
@click="finishTask" label="Status ändern:"
> >
Erledigt <USelectMenu
</UButton> :options="taskCategories"
@change="updateTask"
v-model="taskData.categorie"
/>
</UFormGroup>
</template> </template>
</UCard> </UCard>
</UModal> </UModal>
@@ -92,30 +97,31 @@
> >
+ Aufgabe + Aufgabe
</UButton> </UButton>
<USelectMenu <!-- <USelectMenu
:options="usersForList" :options="usersForList"
v-model="usersSelected" v-model="usersSelected"
multiple multiple
placeholder="Benutzer" placeholder="Benutzer"
class="w-40" class="w-40"
v-on:change="filterTasks" v-on:change="filterTasks"
> >
<template #label> <template #label>
<span v-if="usersSelected.length" class="truncate">{{ usersSelected.join(', ') }}</span> <span v-if="usersSelected.length" class="truncate">{{ usersSelected.join(', ') }}</span>
<span v-else>Benutzer auswählen</span> <span v-else>Benutzer auswählen</span>
</template> </template>
</USelectMenu> </USelectMenu>-->
</div> </div>
<div id="taskCatList"> <div id="taskCatList">
<div id="catNew"> <div id="catNew">
<h3>Neue Aufgaben</h3> <h3>Offene Aufgaben</h3>
<div class="taskScrollList" v-if="tasks.length > 0"> <div class="taskScrollList" v-if="tasks.length > 0">
<a <a
v-for="taskNew in tasks.filter(task => task.categorie == 'Neu')" v-for="taskNew in tasks.filter(task => task.categorie == 'Offen')"
@click="inspectTask(taskNew)" @click="inspectTask(taskNew)"
> >
<UCard class="listItem"> <UCard class="listItem">
@@ -174,16 +180,16 @@
</div> </div>
</div> </div>
</div> </UPage>
</template> </template>
<script setup> <script setup>
definePageMeta({ definePageMeta({
middleware: "auth" middleware: "auth",
}) })
const toast = useToast()
const supabase = useSupabaseClient() const supabase = useSupabaseClient()
const {tasks} = storeToRefs(useDataStore()) const {tasks} = storeToRefs(useDataStore())
const {fetchTasks} = useDataStore() const {fetchTasks} = useDataStore()
@@ -199,7 +205,7 @@ usersSelected.value = usersForList
const showCreateTask = ref(false) const showCreateTask = ref(false)
const taskCategories = ["Neu","In Bearbeitung", "Dringend"] const taskCategories = ["Offen","In Bearbeitung", "Dringend"]
const createTaskData = ref({ const createTaskData = ref({
name: "", name: "",
description: "", description: "",
@@ -225,15 +231,23 @@ const createTask = async () => {
} }
const updateTask = async () => { const updateTask = async () => {
//await update('tasks', taskData.value.id, taskData.value)
console.log(taskData.value) console.log(taskData.value)
const {data,error} = await supabase const {data,error} = await supabase
.from("tasks") .from("tasks")
.update({categorie: taskData.value.categorie}) .update(taskData.value)
.eq('id',taskData.value.id) .eq('id',taskData.value.id)
.select() .select()
console.log(data) console.log(data)
console.log(error)
if(error) {
console.log(error)
} else {
toast.add({title: "Aufgabe aktualisiert"})
taskData.value = {}
showTaskModal.value = false
fetchTasks()
}
} }
@@ -257,6 +271,7 @@ const finishTask = async () => {
//console.log(data) //console.log(data)
console.log(error) console.log(error)
showTaskModal.value = false showTaskModal.value = false
fetchTasks()
} }
//filterTasks() //filterTasks()