fix(hse): remove icons from simper stats, drop unused flexibility card, and fix cramped table layout

This commit is contained in:
Ray1111-aa
2026-10-27 09:05:41 +07:00
parent 8ff273fa29
commit 06e31faf7c
@@ -82,90 +82,72 @@
</div> </div>
@endif @endif
<!-- Kartu KPI Ringkasan --> <!-- Ringkasan Statistik Minimalis (Tanpa Ikon & Tanpa Card Fleksibilitas) -->
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-xl">
<div class="bg-white rounded-2xl border border-slate-200 p-4 shadow-xs flex items-center space-x-3.5"> <div class="bg-white rounded-2xl border border-slate-200/90 px-6 py-4 shadow-xs">
<div class="w-11 h-11 rounded-xl bg-emerald-50 text-[#1b5e20] flex items-center justify-center text-lg flex-shrink-0">
<i class="fa-solid fa-id-card"></i>
</div>
<div>
<p class="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Total Kategori</p> <p class="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Total Kategori</p>
<p class="text-xl font-extrabold text-slate-900 mt-0.5">{{ count($simperTypes) }} Jenis</p> <p class="text-2xl font-extrabold text-slate-900 mt-1">
</div> {{ count($simperTypes) }} <span class="text-xs font-semibold text-slate-400">Jenis</span>
</p>
</div> </div>
<div class="bg-white rounded-2xl border border-slate-200 p-4 shadow-xs flex items-center space-x-3.5"> <div class="bg-white rounded-2xl border border-slate-200/90 px-6 py-4 shadow-xs">
<div class="w-11 h-11 rounded-xl bg-blue-50 text-blue-700 flex items-center justify-center text-lg flex-shrink-0">
<i class="fa-solid fa-users-gear"></i>
</div>
<div>
<p class="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Pemegang Aktif</p> <p class="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Pemegang Aktif</p>
<p class="text-xl font-extrabold text-slate-900 mt-0.5"> <p class="text-2xl font-extrabold text-slate-900 mt-1">
{{ $simperTypes->sum('active_holders_count') }} Personil {{ $simperTypes->sum('active_holders_count') }} <span class="text-xs font-semibold text-slate-400">Personil</span>
</p> </p>
</div> </div>
</div> </div>
<div class="bg-white rounded-2xl border border-slate-200 p-4 shadow-xs flex items-center space-x-3.5">
<div class="w-11 h-11 rounded-xl bg-amber-50 text-amber-700 flex items-center justify-center text-lg flex-shrink-0">
<i class="fa-solid fa-shield-halved"></i>
</div>
<div>
<p class="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Status Fleksibilitas</p>
<p class="text-sm font-extrabold text-slate-800 mt-0.5">Siap Dikustomisasi HSE</p>
</div>
</div>
</div>
<!-- Tabel Data Master Jenis SIMPER --> <!-- Tabel Data Master Jenis SIMPER -->
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden"> <div class="bg-white rounded-2xl border border-slate-200 shadow-xs overflow-hidden">
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<table class="min-w-full text-xs text-left border-collapse"> <table class="min-w-full text-xs text-left border-collapse">
<thead class="bg-[#06213f] text-white font-bold text-[11px] uppercase tracking-wider"> <thead class="bg-[#06213f] text-white font-bold text-[11px] uppercase tracking-wider">
<tr> <tr>
<th class="py-3.5 px-4 text-center w-12">NO</th> <th class="py-4 px-5 text-center w-14">NO</th>
<th class="py-3.5 px-4 whitespace-nowrap">KODE</th> <th class="py-4 px-5 whitespace-nowrap">KODE</th>
<th class="py-3.5 px-4 whitespace-nowrap min-w-[200px]">NAMA JENIS SIMPER</th> <th class="py-4 px-5 whitespace-nowrap min-w-[200px]">NAMA JENIS SIMPER</th>
<th class="py-3.5 px-4 whitespace-nowrap">CAKUPAN KENDARAAN</th> <th class="py-4 px-5 whitespace-nowrap min-w-[240px]">CAKUPAN KENDARAAN</th>
<th class="py-3.5 px-4 text-center whitespace-nowrap">PEMEGANG AKTIF</th> <th class="py-4 px-5 text-center whitespace-nowrap">PEMEGANG AKTIF</th>
<th class="py-3.5 px-4 text-center whitespace-nowrap">STATUS</th> <th class="py-4 px-5 text-center whitespace-nowrap">STATUS</th>
<th class="py-3.5 px-4 whitespace-nowrap min-w-[220px]">KETERANGAN</th> <th class="py-4 px-5 whitespace-nowrap min-w-[240px]">KETERANGAN</th>
<th class="py-3.5 px-4 text-center whitespace-nowrap w-24">AKSI</th> <th class="py-4 px-5 text-center whitespace-nowrap w-28">AKSI</th>
</tr> </tr>
</thead> </thead>
<tbody class="divide-y divide-slate-100 text-slate-700 bg-white font-medium"> <tbody class="divide-y divide-slate-100 text-slate-700 bg-white font-medium">
@forelse($simperTypes as $idx => $st) @forelse($simperTypes as $idx => $st)
<tr class="hover:bg-slate-50/80 transition"> <tr class="hover:bg-slate-50/80 transition">
<td class="py-3 px-4 text-center text-slate-400 font-mono">{{ $idx + 1 }}</td> <td class="py-4 px-5 text-center text-slate-400 font-mono">{{ $idx + 1 }}</td>
<td class="py-3 px-4"> <td class="py-4 px-5 whitespace-nowrap">
<span class="font-mono font-extrabold text-xs text-emerald-800 bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200"> <span class="inline-block font-mono font-extrabold text-xs text-emerald-900 bg-emerald-50 px-2.5 py-1 rounded-md border border-emerald-200 whitespace-nowrap">
{{ $st->code }} {{ $st->code }}
</span> </span>
</td> </td>
<td class="py-3 px-4"> <td class="py-4 px-5 min-w-[200px]">
<span class="font-bold text-slate-900 text-xs">{{ $st->name }}</span> <span class="font-bold text-slate-900 text-[13px] block">{{ $st->name }}</span>
</td> </td>
<td class="py-3 px-4"> <td class="py-4 px-5">
<div class="flex flex-wrap items-center gap-1 max-w-xs"> <div class="flex flex-wrap items-center gap-1.5 min-w-[240px]">
@if($st->coversScope('all')) @if($st->coversScope('all'))
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold bg-purple-50 text-purple-700 border border-purple-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-md text-[11px] font-bold bg-purple-50 text-purple-700 border border-purple-200">
<i class="fa-solid fa-shapes mr-1"></i> Semua Kategori (Universal) Semua Kategori (Universal)
</span> </span>
@else @else
@php $scopesList = $st->scopes; @endphp @php $scopesList = $st->scopes; @endphp
@foreach(array_slice($scopesList, 0, 3) as $scope) @foreach(array_slice($scopesList, 0, 3) as $scope)
@if($scope === 'light_vehicle') @if($scope === 'light_vehicle')
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold bg-blue-50 text-blue-700 border border-blue-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-md text-[11px] font-bold bg-blue-50 text-blue-700 border border-blue-200">
<i class="fa-solid fa-car-side mr-1"></i> LV LV (Light Vehicle)
</span> </span>
@else @else
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold bg-amber-50 text-amber-700 border border-amber-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-md text-[11px] font-bold bg-amber-50 text-amber-800 border border-amber-200">
<i class="fa-solid fa-truck-moving mr-1"></i> {{ str_replace('_', ' ', $scope) }} {{ str_replace('_', ' ', $scope) }}
</span> </span>
@endif @endif
@endforeach @endforeach
@if(count($scopesList) > 3) @if(count($scopesList) > 3)
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-bold bg-slate-100 text-slate-600 border border-slate-200" <span class="inline-flex items-center px-2 py-1 rounded-md text-[11px] font-bold bg-slate-100 text-slate-600 border border-slate-200"
title="{{ implode(', ', array_slice($scopesList, 3)) }}"> title="{{ implode(', ', array_slice($scopesList, 3)) }}">
+{{ count($scopesList) - 3 }} lainnya +{{ count($scopesList) - 3 }} lainnya
</span> </span>
@@ -173,38 +155,40 @@
@endif @endif
</div> </div>
</td> </td>
<td class="py-3 px-4 text-center font-bold"> <td class="py-4 px-5 text-center font-bold whitespace-nowrap">
<span class="font-mono text-slate-800 bg-slate-100 px-2 py-0.5 rounded"> <span class="inline-block font-mono text-xs text-slate-800 bg-slate-100 px-2.5 py-1 rounded-md border border-slate-200">
{{ $st->active_holders_count }} Personil {{ $st->active_holders_count }} Personil
</span> </span>
</td> </td>
<td class="py-3 px-4 text-center"> <td class="py-4 px-5 text-center whitespace-nowrap">
@if($st->is_active) @if($st->is_active)
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200">
Aktif Aktif
</span> </span>
@else @else
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-bold bg-slate-100 text-slate-500 border border-slate-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-full text-[11px] font-bold bg-slate-100 text-slate-500 border border-slate-200">
Nonaktif Nonaktif
</span> </span>
@endif @endif
</td> </td>
<td class="py-3 px-4 text-slate-500 text-[11px] line-clamp-2"> <td class="py-4 px-5 min-w-[240px]">
<p class="text-xs text-slate-500 leading-relaxed line-clamp-2">
{{ $st->description ?: '-' }} {{ $st->description ?: '-' }}
</p>
</td> </td>
<td class="py-3 px-4 text-center whitespace-nowrap"> <td class="py-4 px-5 text-center whitespace-nowrap">
<div class="flex items-center justify-center space-x-1"> <div class="flex items-center justify-center gap-1.5">
@can('hse.employees.edit') @can('hse.employees.edit')
<button type="button" <button type="button"
onclick="openEditSimperTypeModal({{ json_encode($st) }})" onclick="openEditSimperTypeModal({{ json_encode($st) }})"
class="p-1.5 rounded-lg text-amber-600 hover:text-amber-800 hover:bg-amber-50 transition cursor-pointer" class="inline-flex items-center justify-center w-8 h-8 rounded-lg text-amber-700 bg-amber-50 hover:bg-amber-100 transition border border-amber-200 cursor-pointer"
title="Edit Jenis SIMPER"> title="Edit Jenis SIMPER">
<i class="fa-regular fa-pen-to-square text-xs"></i> <i class="fa-regular fa-pen-to-square text-xs"></i>
</button> </button>
@if($st->total_holders_count == 0) @if($st->total_holders_count == 0)
<button type="button" <button type="button"
onclick="openDeleteSimperTypeModal({{ $st->id }}, '{{ $st->name }}')" onclick="openDeleteSimperTypeModal({{ $st->id }}, '{{ $st->name }}')"
class="p-1.5 rounded-lg text-rose-600 hover:text-rose-800 hover:bg-rose-50 transition cursor-pointer" class="inline-flex items-center justify-center w-8 h-8 rounded-lg text-rose-700 bg-rose-50 hover:bg-rose-100 transition border border-rose-200 cursor-pointer"
title="Hapus Jenis SIMPER"> title="Hapus Jenis SIMPER">
<i class="fa-regular fa-trash-can text-xs"></i> <i class="fa-regular fa-trash-can text-xs"></i>
</button> </button>
@@ -215,9 +199,8 @@
</tr> </tr>
@empty @empty
<tr> <tr>
<td colspan="8" class="py-12 text-center text-slate-400"> <td colspan="8" class="py-16 text-center text-slate-400">
<i class="fa-solid fa-id-card text-3xl mb-2 block text-slate-300"></i> <p class="text-sm font-bold text-slate-700">Belum ada data jenis SIMPER</p>
<p class="text-sm font-semibold text-slate-700">Belum ada data jenis SIMPER</p>
<p class="text-xs text-slate-400 mt-1">Klik tombol "+ Tambah Jenis SIMPER" untuk membuat kategori baru.</p> <p class="text-xs text-slate-400 mt-1">Klik tombol "+ Tambah Jenis SIMPER" untuk membuat kategori baru.</p>
</td> </td>
</tr> </tr>