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

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
+36 -38
View File
@@ -12,6 +12,7 @@
@section('title', '职务管理')
@section('content')
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
<div x-data="{
showForm: false,
editing: null,
@@ -82,30 +83,27 @@
}">
{{-- 头部 --}}
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-lg font-bold text-gray-800">职务管理</h2>
<p class="text-sm text-gray-500">管理各部门职务,配置等级、图标、人数上限和任命权限</p>
</div>
<div class="flex space-x-2">
<div class="{{ $adminListHeaderCardClass }} mb-6">
<div class="flex justify-between items-center">
<div>
<h2 class="{{ $adminListHeaderTitleClass }}">职务管理</h2>
<p class="{{ $adminListHeaderSubtitleClass }}">管理各部门职务,配置等级、图标、人数上限和任命权限</p>
</div>
<div class="flex space-x-2">
<a href="{{ route('admin.departments.index') }}"
style="background-color:#e5e7eb;color:#374151;padding:0.5rem 1rem;border-radius:0.5rem;font-weight:700;font-size:0.875rem;display:inline-flex;align-items:center;text-decoration:none;"
onmouseover="this.style.backgroundColor='#d1d5db'" onmouseout="this.style.backgroundColor='#e5e7eb'">
class="{{ $adminListSecondaryButtonClass }}">
部门管理
</a>
<a href="{{ route('admin.appointments.index') }}"
style="background-color:#f97316;color:#fff;padding:0.5rem 1rem;border-radius:0.5rem;font-weight:700;font-size:0.875rem;display:inline-flex;align-items:center;text-decoration:none;box-shadow:0 1px 2px rgba(0,0,0,.1);"
onmouseover="this.style.backgroundColor='#ea580c'" onmouseout="this.style.backgroundColor='#f97316'">
class="px-4 py-2 rounded-lg text-sm font-semibold text-white bg-orange-500 hover:bg-orange-600 transition shadow-sm">
🎖️ 任命管理
</a>
@if (Auth::id() === 1)
<button @click="openCreate()"
style="background-color:#4f46e5;color:#fff;padding:0.5rem 1.25rem;border-radius:0.5rem;font-weight:700;border:none;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.1);"
onmouseover="this.style.backgroundColor='#4338ca'"
onmouseout="this.style.backgroundColor='#4f46e5'">
<button @click="openCreate()" class="{{ $adminListPrimaryButtonClass }}">
+ 新增职务
</button>
@endif
</div>
</div>
</div>
@@ -176,33 +174,33 @@
<span class="text-xs text-gray-400">位阶 {{ $dept->rank }}</span>
</div>
<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">
<div class="{{ $adminListCardClass }}">
<table class="{{ $adminListTableClass }}">
<thead class="{{ $adminListTableHeadRowClass }}">
<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-center">位阶</th>
<th class="px-4 py-3 text-center">等级</th>
<th class="px-4 py-3 text-center">人数上限</th>
<th class="px-4 py-3 text-center">当前在职</th>
<th class="px-4 py-3 text-center">单次上限</th>
<th class="px-4 py-3 text-center">单日上限</th>
<th class="px-4 py-3 text-center">任命权</th>
<th class="px-4 py-3 text-center">礼包默认</th>
<th class="px-4 py-3 text-center">聊天室权限</th>
<th class="{{ $adminListTableHeadCellClass }}">图标</th>
<th class="{{ $adminListTableHeadCellClass }}">职务名</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">位阶</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">等级</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">人数上限</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">当前在职</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">单次上限</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">单日上限</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">任命权</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">礼包默认</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">聊天室权限</th>
@php $superLvl = (int) \App\Models\Sysparam::getValue('superlevel', '100'); @endphp
@if (Auth::user()->user_level >= $superLvl)
<th class="px-4 py-3 text-right">操作</th>
<th class="{{ $adminListTableHeadCellClass }} text-right">操作</th>
@endif
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
<tbody class="{{ $adminListTableBodyClass }}">
@forelse ($dept->positions as $pos)
@php $appointableIds = $pos->appointablePositions->pluck('id')->toArray(); @endphp
<tr class="hover:bg-gray-50 transition">
<tr class="{{ $adminListTableRowClass }}">
<td class="px-4 py-3 text-xl">{{ $pos->icon }}</td>
<td class="px-4 py-3 font-bold">{{ $pos->name }}</td>
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $pos->name }}</td>
<td class="px-4 py-3 text-center">
<span
class="text-xs bg-indigo-100 text-indigo-700 px-2 py-0.5 rounded font-mono">{{ $pos->rank }}</span>
@@ -313,7 +311,7 @@
sort_order: {{ $pos->sort_order }},
requestUrl: '{{ route('admin.positions.update', $pos->id) }}'
}, {{ json_encode($appointableIds) }}, {{ json_encode($pos->permissions ?? []) }})"
class="text-xs bg-indigo-50 text-indigo-600 font-bold px-2 py-1 rounded hover:bg-indigo-600 hover:text-white transition">
class="{{ $adminListActionButtonClass }} bg-indigo-50 text-indigo-600 hover:bg-indigo-600 hover:text-white">
编辑
</button>
@endif
@@ -323,17 +321,17 @@
data-admin-confirm="确定删除职务【{{ $pos->name }}】?">
@csrf @method('DELETE')
<button type="submit"
class="text-xs bg-red-50 text-red-600 font-bold px-2 py-1 rounded hover:bg-red-600 hover:text-white transition">
删除
</button>
</form>
class="{{ $adminListActionButtonClass }} bg-red-50 text-red-600 hover:bg-red-600 hover:text-white">
删除
</button>
</form>
@endif
</td>
</tr>
@empty
<tr>
<td colspan="{{ Auth::user()->user_level >= $superLvl ? 11 : 10 }}"
class="px-4 py-6 text-center text-gray-400">该部门暂无职务</td>
class="{{ $adminListEmptyClass }}">该部门暂无职务</td>
</tr>
@endforelse
</tbody>