4. Zwischenstand
This commit is contained in:
@@ -136,30 +136,37 @@ const links = computed(() => {
|
||||
to: "/incomingInvoices",
|
||||
icon: "i-heroicons-document-text",
|
||||
} : null,
|
||||
(featureEnabled("createDocument") || featureEnabled("incomingInvoices")) ? {
|
||||
label: "USt-Auswertung",
|
||||
to: "/accounting/tax",
|
||||
icon: "i-heroicons-calculator",
|
||||
} : null,
|
||||
(featureEnabled("createDocument") || featureEnabled("incomingInvoices") || featureEnabled("accounts") || featureEnabled("ownaccounts")) ? {
|
||||
label: "BWA",
|
||||
to: "/accounting/bwa",
|
||||
icon: "i-heroicons-chart-bar-square",
|
||||
} : null,
|
||||
featureEnabled("costcentres") ? {
|
||||
label: "Kostenstellen",
|
||||
to: "/standardEntity/costcentres",
|
||||
icon: "i-heroicons-document-currency-euro"
|
||||
} : null,
|
||||
featureEnabled("accounts") ? {
|
||||
label: "Buchungskonten",
|
||||
to: "/accounts",
|
||||
icon: "i-heroicons-document-text",
|
||||
} : null,
|
||||
featureEnabled("ownaccounts") ? {
|
||||
label: "zusätzliche Buchungskonten",
|
||||
to: "/standardEntity/ownaccounts",
|
||||
icon: "i-heroicons-document-text"
|
||||
((featureEnabled("createDocument") || featureEnabled("incomingInvoices")) || featureEnabled("accounts") || featureEnabled("ownaccounts") || featureEnabled("costcentres")) ? {
|
||||
label: "Auswertungen",
|
||||
icon: "i-heroicons-chart-pie",
|
||||
defaultOpen: false,
|
||||
children: visibleItems([
|
||||
(featureEnabled("createDocument") || featureEnabled("incomingInvoices")) ? {
|
||||
label: "USt",
|
||||
to: "/accounting/tax",
|
||||
icon: "i-heroicons-calculator",
|
||||
} : null,
|
||||
(featureEnabled("createDocument") || featureEnabled("incomingInvoices") || featureEnabled("accounts") || featureEnabled("ownaccounts")) ? {
|
||||
label: "BWA",
|
||||
to: "/accounting/bwa",
|
||||
icon: "i-heroicons-chart-bar-square",
|
||||
} : null,
|
||||
featureEnabled("costcentres") ? {
|
||||
label: "Kostenstellen",
|
||||
to: "/standardEntity/costcentres",
|
||||
icon: "i-heroicons-document-currency-euro"
|
||||
} : null,
|
||||
featureEnabled("accounts") ? {
|
||||
label: "Buchungskonten",
|
||||
to: "/accounts",
|
||||
icon: "i-heroicons-document-text",
|
||||
} : null,
|
||||
featureEnabled("ownaccounts") ? {
|
||||
label: "Zusätzliche Buchungskonten",
|
||||
to: "/standardEntity/ownaccounts",
|
||||
icon: "i-heroicons-document-text"
|
||||
} : null,
|
||||
])
|
||||
} : null,
|
||||
featureEnabled("banking") ? {
|
||||
label: "Bank",
|
||||
@@ -401,31 +408,31 @@ const links = computed(() => {
|
||||
])
|
||||
})
|
||||
|
||||
const mapNavItem = (item, valuePrefix = "item") => {
|
||||
const children = Array.isArray(item.children)
|
||||
? item.children
|
||||
.filter(Boolean)
|
||||
.map((child, index) => mapNavItem(child, `${valuePrefix}-${index}`))
|
||||
: undefined
|
||||
|
||||
const active = item.active || isRouteActive(item.to) || Boolean(children?.some(child => child.active))
|
||||
|
||||
return {
|
||||
...item,
|
||||
children,
|
||||
value: item.id || item.label || valuePrefix,
|
||||
defaultOpen: item.defaultOpen || active,
|
||||
active,
|
||||
tooltip: true,
|
||||
popover: true,
|
||||
trailingIcon: children?.length ? undefined : ''
|
||||
}
|
||||
}
|
||||
|
||||
const navItems = computed(() =>
|
||||
links.value
|
||||
.filter(Boolean)
|
||||
.map((item, index) => {
|
||||
const children = Array.isArray(item.children)
|
||||
? item.children.map((child, childIndex) => ({
|
||||
...child,
|
||||
value: child.id || child.label || `${index}-${childIndex}`,
|
||||
active: isRouteActive(child.to)
|
||||
}))
|
||||
: undefined
|
||||
|
||||
const active = item.active || isRouteActive(item.to) || Boolean(children?.some(child => child.active))
|
||||
|
||||
return {
|
||||
...item,
|
||||
children,
|
||||
value: item.id || item.label || String(index),
|
||||
defaultOpen: item.defaultOpen || active,
|
||||
active,
|
||||
tooltip: true,
|
||||
popover: true,
|
||||
trailingIcon: children?.length ? undefined : ''
|
||||
}
|
||||
})
|
||||
.map((item, index) => mapNavItem(item, String(index)))
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user