Files
FEDEO/components/MainNav.vue
florianfederspiel 2bda15d264 Deprecated Events as non Standard Entity
Repaired query
Reparied Document Show
2024-12-27 11:05:59 +01:00

375 lines
11 KiB
Vue

<script setup>
import {useRole} from "~/composables/useRole.js";
const profileStore = useProfileStore()
const route = useRoute()
const role = useRole()
const links = computed(() => {
return [
{
id: 'dashboard',
label: "Dashboard",
to: "/",
icon: "i-heroicons-home"
},
{
label: "Organisation",
icon: "i-heroicons-rectangle-stack",
defaultOpen: false,
children: [
... role.checkRight("tasks") ? [{
label: "Aufgaben",
to: "/standardEntity/tasks",
icon: "i-heroicons-rectangle-stack"
}] : [],
... profileStore.ownTenant.features.planningBoard ? [{
label: "Plantafel",
to: "/calendar/timeline",
icon: "i-heroicons-calendar-days"
}] : [],
... profileStore.ownTenant.features.calendar ? [{
label: "Kalender",
to: "/calendar/grid",
icon: "i-heroicons-calendar-days"
}] : [],
... profileStore.ownTenant.features.calendar ? [{
label: "Termine",
to: "/standardEntity/events",
icon: "i-heroicons-calendar-days"
}] : [],
{
label: "Dateien",
to: "/documents",
icon: "i-heroicons-document"
},
]
},
{
label: "Kommunikation",
icon: "i-heroicons-megaphone",
defaultOpen: false,
children: [
{
label: "E-Mail",
to: "/email/new",
icon: "i-heroicons-envelope"
}, {
label: "Logbücher",
to: "/communication/historyItems",
icon: "i-heroicons-book-open"
}, {
label: "Chats",
to: "/chats",
icon: "i-heroicons-chat-bubble-left"
}
]
},
... profileStore.ownTenant.features.contacts ? [{
label: "Kontakte",
defaultOpen: false,
icon: "i-heroicons-user-group",
children: [
... role.checkRight("customers") ? [{
label: "Kunden",
to: "/standardEntity/customers",
icon: "i-heroicons-user-group"
}] : [],
... role.checkRight("vendors") ? [{
label: "Lieferanten",
to: "/standardEntity/vendors",
icon: "i-heroicons-truck"
}] : [],
... role.checkRight("contacts") ? [{
label: "Ansprechpartner",
to: "/standardEntity/contacts",
icon: "i-heroicons-user-group"
}] : [],
]
},] : [],
{
label: "Mitarbeiter",
defaultOpen:false,
icon: "i-heroicons-user-group",
children: [
... profileStore.ownTenant.features.timeTracking ? [{
label: "Zeiterfassung",
to: "/employees/timetracking",
icon: "i-heroicons-clock"
}] : [],
... profileStore.ownTenant.features.workingTimeTracking ? [{
label: "Anwesenheiten",
to: "/workingtimes",
icon: "i-heroicons-clock"
}] : [],
... role.checkRight("absencerequests") ? [{
label: "Abwesenheiten",
to: "/standardEntity/absencerequests",
icon: "i-heroicons-document-text"
}] : [],
]
},
... profileStore.ownTenant.features.accounting ? [{
label: "Buchhaltung",
defaultOpen: false,
icon: "i-heroicons-chart-bar-square",
children: [
{
label: "Ausgangsbelege",
to: "/createDocument",
icon: "i-heroicons-document-text"
},{
label: "Serienvorlagen",
to: "/createDocument/serialInvoice",
icon: "i-heroicons-document-text"
},{
label: "Eingangsbelege",
to: "/incomingInvoices",
icon: "i-heroicons-document-text"
},
{
label: "Bank",
to: "/banking",
icon: "i-heroicons-document-text"
},
]
},] : [],
... role.checkRight("inventory") ? [{
label: "Lager",
icon: "i-heroicons-puzzle-piece",
defaultOpen: false,
children: [
{
label: "Vorgänge",
to: "/inventory",
icon: "i-heroicons-square-3-stack-3d"
},{
label: "Bestände",
to: "/inventory/stocks",
icon: "i-heroicons-square-3-stack-3d"
},
... role.checkRight("spaces") ? [{
label: "Lagerplätze",
to: "/spaces",
icon: "i-heroicons-square-3-stack-3d"
}] : [],
... role.checkRight("inventoryitems") ? [{
label: "Inventar",
to: "/standardEntity/inventoryitems",
icon: "i-heroicons-puzzle-piece"
}] : [],
]
},] : [],
... role.checkRight("vehicles") ? [{
label: "Fuhrpark",
defaultOpen: false,
icon: "i-heroicons-truck",
children: [
... role.checkRight("vehicles") ? [{
label: "Fahrzeuge",
to: "/vehicles",
icon: "i-heroicons-truck"
}] : [],{
label: "Fahrten",
to: "/trackingTrips",
icon: "i-heroicons-map"
},
]
},] : [],
{
label: "Stammdaten",
defaultOpen: false,
icon: "i-heroicons-clipboard-document",
children: [
... role.checkRight("products") ? [{
label: "Artikel",
to: "/standardEntity/products",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("productcategories") ? [{
label: "Artikelkategorien",
to: "/standardEntity/productcategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("services") ? [{
label: "Leistungen",
to: "/standardEntity/services",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("servicecategories") ? [{
label: "Leistungskategorien",
to: "/standardEntity/servicecategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
]
},
... role.checkRight("checks") ? [{
label: "Überprüfungen",
to: "/standardEntity/checks",
icon: "i-heroicons-magnifying-glass"
},] : [],
... role.checkRight("projects") ? [{
label: "Projekte",
to: "/standardEntity/projects",
icon: "i-heroicons-clipboard-document-check"
},] : [],
... role.checkRight("contracts") ? [{
label: "Verträge",
to: "/standardEntity/contracts",
icon: "i-heroicons-clipboard-document"
}] : [],
... role.checkRight("plants") ? [{
label: "Objekte",
to: "/standardEntity/plants",
icon: "i-heroicons-clipboard-document"
},] : [],
{
label: "Einstellungen",
defaultOpen: false,
icon: "i-heroicons-cog-8-tooth",
children: [
{
label: "Nummernkreise",
to: "/settings/numberRanges",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Mitarbeiter",
to: "/profiles",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Rollen",
to: "/roles",
icon: "i-heroicons-clipboard-document-list"
},{
label: "E-Mail Konten",
to: "/settings/emailAccounts",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Bankkonten",
to: "/settings/banking",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Text Vorlagen",
to: "/settings/texttemplates",
icon: "i-heroicons-clipboard-document-list"
},/*{
label: "Eigene Felder",
to: "/settings/ownfields",
icon: "i-heroicons-clipboard-document-list"
},*/{
label: "Firmeneinstellungen",
to: "/settings/tenant",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Projekttypen",
to: "/projecttypes",
icon: "i-heroicons-clipboard-document-list"
}/*,{
label: "Integrationen",
to: "/settings/integrations",
icon: "i-heroicons-clipboard-document-list"
}*/,{
label: "Labels",
to: "/settings/labels/",
icon: "i-heroicons-bars-3-solid"
}
]
}
]
})
/*const setOpen = (index,open) => {
console.log(!open)
}*/
</script>
<template>
<!--
<UAccordion :items="links" :ui="{ wrapper: 'flex flex-col w-full' }">
<template #default="{ item, index, open }">
<UButton color="gray" variant="ghost" class="border-b border-gray-200 dark:border-gray-700" :ui="{ rounded: 'rounded-none', padding: { sm: 'p-3' } }">
<template #leading>
&lt;!&ndash; <div class="w-6 h-6 rounded-full bg-primary-500 dark:bg-primary-400 flex items-center justify-center -my-1">
<UIcon :name="item.icon" class="w-4 h-4 text-white dark:text-gray-900" />
</div>&ndash;&gt;
<UIcon :name="item.icon" class="w-4 h-4 dark:text-white text-gray-900" />
</template>
<span class="truncate">{{ item.label }}</span>
<template #trailing>
<UIcon
name="i-heroicons-chevron-right-20-solid"
class="w-5 h-5 ms-auto transform transition-transform duration-200"
:class="[open && 'rotate-90']"
/>
</template>
</UButton>
</template>
<template #item="{item}">
<div v-if="item.children" class="flex flex-col">
<UButton
v-for="child in item.children"
variant="ghost"
color="gray"
>
{{child.label}}
</UButton>
</div>
</template>
</UAccordion>
-->
<div
v-for="item in links"
>
<UAccordion
v-if="item.children"
:items="[item]"
>
<template #default="{item,index,open}">
<UButton
variant="ghost"
:color="item.children.find(i => route.path.includes(i.to)) ? 'primary' : 'gray'"
:icon="item.icon"
>
{{item.label}}
<template #trailing>
<UIcon
name="i-heroicons-chevron-right-20-solid"
class="w-5 h-5 ms-auto transform transition-transform duration-200"
:class="[open && 'rotate-90']"
/>
</template>
</UButton>
</template>
<template #item="{item, open}">
<div class="flex flex-col">
<UButton
variant="ghost"
:color="child.to === route.path ? 'primary' : 'gray'"
:icon="child.icon"
v-for="child in item.children"
class="ml-4"
:to="child.to"
>
{{child.label}}
</UButton>
</div>
</template>
</UAccordion>
<UButton
v-else
variant="ghost"
:color="item.to === route.path ? 'primary' : 'gray'"
class="w-full"
:icon="item.icon"
:to="item.to"
>
{{item.label}}
</UButton>
</div>
</template>