Files
sam-manage/resources/views/tenants/partials/table.blade.php
hskwon 7546771ee5 feat(mng): 개인 권한 관리 통합 매트릭스 구현
- 역할/부서/개인 권한을 통합하여 최종 유효 권한 표시
- 권한 소스별 색상 구분 UI (보라=역할, 파랑=부서, 녹색=개인허용, 빨강=개인거부)
- 스마트 토글 로직 (상속된 권한 오버라이드 지원)
- UserPermissionService: getRolePermissions(), getDepartmentPermissions(), getPersonalOverrides()
- 사용자 ID 뱃지 스타일 개선
2025-11-26 20:40:54 +09:00

105 lines
5.8 KiB
PHP

<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">ID</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">회사명</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">코드</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">상태</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">이메일</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">전화번호</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider">사용자</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider">부서</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider">메뉴</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider">역할</th>
<th class="px-3 py-2 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">생성일</th>
<th class="px-6 py-3 text-right text-sm font-semibold text-gray-700 uppercase tracking-wider">액션</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@forelse($tenants as $tenant)
<tr class="{{ $tenant->deleted_at ? 'bg-gray-100' : '' }}">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
{{ $tenant->id }}
</td>
<td class="px-3 py-2 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">{{ $tenant->company_name }}</div>
@if($tenant->ceo_name)
<div class="text-sm text-gray-500">대표: {{ $tenant->ceo_name }}</div>
@endif
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900">
{{ $tenant->code }}
</td>
<td class="px-3 py-2 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full
{{ $tenant->status_badge_color === 'success' ? 'bg-green-100 text-green-800' : '' }}
{{ $tenant->status_badge_color === 'warning' ? 'bg-yellow-100 text-yellow-800' : '' }}
{{ $tenant->status_badge_color === 'error' ? 'bg-red-100 text-red-800' : '' }}">
{{ $tenant->status_label }}
</span>
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $tenant->email ?? '-' }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $tenant->phone ?? '-' }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-center text-gray-900">
{{ $tenant->users_count ?? 0 }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-center text-gray-900">
{{ $tenant->departments_count ?? 0 }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-center text-gray-900">
{{ $tenant->menus_count ?? 0 }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-center text-gray-900">
{{ $tenant->roles_count ?? 0 }}
</td>
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $tenant->created_at?->format('Y-m-d') ?? '-' }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
@if($tenant->deleted_at)
<!-- 삭제된 항목 -->
<button onclick="confirmRestore({{ $tenant->id }}, '{{ $tenant->company_name }}')"
class="text-green-600 hover:text-green-900 mr-3">
복원
</button>
@if(auth()->user()?->is_super_admin)
<button onclick="confirmForceDelete({{ $tenant->id }}, '{{ $tenant->company_name }}')"
class="text-red-600 hover:text-red-900">
영구삭제
</button>
@endif
@else
<!-- 활성 항목 -->
<a href="{{ route('tenants.edit', $tenant->id) }}"
class="text-blue-600 hover:text-blue-900 mr-3">
수정
</a>
<button onclick="confirmDelete({{ $tenant->id }}, '{{ $tenant->company_name }}')"
class="text-red-600 hover:text-red-900">
삭제
</button>
@endif
</td>
</tr>
@empty
<tr>
<td colspan="12" class="px-6 py-12 text-center text-gray-500">
등록된 테넌트가 없습니다.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!-- 페이지네이션 -->
@include('partials.pagination', [
'paginator' => $tenants,
'target' => '#tenant-table',
'includeForm' => '#filterForm'
])