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
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:
parent
ab0384ceb1
commit
33862183bf
80 changed files with 475 additions and 352 deletions
|
|
@ -10,35 +10,35 @@ import OrgCard from './OrgCard.vue';
|
|||
const props = defineProps({
|
||||
person: { type: Object, required: true },
|
||||
teams: { type: Object, default: () => ({}) },
|
||||
path: { type: Array, default: () => [] },
|
||||
open: { type: Array, default: () => [] },
|
||||
focus: { type: Number, default: null },
|
||||
});
|
||||
|
||||
defineEmits(['focus']);
|
||||
|
||||
const isOnPath = () => props.path.includes(props.person.id) && props.person.id !== props.focus;
|
||||
const startsOpen = () => props.open.includes(props.person.id) && props.teams[props.person.id] !== undefined;
|
||||
const team = ref(props.teams[props.person.id] ?? null);
|
||||
const open = ref(isOnPath() && team.value !== null);
|
||||
const expanded = ref(startsOpen());
|
||||
const loading = ref(false);
|
||||
|
||||
watch(() => props.teams, (teams) => {
|
||||
team.value = teams[props.person.id] ?? team.value;
|
||||
open.value = isOnPath() && team.value !== null;
|
||||
expanded.value = startsOpen();
|
||||
});
|
||||
|
||||
const managers = computed(() => (team.value ?? []).filter((p) => p.reports));
|
||||
const members = computed(() => (team.value ?? []).filter((p) => !p.reports));
|
||||
|
||||
async function toggle() {
|
||||
open.value = !open.value;
|
||||
expanded.value = !expanded.value;
|
||||
|
||||
if (open.value && team.value === null) {
|
||||
if (expanded.value && team.value === null) {
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
team.value = (await http.get(`/personen/organigramm/${props.person.id}/team`)).team;
|
||||
} catch {
|
||||
open.value = false;
|
||||
expanded.value = false;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
|
@ -48,9 +48,9 @@ async function toggle() {
|
|||
|
||||
<template>
|
||||
<li>
|
||||
<OrgCard :person="person" :highlighted="person.id === focus" :open="open" :loading="loading" @toggle="toggle" @focus="$emit('focus', $event)" />
|
||||
<ul v-if="open && team?.length">
|
||||
<OrgChartNode v-for="child in managers" :key="child.id" :person="child" :teams="teams" :path="path" :focus="focus" @focus="$emit('focus', $event)" />
|
||||
<OrgCard :person="person" :highlighted="person.id === focus" :open="expanded" :loading="loading" @toggle="toggle" @focus="$emit('focus', $event)" />
|
||||
<ul v-if="expanded && team?.length">
|
||||
<OrgChartNode v-for="child in managers" :key="child.id" :person="child" :teams="teams" :open="open" :focus="focus" @focus="$emit('focus', $event)" />
|
||||
<li v-if="members.length">
|
||||
<div class="org-members" :class="{ 'org-members-wide': members.length > 8 }">
|
||||
<OrgCard v-for="member in members" :key="member.id" :person="member" compact :highlighted="member.id === focus" @focus="$emit('focus', $event)" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue