{{-- 文件功能:勤务台页面(职务管理荣誉展示台) 左侧子菜单:任职列表、日榜、周榜、月榜、总榜 URL:/duty-hall?tab=roster|day|week|month|all @extends layouts.app --}} @extends('layouts.app') @section('title', '勤务台 · ' . ($tabs[$tab]['label'] ?? '任职列表') . ' - 飘落流星') @section('nav-icon', '🏛️') @section('nav-title', '勤务台') @section('content')
{{-- ═══ 左侧子菜单 ═══ --}} {{-- ═══ 主内容区 ═══ --}}
{{-- ─── Tab:任职列表 ─── --}} @if ($tab === 'roster')

🏛️ 任职列表

按部门 · 职务展示当前全部在职人员

@if ($currentStaff->isEmpty())
📭

暂未设置任何部门

@else
@foreach ($currentStaff as $dept)
{{-- 部门标题 --}}
{{ $dept->icon ?? '🏢' }} {{ $dept->name }} {{ $dept->positions->count() }} 个职务
@if ($dept->positions->isEmpty())
该部门暂无职务设置
@else
@foreach ($dept->positions as $position)
{{-- 职务名 --}}
{{ $position->icon }} {{ $position->name }} @php $current = $position->activeUserPositions->count(); $maxSlots = $position->max_persons; $isFull = $maxSlots !== null && $current >= $maxSlots; @endphp {{-- 名额计数标签 --}} {{ $current }} @if ($maxSlots !== null) /{{ $maxSlots }} @endif 人 @if ($isFull) 已满 @elseif ($current === 0) (暂缺) @endif
{{-- 在职人员列表 --}} @if ($position->activeUserPositions->isNotEmpty())
@foreach ($position->activeUserPositions as $up)

{{ $up->user?->username ?? '未知' }}

{{ $up->appointed_at?->format('Y-m-d') }} 起 · {{ $up->duration_days }} 天

@endforeach
@else {{-- 空缺占位 --}}
👤 暂无任职人员
@endif
@endforeach
@endif
@endforeach
@endif {{-- ─── Tab:日/周/月/总榜 ─── --}} @else @php $tabMeta = $tabs[$tab]; $periodLabel = match ($tab) { 'day' => today()->format('Y年m月d日'), 'week' => now()->startOfWeek()->format('m月d日') . ' – ' . now()->endOfWeek()->format('m月d日'), 'month' => now()->format('Y年m月'), 'all' => '历史累计', }; @endphp

{{ $tabMeta['icon'] }} 勤务{{ $tabMeta['label'] }}

{{ $periodLabel }} · 综合统计在线时长、管理操作、奖励金币

@if ($leaderboard->isEmpty())
📊

该时段暂无勤务记录

@else {{-- 表头(桌面端网格:名次1 + 成员4 + 在线3 + 签到2 + 管理操作2) --}} @foreach ($leaderboard as $i => $row) @php $h = intdiv($row->total_seconds, 3600); $m = intdiv($row->total_seconds % 3600, 60); $medal = match ($i) { 0 => '🥇', 1 => '🥈', 2 => '🥉', default => null, }; $rowBg = match ($i) { 0 => 'bg-yellow-50/50', 1 => 'bg-gray-50/70', 2 => 'bg-amber-50/40', default => '', }; @endphp {{-- 桌面端行 --}} {{-- 移动端:紧凑卡片 --}}
@if ($medal) {{ $medal }} @else {{ $i + 1 }} @endif

{{ $row->user?->username ?? '未知' }}

{{ $h }}h{{ $m }}m · 登录{{ $row->checkin_count }}次

@if ($row->admin_count > 0)

⚡{{ $row->admin_count }}次管理

@endif @if ($row->reward_count > 0)

🎁{{ $row->reward_count }}次奖励

@endif
@endforeach {{-- 图例说明 --}}
🕐 在线时长:在职期间进入房间的累计时长 📋 登录:进入房间次数 ⚡ 管理:警告/踢出/禁言/封IP等操作次数 🎁 奖励:发送奖励金币次数(悬停查看总金额)
@endif
@endif
{{-- 移动端底部 Tab 导航 --}}
@foreach ($tabs as $key => $meta) {{ $meta['icon'] }} {{ $meta['label'] }} @endforeach
@endsection