fix:테넌트 리스트 UI 개선 및 삭제 권한 제한
- 영업/매니저 프로그레스바를 2행에서 1행으로 변경 (각 50% 너비) - 삭제 버튼을 본사(HQ) 사용자만 표시하도록 제한 - belongsToHQ() 메서드 활용하여 권한 체크 - @click → x-on:click 변경 (Blade 충돌 방지) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -117,25 +117,23 @@
|
||||
@include('sales.dashboard.partials.manager-dropdown', ['tenant' => $tenant])
|
||||
</div>
|
||||
|
||||
<!-- 영업/매니저 진행률 -->
|
||||
<div class="col-span-2" id="progress-{{ $tenant->id }}">
|
||||
<div class="space-y-1">
|
||||
{{-- 영업 --}}
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs font-medium text-blue-600 w-8">영업</span>
|
||||
<div class="flex-1 bg-gray-200 rounded-full h-1.5">
|
||||
<div class="bg-blue-500 h-1.5 rounded-full transition-all" id="sales-bar-{{ $tenant->id }}" style="width: {{ $progress['sales']['percentage'] }}%"></div>
|
||||
</div>
|
||||
<span class="text-xs text-gray-500 w-8 text-right" id="sales-pct-{{ $tenant->id }}">{{ $progress['sales']['percentage'] }}%</span>
|
||||
<!-- 영업/매니저 진행률 (1행 표시) -->
|
||||
<div class="col-span-2 flex items-center gap-3" id="progress-{{ $tenant->id }}">
|
||||
{{-- 영업 --}}
|
||||
<div class="flex-1 flex items-center gap-1" title="영업 {{ $progress['sales']['percentage'] }}%">
|
||||
<span class="text-xs font-medium text-blue-600 w-6 flex-shrink-0">영업</span>
|
||||
<div class="flex-1 bg-gray-200 rounded-full h-1.5 min-w-0">
|
||||
<div class="bg-blue-500 h-1.5 rounded-full transition-all" id="sales-bar-{{ $tenant->id }}" style="width: {{ $progress['sales']['percentage'] }}%"></div>
|
||||
</div>
|
||||
{{-- 매니저 --}}
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs font-medium text-green-600 w-8">매니저</span>
|
||||
<div class="flex-1 bg-gray-200 rounded-full h-1.5">
|
||||
<div class="bg-green-500 h-1.5 rounded-full transition-all" id="manager-bar-{{ $tenant->id }}" style="width: {{ $progress['manager']['percentage'] }}%"></div>
|
||||
</div>
|
||||
<span class="text-xs text-gray-500 w-8 text-right" id="manager-pct-{{ $tenant->id }}">{{ $progress['manager']['percentage'] }}%</span>
|
||||
<span class="text-xs text-gray-500 w-7 text-right flex-shrink-0" id="sales-pct-{{ $tenant->id }}">{{ $progress['sales']['percentage'] }}%</span>
|
||||
</div>
|
||||
{{-- 매니저 --}}
|
||||
<div class="flex-1 flex items-center gap-1" title="매니저 {{ $progress['manager']['percentage'] }}%">
|
||||
<span class="text-xs font-medium text-green-600 w-6 flex-shrink-0">매니</span>
|
||||
<div class="flex-1 bg-gray-200 rounded-full h-1.5 min-w-0">
|
||||
<div class="bg-green-500 h-1.5 rounded-full transition-all" id="manager-bar-{{ $tenant->id }}" style="width: {{ $progress['manager']['percentage'] }}%"></div>
|
||||
</div>
|
||||
<span class="text-xs text-gray-500 w-7 text-right flex-shrink-0" id="manager-pct-{{ $tenant->id }}">{{ $progress['manager']['percentage'] }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -215,7 +213,7 @@ class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-g
|
||||
매니저
|
||||
</button>
|
||||
|
||||
{{-- 설정/수정/삭제 아이콘 --}}
|
||||
{{-- 설정/삭제 아이콘 --}}
|
||||
<div class="flex items-center">
|
||||
<a href="{{ route('tenants.edit', $tenant->id) }}"
|
||||
class="p-1 text-gray-400 hover:text-blue-600 transition-colors" title="상세설정">
|
||||
@@ -224,13 +222,16 @@ class="p-1 text-gray-400 hover:text-blue-600 transition-colors" title="상세설
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
</a>
|
||||
<button type="button"
|
||||
@click="confirmDeleteTenant({{ $tenant->id }}, '{{ $tenant->company_name }}')"
|
||||
class="p-1 text-gray-400 hover:text-red-600 transition-colors" title="삭제">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
</button>
|
||||
{{-- 삭제 버튼: 본사(HQ)만 표시 --}}
|
||||
@if(auth()->user()?->belongsToHQ())
|
||||
<button type="button"
|
||||
x-on:click="confirmDeleteTenant({{ $tenant->id }}, '{{ $tenant->company_name }}')"
|
||||
class="p-1 text-gray-400 hover:text-red-600 transition-colors" title="삭제">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user