Organigramm und Dokumente kompakter
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m31s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m26s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m9s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m16s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 4m3s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m1s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 4m16s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 4m21s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m26s

- Organigramm: zwei Ebenen offen, Fläche so hoch wie der Inhalt, kleinere
  Abstände; Fokus-Ansicht in voller Breite mit Seitenspalte und Team-Vorschau
- Dokumente: dichtere Zeilen, Unterordner in den Bereichen, Infospalte
  „Über diesen Ordner“ mit den pflegenden Rollen
- Etwas weniger Randabstand im Seitenlayout

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 13:15:44 +00:00
parent ab0384ceb1
commit 33862183bf
80 changed files with 475 additions and 352 deletions

View file

@ -1,12 +1,12 @@
<script setup>
import { computed } from 'vue';
import { Link } from '@inertiajs/vue3';
import { Mail, MapPin, Network, Phone, UserRound, Users } from '@lucide/vue';
import { ChevronUp, Mail, MapPin, Network, Phone, Smartphone, UserRound, Users } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import PersonAvatar from '@/components/PersonAvatar.vue';
/**
* Fokus-Ansicht: eine Person groß, darüber die Kette der Vorgesetzten, daneben
* Fokus-Ansicht: eine Person mit Kontakt, rechts die Kette der Vorgesetzten und
* das eigene Team, darunter die direkt unterstellten Personen.
*/
const props = defineProps({
@ -29,93 +29,111 @@ const chain = computed(() => props.path.slice(0, -1).map((id) => known.value.get
const manager = computed(() => chain.value.at(-1) ?? null);
const peers = computed(() => (manager.value ? (props.teams[manager.value.id] ?? []).filter((p) => p.id !== props.details.id) : []));
const reports = computed(() => props.teams[props.details.id] ?? []);
const meta = computed(() => [props.details.department, props.details.location].filter(Boolean));
const contact = computed(() => [
{ icon: Mail, value: props.details.email, href: `mailto:${props.details.email}` },
{ icon: Phone, value: props.details.phone, href: props.details.phone && `tel:${props.details.phone}` },
{ icon: Smartphone, value: props.details.mobile, href: props.details.mobile && `tel:${props.details.mobile}` },
{ icon: MapPin, value: [props.details.department, props.details.location].filter(Boolean).join(' · ') },
].filter((c) => c.value));
</script>
<template>
<div class="mx-auto grid max-w-5xl gap-6">
<!-- Vorgesetzte -->
<ol v-if="chain.length" class="flex flex-col items-center" aria-label="Vorgesetzte">
<li v-for="person in chain" :key="person.id" class="flex flex-col items-center">
<button
type="button"
class="flex w-72 items-center gap-3 rounded-lg border bg-card px-3 py-2 text-left shadow-xs hover:border-brand-300 hover:shadow-sm"
@click="$emit('focus', person)"
>
<PersonAvatar :person="person" class="size-8 text-[11px]" />
<span class="min-w-0">
<span class="block truncate text-sm font-medium">{{ person.name }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ person.job_title || person.department || '–' }}</span>
</span>
</button>
<span class="h-5 w-px bg-border" aria-hidden="true" />
</li>
</ol>
<!-- Person im Fokus -->
<section class="overflow-hidden rounded-lg border bg-card shadow-sm" :class="{ '-mt-6': chain.length }">
<div class="h-20 bg-brand" style="background-image: linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))" />
<div class="flex flex-col gap-4 px-6 pb-6 md:flex-row md:items-end md:justify-between">
<div class="flex flex-col gap-4 sm:flex-row sm:items-end">
<PersonAvatar :person="details" class="-mt-12 size-24 text-2xl ring-4 ring-card" />
<div class="min-w-0 sm:pb-1">
<h2 class="text-xl font-semibold tracking-tight">{{ details.name }}</h2>
<p v-if="details.job_title" class="text-[15px] text-muted-foreground">{{ details.job_title }}</p>
<p v-if="meta.length" class="mt-1 flex items-center gap-1.5 text-[13px] text-muted-foreground">
<MapPin class="size-3.5" /> {{ meta.join(' · ') }}
</p>
<div class="grid items-start gap-4" :class="{ 'lg:grid-cols-[minmax(0,1fr)_19rem]': chain.length || peers.length }">
<div class="grid gap-4">
<!-- Person im Fokus -->
<section class="overflow-hidden rounded-lg border bg-card">
<div class="flex flex-col gap-4 p-4 sm:flex-row sm:items-center">
<PersonAvatar :person="details" class="size-20 text-xl ring-4 ring-brand-soft" />
<div class="min-w-0 flex-1">
<p v-if="details.department" class="text-[11px] font-semibold tracking-wide text-brand-text uppercase">{{ details.department }}</p>
<h2 class="text-xl leading-tight font-semibold tracking-tight">{{ details.name }}</h2>
<p v-if="details.job_title" class="text-sm text-muted-foreground">{{ details.job_title }}</p>
<ul class="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[13px]">
<li v-for="item in contact" :key="item.value" class="flex min-w-0 items-center gap-1.5">
<component :is="item.icon" class="size-3.5 shrink-0 text-muted-foreground" />
<a v-if="item.href" :href="item.href" class="truncate text-brand-text hover:underline">{{ item.value }}</a>
<span v-else class="truncate text-muted-foreground">{{ item.value }}</span>
</li>
</ul>
</div>
<div class="flex shrink-0 flex-wrap gap-2 sm:flex-col">
<Button size="sm" as-child><Link :href="`/personen/${details.id}`"><UserRound /> Profil</Link></Button>
<Button variant="outline" size="sm" @click="$emit('show-in-tree', details)"><Network /> Im Baum</Button>
</div>
</div>
<div class="flex flex-wrap gap-2 md:pb-1">
<Button variant="outline" size="sm" as-child><a :href="`mailto:${details.email}`"><Mail /> E-Mail</a></Button>
<Button v-if="details.phone || details.mobile" variant="outline" size="sm" as-child><a :href="`tel:${details.phone || details.mobile}`"><Phone /> Anrufen</a></Button>
<Button variant="outline" size="sm" @click="$emit('show-in-tree', details)"><Network /> Im Baum</Button>
<Button size="sm" as-child><Link :href="`/personen/${details.id}`"><UserRound /> Profil</Link></Button>
</div>
</div>
</section>
<div v-if="manager" class="flex flex-wrap items-center gap-x-3 gap-y-2 border-t bg-muted/30 px-6 py-3 text-[13px]">
<span class="text-muted-foreground">Im Team von <button type="button" class="font-medium text-foreground hover:underline" @click="$emit('focus', manager)">{{ manager.name }}</button><template v-if="peers.length"> mit</template></span>
<div v-if="peers.length" class="flex flex-wrap gap-1.5">
<button
v-for="peer in peers.slice(0, 12)"
:key="peer.id"
type="button"
class="rounded-full ring-2 ring-transparent hover:ring-brand-300"
:title="`${peer.name}${peer.job_title ? ' – ' + peer.job_title : ''}`"
@click="$emit('focus', peer)"
>
<PersonAvatar :person="peer" class="size-7 text-[10px]" />
</button>
<span v-if="peers.length > 12" class="grid h-7 place-items-center rounded-full bg-muted px-2 text-xs text-muted-foreground">+{{ peers.length - 12 }}</span>
</div>
</div>
</section>
<!-- Direkt unterstellt -->
<section v-if="reports.length">
<h3 class="mb-3 flex items-center gap-2 text-base font-semibold">
<Users class="size-4 text-brand-text" /> Direkt unterstellt <span class="font-normal text-muted-foreground">({{ reports.length }})</span>
</h3>
<ul class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
<li v-for="person in reports" :key="person.id">
<button
type="button"
class="flex w-full items-center gap-3 rounded-lg border bg-card p-3 text-left shadow-xs hover:border-brand-300 hover:shadow-sm"
@click="$emit('focus', person)"
>
<PersonAvatar :person="person" class="size-11" />
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-semibold">{{ person.name }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ person.job_title || '–' }}</span>
<span v-if="person.reports" class="mt-1 inline-flex items-center gap-1 text-xs font-medium text-brand-text">
<Users class="size-3.5" /> {{ person.reports }} im Team
<!-- Direkt unterstellt -->
<section class="rounded-lg border bg-card">
<h3 class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold">
<Users class="size-4 text-brand-text" /> Direkt unterstellt <span class="font-normal text-muted-foreground">{{ reports.length }}</span>
</h3>
<div v-if="reports.length" class="overflow-hidden rounded-b-lg">
<ul class="-mr-px -mb-px grid sm:grid-cols-2 xl:grid-cols-3">
<li v-for="person in reports" :key="person.id" class="border-r border-b">
<button type="button" class="flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-accent/60" @click="$emit('focus', person)">
<PersonAvatar :person="person" class="size-9" />
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium">{{ person.name }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ person.job_title || '–' }}</span>
</span>
</span>
</button>
</li>
</ul>
</section>
<p v-else class="text-center text-sm text-muted-foreground">{{ details.name }} hat keine direkt unterstellten Personen.</p>
<span v-if="person.reports" class="inline-flex shrink-0 items-center gap-1 rounded-full bg-brand-soft px-2 py-0.5 text-[11px] font-medium text-brand-soft-foreground" :title="`${person.reports} im Team`">
<Users class="size-3" /> {{ person.reports }}
</span>
</button>
<div v-if="teams[person.id]?.length" class="flex items-center gap-1 px-4 pb-2.5 pl-16">
<button
v-for="member in teams[person.id].slice(0, 7)"
:key="member.id"
type="button"
class="-ml-1 rounded-full ring-2 ring-card first:ml-0 hover:ring-brand-300"
:title="`${member.name}${member.job_title ? ' – ' + member.job_title : ''}`"
@click="$emit('focus', member)"
>
<PersonAvatar :person="member" class="size-6 text-[9px]" />
</button>
<span v-if="teams[person.id].length > 7" class="ml-1 text-xs text-muted-foreground">+{{ teams[person.id].length - 7 }}</span>
</div>
</li>
</ul>
</div>
<p v-else class="px-4 py-3 text-[13px] text-muted-foreground">Keine direkt unterstellten Personen.</p>
</section>
</div>
<aside v-if="chain.length || peers.length" class="grid gap-4">
<section v-if="chain.length" class="rounded-lg border bg-card">
<h3 class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold"><ChevronUp class="size-4 text-brand-text" /> Berichtet an</h3>
<ol class="p-2">
<li v-for="(person, index) in [...chain].reverse()" :key="person.id" class="relative">
<span v-if="index < chain.length - 1" class="absolute top-9 bottom-0 left-[1.45rem] w-px bg-border" aria-hidden="true" />
<button type="button" class="relative flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-accent" @click="$emit('focus', person)">
<PersonAvatar :person="person" class="size-8 text-[11px]" />
<span class="min-w-0">
<span class="block truncate text-sm font-medium">{{ person.name }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ person.job_title || person.department || '–' }}</span>
</span>
</button>
</li>
</ol>
</section>
<section v-if="peers.length" class="rounded-lg border bg-card">
<h3 class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold">
<Users class="size-4 text-brand-text" /> Im selben Team <span class="font-normal text-muted-foreground">{{ peers.length }}</span>
</h3>
<ul class="max-h-80 overflow-y-auto p-2">
<li v-for="peer in peers" :key="peer.id">
<button type="button" class="flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-accent" @click="$emit('focus', peer)">
<PersonAvatar :person="peer" class="size-7 text-[10px]" />
<span class="min-w-0">
<span class="block truncate text-[13px] font-medium">{{ peer.name }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ peer.job_title || '–' }}</span>
</span>
</button>
</li>
</ul>
</section>
</aside>
</div>
</template>