统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -12,13 +12,16 @@
|
||||
@section('title', '我的履职记录')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
|
||||
{{-- ── 页面标题 ── --}}
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold text-gray-800">📝 我的履职记录</h2>
|
||||
<p class="text-sm text-gray-500 mt-1">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">📝 我的履职记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">
|
||||
{{ $user->username }} 的全部职务操作历史,共
|
||||
<span class="font-bold text-gray-700">{{ $logs->total() }}</span> 条记录
|
||||
<span class="font-semibold text-gray-700">{{ $logs->total() }}</span> 条记录
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -72,14 +75,14 @@
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div style="display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-bottom:24px;">
|
||||
<div class="grid gap-3 md:grid-cols-3 xl:grid-cols-6">
|
||||
@foreach ($statCards as $type => $card)
|
||||
@php
|
||||
$stat = $summary->get($type);
|
||||
$c = $colorMap[$card['color']];
|
||||
@endphp
|
||||
<a href="{{ request()->fullUrlWithQuery(['type' => $type, 'page' => 1]) }}"
|
||||
class="rounded-xl border {{ $c['bg'] }} {{ $c['border'] }} px-3 py-3 text-center hover:shadow-md transition
|
||||
class="rounded-xl border shadow-sm {{ $c['bg'] }} {{ $c['border'] }} px-3 py-3 text-center hover:shadow-md transition
|
||||
{{ request('type') === $type ? 'ring-2 ring-offset-1 ring-indigo-400 shadow-md' : '' }}">
|
||||
<div class="text-xl mb-0.5">{{ $card['icon'] }}</div>
|
||||
<div class="text-xs text-gray-500 mb-0.5 whitespace-nowrap">{{ $card['label'] }}</div>
|
||||
@@ -92,11 +95,13 @@
|
||||
</div>
|
||||
|
||||
{{-- ── 筛选栏 ── --}}
|
||||
<form method="GET" class="bg-white rounded-xl shadow-sm border p-4 mb-4 flex flex-wrap gap-3 items-end">
|
||||
<div class="{{ $adminListFilterCardClass }}">
|
||||
<div class="{{ $adminListFilterInnerClass }}">
|
||||
<form method="GET" class="{{ $adminListFilterFormClass }}">
|
||||
<div>
|
||||
<label class="block text-xs text-gray-500 mb-1">操作类型</label>
|
||||
<label class="{{ $adminListFilterLabelClass }}">操作类型</label>
|
||||
<select name="type"
|
||||
class="border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-300 outline-none">
|
||||
class="{{ $adminListFilterInputClass }}">
|
||||
<option value="">全部类型</option>
|
||||
@foreach ($statCards as $type => $card)
|
||||
<option value="{{ $type }}" {{ request('type') === $type ? 'selected' : '' }}>
|
||||
@@ -106,26 +111,28 @@
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs text-gray-500 mb-1">开始日期</label>
|
||||
<label class="{{ $adminListFilterLabelClass }}">开始日期</label>
|
||||
<input type="date" name="date_from" value="{{ request('date_from') }}"
|
||||
class="border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-300 outline-none">
|
||||
class="{{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs text-gray-500 mb-1">结束日期</label>
|
||||
<label class="{{ $adminListFilterLabelClass }}">结束日期</label>
|
||||
<input type="date" name="date_to" value="{{ request('date_to') }}"
|
||||
class="border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-300 outline-none">
|
||||
class="{{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="px-5 py-2 bg-indigo-600 text-white text-sm font-bold rounded-lg hover:bg-indigo-700 transition">
|
||||
class="{{ $adminListPrimaryButtonClass }}">
|
||||
🔍 查询
|
||||
</button>
|
||||
@if (request()->hasAny(['type', 'date_from', 'date_to']))
|
||||
<a href="{{ route('admin.appointments.my-duty-logs') }}"
|
||||
class="px-5 py-2 bg-gray-100 text-gray-600 text-sm rounded-lg hover:bg-gray-200 transition">
|
||||
class="{{ $adminListSecondaryButtonClass }}">
|
||||
✖ 清除筛选
|
||||
</a>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ── 记录表格 ── --}}
|
||||
@php
|
||||
@@ -141,66 +148,74 @@
|
||||
];
|
||||
@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 transition">
|
||||
<td class="px-4 py-3 text-gray-400 text-xs whitespace-nowrap">
|
||||
{{ $log->created_at->format('Y-m-d H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span class="text-xs px-2 py-0.5 rounded-full 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 text-xs">
|
||||
@if ($log->userPosition?->position)
|
||||
<span class="text-gray-400">{{ $log->userPosition->position->department?->name }}</span>
|
||||
@if ($log->userPosition->position->department)
|
||||
<span class="text-gray-300 mx-1">·</span>
|
||||
<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 whitespace-nowrap {{ $adminListSecondaryTextClass }}">
|
||||
{{ $log->created_at->format('Y-m-d H:i') }}
|
||||
</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 {{ $adminListSecondaryTextClass }}">
|
||||
@if ($log->userPosition?->position)
|
||||
<span>{{ $log->userPosition->position->department?->name }}</span>
|
||||
@if ($log->userPosition->position->department)
|
||||
<span class="mx-1 text-gray-300">·</span>
|
||||
@endif
|
||||
<span class="text-gray-600">{{ $log->userPosition->position->name }}</span>
|
||||
@else
|
||||
<span class="text-gray-300">超级管理员</span>
|
||||
@endif
|
||||
{{ $log->userPosition->position->name }}
|
||||
@else
|
||||
<span class="text-gray-300">超级管理员</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($log->amount)
|
||||
<span class="text-yellow-600 font-bold">+{{ number_format($log->amount) }}</span>
|
||||
<span class="text-gray-400 text-xs">金币</span>
|
||||
@else
|
||||
<span class="text-gray-300">—</span>
|
||||
@endif
|
||||
</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-16 text-center text-gray-400">
|
||||
<div class="text-4xl mb-3">📋</div>
|
||||
<div>暂无履职操作记录</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($log->amount)
|
||||
<span class="text-sm font-semibold text-yellow-600">+{{ number_format($log->amount) }}</span>
|
||||
<span class="{{ $adminListSecondaryTextClass }}">金币</span>
|
||||
@else
|
||||
<span class="text-gray-300">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $log->remark ?: '—' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="{{ $adminListEmptyClass }}">
|
||||
<div class="mb-3 text-4xl">📋</div>
|
||||
<div>暂无履职操作记录</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($logs->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $logs->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-4">{{ $logs->links() }}</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user