UI: Ebenen-Menüs angepasst (Portal-Mitarbeiter, Reseller „Einloggen als")

- Portal-Topnav: zusätzlich „Mitarbeiter" (firmenübergreifend, nur einloggbare
  Mitarbeiter; Firma-Spalte statt Standort, kein Hinzufügen, „Einloggen als").
- Reseller-Topnav: „Firmen" → „Einloggen als" (gleiche Firmen-&-Mitarbeiter-
  Ansicht). Plattform behält Label „Firmen".
- EmployeesView: portalMode (isPlatformAdmin) filtert auf login=true.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Thomas Peterson 2026-06-06 13:10:23 +02:00
parent d66c7cc4aa
commit 44661d9b02
2 changed files with 18 additions and 8 deletions

View File

@ -15,7 +15,10 @@ const topNav = computed<NavItem[]>(() => {
return [
{ label: 'Dashboard', to: '/app', icon: 'M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z', show: above },
{ label: 'Reseller', to: '/app/resellers', icon: 'M3 21h18M5 21V7l8-4v18M19 21V11l-6-3', show: auth.isPlatformAdmin },
{ label: 'Firmen', to: '/app/companies', icon: 'M3 7h18v13H3zM8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2', show: above },
// Plattform: Firmen" (alle); Reseller: Einloggen als" (eigene Firmenkunden)
{ label: auth.isPlatformAdmin ? 'Firmen' : 'Einloggen als', to: '/app/companies', icon: 'M3 7h18v13H3zM8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2', show: above },
// Plattform: einloggbare Mitarbeiter (firmenübergreifend)
{ label: 'Mitarbeiter', to: '/app/employees', icon: 'M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z', show: auth.isPlatformAdmin },
{ label: 'Produkte', to: '/app/products', icon: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16zM3.27 6.96 12 12.01l8.73-5.05M12 22.08V12', show: above },
{ label: 'Bestellungen', to: '/app/orders', icon: 'M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4zM3 6h18M16 10a4 4 0 0 1-8 0', show: above },
{ label: 'Einstellungen', to: '/app/settings', icon: 'M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6', show: above },

View File

@ -67,10 +67,17 @@ async function workAs(e: Employee) {
}
const companyMap = computed(() => Object.fromEntries(companies.value.map((c) => [c['@id'], c])))
function companyName(iri: string) { return companyMap.value[iri]?.name ?? '' }
// Portal-Ebene (Plattform-Admin): firmenübergreifend, nur einloggbare Mitarbeiter
const portalMode = computed(() => auth.isPlatformAdmin)
const filtered = computed(() => {
let base = employees.value
if (portalMode.value) base = base.filter((e) => e.login)
const q = search.value.toLowerCase().trim()
if (!q) return employees.value
return employees.value.filter((e) =>
if (!q) return base
return base.filter((e) =>
`${e.firstName} ${e.lastName} ${e.position ?? ''} ${e.email ?? ''}`.toLowerCase().includes(q),
)
})
@ -206,9 +213,9 @@ onMounted(load)
<div class="page-head">
<div>
<h1>Mitarbeiter</h1>
<p class="muted">Profile als Single Source of Truth für alle Kanäle</p>
<p class="muted">{{ portalMode ? 'Alle einloggbaren Mitarbeiter der Plattform' : 'Profile als Single Source of Truth für alle Kanäle' }}</p>
</div>
<button class="btn btn-primary" @click="openCreate">+ Mitarbeiter hinzufügen</button>
<button v-if="!portalMode" class="btn btn-primary" @click="openCreate">+ Mitarbeiter hinzufügen</button>
</div>
<div class="card">
@ -218,7 +225,7 @@ onMounted(load)
</div>
<table class="tbl">
<thead>
<tr><th>Name</th><th>Position</th><th>Rechtegruppe</th><th>Standort</th><th></th></tr>
<tr><th>Name</th><th>Position</th><th>Rechtegruppe</th><th>{{ portalMode ? 'Firma' : 'Standort' }}</th><th></th></tr>
</thead>
<tbody>
<tr v-if="loading"><td colspan="5" class="empty">Lädt</td></tr>
@ -238,9 +245,9 @@ onMounted(load)
<span class="badge badge-role">{{ GROUP_LABEL[groupOf(e)] }}</span>
<span v-if="e.login" class="muted small" title="Login aktiv"> · 🔑</span>
</td>
<td class="muted">{{ locName(e.location) }}</td>
<td class="muted">{{ portalMode ? companyName(e.company) : locName(e.location) }}</td>
<td class="right">
<button v-if="canWorkAs(e)" class="btn btn-soft btn-sm" @click="workAs(e)">Arbeiten als</button>
<button v-if="canWorkAs(e)" class="btn btn-soft btn-sm" @click="workAs(e)">{{ portalMode ? 'Einloggen als' : 'Arbeiten als' }}</button>
<a class="btn btn-soft btn-sm" :href="profileUrl(e)" target="_blank" rel="noopener">Profil </a>
<button class="btn btn-ghost btn-sm" @click="openEdit(e)">Bearbeiten</button>
<button class="btn btn-ghost btn-sm" @click="del(e)">Löschen</button>