Files
sam-manage/resources/views/role-permissions/partials/permission-matrix.blade.php
hskwon 2a9b697baf UI 개선: 테넌트 선택 헤더 이동 및 역할 권한 관리 개선
- 테넌트 선택을 각 페이지에서 헤더로 통합 이동
- 페이지 제목 이모지 제거 및 상단 여백(mt-6) 축소
- 역할 권한 관리 페이지 레이아웃을 다른 페이지와 통일
- 메뉴명 스타일 개선 (depth 들여쓰기, └ 기호 적용)
- 상위 메뉴 컬럼 제거로 테이블 간소화
- RolePermissionService에 depth 계산 로직 추가
- pagination.js를 body 끝으로 이동하여 로딩 오류 해결
- 역할 선택 UI를 셀렉트박스에서 버튼 형태로 변경
- 역할 버튼 hover 효과 개선 (선택된 버튼 가독성 향상)

변경된 파일:
- resources/views/partials/header.blade.php: 테넌트 선택 UI 추가
- resources/views/dashboard|menus|users|departments|permissions|roles/index.blade.php: tenant-selector 제거, 여백 축소
- resources/views/layouts/app.blade.php: pagination.js 위치 변경
- app/Services/RolePermissionService.php: depth 계산 로직 추가
- resources/views/role-permissions/: 역할 권한 관리 페이지 개선
- routes/web.php, routes/api.php: 역할 권한 관리 라우트 추가
2025-11-25 15:21:48 +09:00

67 lines
4.0 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-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 60px;">순번</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">URL</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">순서</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">조회</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">생성</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">수정</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">삭제</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">승인</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 80px;">내보내기</th>
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">관리</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@php
$permissionTypes = ['view', 'create', 'update', 'delete', 'approve', 'export', 'manage'];
@endphp
@forelse($menus as $index => $menu)
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 text-center">
{{ $index + 1 }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center text-sm text-gray-900" style="padding-left: {{ ($menu->depth ?? 0) * 20 }}px;">
@if(($menu->depth ?? 0) > 0)
<span class="mr-2 text-gray-400"></span>
@endif
<span>{{ $menu->name }}</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="truncate max-w-xs inline-block" title="{{ $menu->url }}">
{{ $menu->url }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 text-center">
{{ $menu->sort_order }}
</td>
@foreach($permissionTypes as $type)
<td class="px-6 py-4 whitespace-nowrap text-center">
<input
type="checkbox"
{{ isset($permissions[$menu->id][$type]) && $permissions[$menu->id][$type] ? 'checked' : '' }}
class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"
hx-post="/api/admin/role-permissions/toggle"
hx-target="#permission-matrix"
hx-include="[name='role_id']"
hx-vals='{"menu_id": {{ $menu->id }}, "permission_type": "{{ $type }}"}'
>
</td>
@endforeach
</tr>
@empty
<tr>
<td colspan="11" class="px-6 py-12 text-center text-gray-500">
활성화된 메뉴가 없습니다.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>