feature: user list

This commit is contained in:
antv
2026-07-08 15:29:13 +07:00
parent 7d9ba527a3
commit e476c2768a
32 changed files with 1091 additions and 284 deletions
@@ -11,19 +11,24 @@
<table class="min-w-full divide-y divide-gray-100 text-sm">
<thead class="bg-gray-50/50">
<tr>
<th class="table-header-cell">Thao tác</th>
<th class="table-header-cell">MSNV</th>
<th class="table-header-cell">Nhân viên</th>
<th class="table-header-cell">Phòng ban</th>
<th class="table-header-cell">Đã Nhận</th>
<th class="table-header-cell">Đã Gửi</th>
<th class="table-header-cell">Số thẻ</th>
<th class="table-header-cell">Quyền gửi</th>
<th class="table-header-cell">Vai trò</th>
<th class="table-header-cell">Trạng thái</th>
<th class="table-header-cell text-right">Thao tác</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-100">
@forelse($users as $u)
<tr class="hover:bg-slate-50/60 transition-colors">
<td class="table-body-cell font-medium space-x-3">
<a href="{{ route('admin.users.edit', $u->msnv) }}" class="table-action-link !text-[#3462f7] hover:!text-blue-800">Chỉnh sửa</a>
</td>
<td class="table-body-cell font-bold text-text-dark">{{ $u->msnv }}</td>
<td class="table-body-cell">
<div class="flex flex-col">
@@ -31,6 +36,20 @@
<span class="text-xs text-gray-400 mt-0.5">{{ $u->mail }}</span>
</div>
</td>
<td class="table-body-cell">
@php
$deptVal = $u->departments;
if (is_numeric($deptVal)) {
$idx = ((int)$deptVal) - 1;
$deptName = config('constants.DEPARTMENTS')[$idx] ?? 'Team';
} else {
$deptName = $deptVal ?? 'Team';
}
@endphp
<div class="max-w-[200px] truncate font-medium text-gray-600" title="{{ $deptName }}">
{{ $deptName }}
</div>
</td>
<td class="table-body-cell font-extrabold text-green-600">+{{ $u->total_received }}</td>
<td class="table-body-cell font-extrabold text-blue-600">{{ $u->total_sent }}</td>
<td class="table-body-cell font-extrabold text-orange-500">{{ $u->card }}</td>
@@ -42,19 +61,23 @@
@endif
</td>
<td class="table-body-cell">
@if($u->status == \App\Models\User::STATUS_ACTIVE)
@if($u->role == config('constants.ROLE_ADMIN'))
<span class="px-2.5 py-1 inline-flex text-[10px] leading-5 font-bold rounded-full bg-blue-50 text-blue-700 border border-blue-100">Admin</span>
@else
<span class="px-2.5 py-1 inline-flex text-[10px] leading-5 font-bold text-gray-500">Member</span>
@endif
</td>
<td class="table-body-cell">
@if($u->status == config('constants.STATUS_ACTIVE'))
<span class="px-2.5 py-1 inline-flex text-[10px] leading-5 font-bold rounded-full bg-blue-50 text-blue-700 border border-blue-100">Đang làm việc</span>
@else
<span class="px-2.5 py-1 inline-flex text-[10px] leading-5 font-bold rounded-full bg-red-50 text-red-700 border border-red-100">Đã nghỉ việc</span>
@endif
</td>
<td class="table-body-cell text-right font-medium space-x-3">
<a href="{{ route('admin.users.edit', $u->msnv) }}" class="table-action-link !text-[#3462f7] hover:!text-blue-800">Quản </a>
</td>
</tr>
@empty
<tr>
<td colspan="8" class="px-6 py-10 text-center text-text-light font-medium">Chưa user nào đang hoạt động.</td>
<td colspan="10" class="px-6 py-10 text-center text-text-light font-medium">Chưa user nào đang hoạt động.</td>
</tr>
@endforelse
</tbody>