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

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,13 +11,18 @@
@section('title', '权限操作日志 · ' . $userPosition->user->username)
@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">
{{ $userPosition->position->icon }} {{ $userPosition->user->username }} · {{ $userPosition->position->name }}
</h2>
<p class="text-sm text-gray-500 mt-1">权限操作记录(共 {{ $logs->total() }} 条)</p>
</div>
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
<div class="{{ $adminListPageClass }}">
<div class="{{ $adminListHeaderCardClass }}">
<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 }}">
{{ $userPosition->position->icon }} {{ $userPosition->user->username }} · {{ $userPosition->position->name }}
</h2>
<p class="{{ $adminListHeaderSubtitleClass }}">权限操作记录(共 {{ $logs->total() }} 条)</p>
</div>
</div>
@php
$actionColors = [
@@ -32,42 +37,51 @@
];
@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-center">操作类型</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>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse ($logs as $log)
@php $colorClass = $actionColors[$log->action_type] ?? 'bg-gray-100 text-gray-600'; @endphp
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 text-gray-500 text-xs">{{ $log->created_at->format('m-d H:i:s') }}</td>
<td class="px-4 py-3 text-center">
<span class="text-xs px-2 py-0.5 rounded font-bold {{ $colorClass }}">
{{ $log->action_label }}
</span>
</td>
<td class="px-4 py-3 font-bold text-gray-700">{{ $log->targetUser->username ?? '—' }}</td>
<td class="px-4 py-3 text-gray-500">{{ $log->targetPosition?->name ?? '—' }}</td>
<td class="px-4 py-3 text-center text-yellow-600 font-bold">
{{ $log->amount ? number_format($log->amount) . ' 金币' : '—' }}
</td>
<td class="px-4 py-3 text-gray-400 text-xs">{{ $log->remark ?? '—' }}</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-4 py-12 text-center text-gray-400">暂无权限操作记录</td>
</tr>
@endforelse
</tbody>
</table>
<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 }} text-center">操作类型</th>
<th class="{{ $adminListTableHeadCellClass }}">操作对象</th>
<th class="{{ $adminListTableHeadCellClass }}">目标职务</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">奖励金额</th>
<th class="{{ $adminListTableHeadCellClass }}">备注</th>
</tr>
</thead>
<tbody class="{{ $adminListTableBodyClass }}">
@forelse ($logs as $log)
@php $colorClass = $actionColors[$log->action_type] ?? 'bg-gray-100 text-gray-600'; @endphp
<tr class="{{ $adminListTableRowClass }}">
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $log->created_at->format('m-d H:i:s') }}</td>
<td class="px-4 py-3 text-center">
<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold {{ $colorClass }}">
{{ $log->action_label }}
</span>
</td>
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $log->targetUser->username ?? '—' }}</td>
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">{{ $log->targetPosition?->name ?? '—' }}</td>
<td class="px-4 py-3 text-center text-sm font-semibold text-yellow-600">
{{ $log->amount ? number_format($log->amount) . ' 金币' : '—' }}
</td>
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $log->remark ?? '—' }}</td>
</tr>
@empty
<tr>
<td colspan="6" class="{{ $adminListEmptyClass }}">暂无权限操作记录</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if ($logs->hasPages())
<div class="{{ $adminListPaginationClass }}">{{ $logs->links() }}</div>
@endif
</div>
</div>
<div class="mt-4">{{ $logs->links() }}</div>
@endsection