统一后台列表页样式并调整站长菜单

This commit is contained in:
2026-04-26 18:10:37 +08:00
parent 61cfc2091c
commit 00270b3904
36 changed files with 2590 additions and 2345 deletions
@@ -11,52 +11,67 @@
@section('title', '历史任职记录')
@section('content')
<div class="mb-6">
<a href="{{ route('admin.appointments.index') }}" class="text-sm text-indigo-600 hover:underline"> 返回任命管理</a>
<h2 class="text-lg font-bold text-gray-800 mt-2">历史任职记录</h2>
<p class="text-sm text-gray-500 mt-1">已撤销的职务记录(共 {{ $history->total() }} 条)</p>
</div>
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50 text-gray-600 text-xs">
<tr>
<th class="px-4 py-3 text-left">用户</th>
<th class="px-4 py-3 text-left">职务</th>
<th class="px-4 py-3 text-left">任命人</th>
<th class="px-4 py-3 text-center">任命时间</th>
<th class="px-4 py-3 text-left">撤销人</th>
<th class="px-4 py-3 text-center">撤销时间</th>
<th class="px-4 py-3 text-center">在职天数</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse ($history as $up)
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 font-bold text-gray-800">{{ $up->user->username }}</td>
<td class="px-4 py-3">
<span class="mr-1">{{ $up->position->icon }}</span>
<span style="color: {{ $up->position->department->color }}">{{ $up->position->name }}</span>
<span class="text-xs text-gray-400 ml-1">{{ $up->position->department->name }}</span>
</td>
<td class="px-4 py-3 text-gray-500">{{ $up->appointedBy?->username ?? '系统' }}</td>
<td class="px-4 py-3 text-center text-gray-500 text-xs">{{ $up->appointed_at->format('Y-m-d') }}
</td>
<td class="px-4 py-3 text-gray-500">{{ $up->revokedBy?->username ?? '系统' }}</td>
<td class="px-4 py-3 text-center text-gray-500 text-xs">
{{ $up->revoked_at?->format('Y-m-d') ?? '—' }}</td>
<td class="px-4 py-3 text-center">
<span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">{{ $up->duration_days }}
</span>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="px-4 py-12 text-center text-gray-400">暂无历史记录</td>
</tr>
@endforelse
</tbody>
</table>
<div class="{{ $adminListPageClass }}">
<div class="{{ $adminListHeaderCardClass }}">
<div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
<div>
<a href="{{ route('admin.appointments.index') }}" class="text-sm font-semibold text-indigo-600 hover:text-indigo-700"> 返回任命管理</a>
<h2 class="mt-2 {{ $adminListHeaderTitleClass }}">历史任职记录</h2>
<p class="{{ $adminListHeaderSubtitleClass }}">已撤销的职务记录(共 {{ $history->total() }} 条)</p>
</div>
</div>
</div>
<div class="{{ $adminListCardClass }}">
<div class="{{ $adminListSectionHeadClass }}">
<h3 class="{{ $adminListSectionTitleClass }}">任职历史列表</h3>
<p class="{{ $adminListSectionDescClass }}">按撤销后的记录保留完整的任命与撤销链路,便于审计追踪。</p>
</div>
<div class="{{ $adminListTableWrapClass }}">
<table class="{{ $adminListTableClass }} whitespace-nowrap">
<thead>
<tr class="{{ $adminListTableHeadRowClass }}">
<th class="{{ $adminListTableHeadCellClass }}">用户</th>
<th class="{{ $adminListTableHeadCellClass }}">职务</th>
<th class="{{ $adminListTableHeadCellClass }}">任命人</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">任命时间</th>
<th class="{{ $adminListTableHeadCellClass }}">撤销人</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">撤销时间</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">在职天数</th>
</tr>
</thead>
<tbody class="{{ $adminListTableBodyClass }}">
@forelse ($history as $up)
<tr class="{{ $adminListTableRowClass }}">
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $up->user->username }}</td>
<td class="px-4 py-3">
<div class="flex items-center gap-1">
<span>{{ $up->position->icon }}</span>
<span class="text-sm font-semibold" style="color: {{ $up->position->department->color }}">{{ $up->position->name }}</span>
<span class="{{ $adminListSecondaryTextClass }}">{{ $up->position->department->name }}</span>
</div>
</td>
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">{{ $up->appointedBy?->username ?? '系统' }}</td>
<td class="px-4 py-3 text-center {{ $adminListSecondaryTextClass }}">{{ $up->appointed_at->format('Y-m-d') }}</td>
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">{{ $up->revokedBy?->username ?? '系统' }}</td>
<td class="px-4 py-3 text-center {{ $adminListSecondaryTextClass }}">{{ $up->revoked_at?->format('Y-m-d') ?? '—' }}</td>
<td class="px-4 py-3 text-center">
<span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-xs font-semibold text-gray-600">{{ $up->duration_days }} </span>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="{{ $adminListEmptyClass }}">暂无历史记录</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if ($history->hasPages())
<div class="{{ $adminListPaginationClass }}">{{ $history->links() }}</div>
@endif
</div>
</div>
<div class="mt-4">{{ $history->links() }}</div>
@endsection