@extends('layouts.app') @section('title', '查詢資產管理者的設備清單') @section('content')
{{-- ── 左側選單 ── --}}
{{-- 分類篩選(有選到人才顯示) --}} @isset($selectedUser)
分類篩選
@php $baseQuery = ['manager_id' => $selectedUser->id]; @endphp 全部 @foreach($categories as $cat) @php $icon = match($cat) { '硬體' => 'bi-cpu', '軟體' => 'bi-code-slash', '人員' => 'bi-people', '基礎建設' => 'bi-building', '資訊' => 'bi-database', default => 'bi-tag', }; @endphp {{ $cat }} @endforeach
@endisset {{-- 操作 --}} @isset($selectedUser)
操作
@endisset
{{-- ── 右側內容 ── --}}

📋 查詢資產管理者的設備清單

{{-- Admin 搜尋表單 --}} @if (auth()->user()->role === 'admin')
@endif {{-- 資產清單 --}} @isset($selectedUser)
{{ $selectedUser->name }} {{ $activeCategory ? '— ' . $activeCategory : '' }} 的資產清單
{{ $assets->count() }} 筆
@forelse($assets as $a) @php $latestRepair = \App\Models\RepairRequest::where('asset_id', $a->id) ->where('user_id', auth()->id()) ->latest()->first(); @endphp @empty @endforelse
# 分類 設備名稱 序號 C I A 位置 可外借 報修
{{ $loop->iteration }} {{ $a->category }} {{ $a->asset_name }} {{ $a->asset_sn }} {{ $a->confidentiality }} {{ $a->integrity }} {{ $a->availability }} {{ $a->location }} {{ $a->lendable ? '✅' : '❌' }} @if ($latestRepair && $latestRepair->status !== 'resolved') @if($latestRepair->status === 'pending') ⚠️ 待處理 @elseif($latestRepair->status === 'in_progress') 🔧 維修中 @endif @else 🛠️ 報修 @endif
無資產資料
{{-- CIA 說明 --}}
備註: C 機密 I 完整 A 可用 等級:1(最低)~ 5(最高)
@endisset
{{-- .col-md-10 --}}
{{-- .row --}}
@endsection @push('styles') @endpush @push('scripts') @endpush