Organigramm und Dokumente neu gestaltet
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m30s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m34s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m45s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m35s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m42s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m7s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m15s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m30s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m34s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m45s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m35s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m42s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m7s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m15s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
- Organigramm: grafischer Baum (Linien, Zoom, Verschieben) und Fokus-Ansicht mit Vorgesetzten, Team und direkt Unterstellten - Dokumente: Übersicht mit Bereichen und „Zuletzt aktualisiert“, sortierbare Dateiliste oder Kacheln (Wahl wird gemerkt) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4fcc41ed30
commit
ab0384ceb1
99 changed files with 1292 additions and 443 deletions
|
|
@ -1,11 +1,13 @@
|
|||
<script setup>
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { Link, router } from '@inertiajs/vue3';
|
||||
import { Network, Search, X } from '@lucide/vue';
|
||||
import { Network, ScanSearch, Search, X } from '@lucide/vue';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import OrgNode from '@/components/org/OrgNode.vue';
|
||||
import OrgChart from '@/components/org/OrgChart.vue';
|
||||
import OrgFocus from '@/components/org/OrgFocus.vue';
|
||||
import { useStoredChoice } from '@/composables/useStoredChoice';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { http } from '@/lib/http';
|
||||
|
||||
|
|
@ -14,10 +16,31 @@ const props = defineProps({
|
|||
path: { type: Array, default: () => [] },
|
||||
teams: { type: Object, default: () => ({}) },
|
||||
focus: { type: Number, default: null },
|
||||
details: { type: Object, default: null },
|
||||
view: { type: String, default: 'baum' },
|
||||
stats: { type: Object, default: () => ({ people: 0, leaders: 0 }) },
|
||||
unassigned: { type: Number, default: 0 },
|
||||
});
|
||||
|
||||
// Person suchen → Weg im Organigramm öffnen
|
||||
// Gewählte Ansicht merken; ohne Angabe in der Adresse die gemerkte öffnen.
|
||||
const remembered = useStoredChoice('organigram.view', 'baum', ['baum', 'fokus']);
|
||||
|
||||
onMounted(() => {
|
||||
if (!new URLSearchParams(window.location.search).has('ansicht') && remembered.value !== props.view) {
|
||||
show(remembered.value, props.focus, true);
|
||||
}
|
||||
});
|
||||
|
||||
watch(() => props.view, (view) => (remembered.value = view));
|
||||
|
||||
function show(view, personId = props.focus, replace = false) {
|
||||
const query = { ansicht: view };
|
||||
if (personId) query.person = personId;
|
||||
|
||||
router.get('/personen/organigramm', query, { preserveScroll: view === 'fokus', replace });
|
||||
}
|
||||
|
||||
// Person suchen → im Organigramm zeigen
|
||||
const query = ref('');
|
||||
const results = ref([]);
|
||||
let timer;
|
||||
|
|
@ -36,56 +59,76 @@ watch(query, (value) => {
|
|||
}, 250);
|
||||
});
|
||||
|
||||
function focusPerson(person) {
|
||||
function pick(person) {
|
||||
query.value = '';
|
||||
results.value = [];
|
||||
router.get('/personen/organigramm', { person: person.id }, { preserveScroll: true, preserveState: false });
|
||||
show(props.view, person.id);
|
||||
}
|
||||
|
||||
function scrollToFocus() {
|
||||
if (props.focus) {
|
||||
nextTick(() => document.getElementById(`person-${props.focus}`)?.scrollIntoView({ behavior: 'smooth', block: 'center' }));
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(scrollToFocus);
|
||||
watch(() => props.focus, scrollToFocus);
|
||||
const number = (n) => n.toLocaleString('de-DE');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout title="Organigramm">
|
||||
<div class="mb-6 flex flex-wrap items-end justify-between gap-4">
|
||||
<div class="mb-5 flex flex-wrap items-end justify-between gap-4">
|
||||
<div>
|
||||
<nav class="mb-1 text-[13px] text-muted-foreground"><Link href="/personen" class="hover:underline">Personen</Link></nav>
|
||||
<nav class="mb-1 text-[13px] text-muted-foreground" aria-label="Brotkrumen">
|
||||
<Link href="/personen" class="hover:text-foreground hover:underline">Personen</Link>
|
||||
</nav>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Organigramm</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">Wer wem unterstellt ist – zum Aufklappen.</p>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
{{ number(stats.people) }} Personen · {{ number(stats.leaders) }} mit Personalverantwortung
|
||||
</p>
|
||||
</div>
|
||||
<div class="relative w-full sm:w-80">
|
||||
<Search class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<Input v-model="query" class="pl-9" placeholder="Person im Organigramm finden …" aria-label="Person im Organigramm finden" autocomplete="off" />
|
||||
<ul v-if="results.length" class="absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-md border bg-popover p-1 shadow-md">
|
||||
<li v-for="person in results" :key="person.id">
|
||||
<button type="button" class="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent" @click="focusPerson(person)">
|
||||
<PersonAvatar :person="person" class="size-7 text-[10px]" />
|
||||
<span class="min-w-0"><span class="block truncate font-medium">{{ person.name }}</span><span class="block truncate text-xs text-muted-foreground">{{ person.job_title }}</span></span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center">
|
||||
<div class="inline-flex self-start rounded-md border bg-card p-0.5" role="group" aria-label="Ansicht">
|
||||
<button
|
||||
v-for="option in [{ key: 'baum', icon: Network, label: 'Baum' }, { key: 'fokus', icon: ScanSearch, label: 'Fokus' }]"
|
||||
:key="option.key"
|
||||
type="button"
|
||||
class="inline-flex h-9 items-center gap-1.5 rounded px-3 text-[13px]"
|
||||
:class="view === option.key ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-muted-foreground hover:text-foreground'"
|
||||
:aria-pressed="view === option.key"
|
||||
@click="view !== option.key && show(option.key)"
|
||||
>
|
||||
<component :is="option.icon" class="size-4" /> {{ option.label }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="relative sm:w-80">
|
||||
<Search class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<Input v-model="query" class="h-10 bg-card pl-9" placeholder="Person finden …" aria-label="Person im Organigramm finden" autocomplete="off" />
|
||||
<ul v-if="results.length" class="absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-md border bg-popover p-1 shadow-md">
|
||||
<li v-for="person in results" :key="person.id">
|
||||
<button type="button" class="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent" @click="pick(person)">
|
||||
<PersonAvatar :person="person" class="size-7 text-[10px]" />
|
||||
<span class="min-w-0"><span class="block truncate font-medium">{{ person.name }}</span><span class="block truncate text-xs text-muted-foreground">{{ person.job_title }}</span></span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="focus" class="mb-4 flex items-center gap-2 text-sm">
|
||||
<span class="text-muted-foreground">Weg zur gesuchten Person ist aufgeklappt.</span>
|
||||
<Link href="/personen/organigramm" class="inline-flex items-center gap-1 font-medium text-brand-text hover:underline"><X class="size-3.5" /> Zurücksetzen</Link>
|
||||
<div v-if="!roots.length" class="rounded-lg border bg-card">
|
||||
<EmptyState :icon="Network" title="Noch kein Organigramm" text="Es sind noch keine Vorgesetzten hinterlegt. Sie kommen aus dem Anmeldedienst (z. B. Entra ID) oder werden im Admin-Bereich bei den Benutzern eingetragen." />
|
||||
</div>
|
||||
|
||||
<ul v-if="roots.length" class="grid max-w-3xl gap-3">
|
||||
<OrgNode v-for="person in roots" :key="person.id" :person="person" :teams="teams" :path="path" :focus="focus" />
|
||||
</ul>
|
||||
<div v-else class="rounded-lg border bg-card">
|
||||
<EmptyState :icon="Network" title="Noch kein Organigramm" text="Es sind noch keine Vorgesetzten hinterlegt. Sie kommen aus Microsoft Entra ID oder werden im Admin-Bereich bei den Benutzern eingetragen." />
|
||||
</div>
|
||||
<template v-else-if="view === 'fokus' && details">
|
||||
<OrgFocus :roots="roots" :teams="teams" :path="path" :details="details" @focus="(p) => show('fokus', p.id)" @show-in-tree="(p) => show('baum', p.id)" />
|
||||
</template>
|
||||
|
||||
<p v-if="unassigned" class="mt-6 text-[13px] text-muted-foreground">{{ unassigned === 1 ? '1 Person' : `${unassigned} Personen` }} ohne Vorgesetzte*n und ohne Team {{ unassigned === 1 ? 'erscheint' : 'erscheinen' }} hier nicht.</p>
|
||||
<template v-else>
|
||||
<div v-if="focus" class="mb-3 flex items-center gap-2 text-[13px]">
|
||||
<span class="text-muted-foreground">Der Weg zur gesuchten Person ist aufgeklappt.</span>
|
||||
<Link href="/personen/organigramm?ansicht=baum" class="inline-flex items-center gap-1 font-medium text-brand-text hover:underline"><X class="size-3.5" /> Zurücksetzen</Link>
|
||||
</div>
|
||||
<OrgChart :roots="roots" :teams="teams" :path="path" :focus="focus" @focus="(p) => show('fokus', p.id)" />
|
||||
</template>
|
||||
|
||||
<p v-if="unassigned" class="mt-4 text-[13px] text-muted-foreground">
|
||||
{{ unassigned === 1 ? '1 Person' : `${number(unassigned)} Personen` }} ohne Vorgesetzte*n und ohne Team {{ unassigned === 1 ? 'erscheint' : 'erscheinen' }} hier nicht.
|
||||
</p>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue