From d1911265f4fb06fef6250e42e8717d8ccff83c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 28 Feb 2026 15:08:42 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[approvals]=20=EA=B2=B0=EC=9E=AC=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EB=B1=83=EC=A7=80=20=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 사이드바: 결재 대기/기안함/참조함 메뉴에 빨간 뱃지 표시 - 헤더: 알림 벨 클릭 시 결재 대기 목록 드롭다운 표시 - 드롭다운: 제목/기안자/양식/긴급 여부/일시 표시, 클릭 시 상세 이동 - 뱃지 건수 60초 자동 갱신 (API: /api/admin/approvals/badge-counts) --- app/Providers/AppServiceProvider.php | 24 ++++ resources/views/partials/header.blade.php | 152 ++++++++++++++++++++-- 2 files changed, 164 insertions(+), 12 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b9d84580..5cc53b14 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -7,6 +7,7 @@ use App\Models\Tenants\Department; use App\Models\User; use App\Observers\FileObserver; +use App\Services\ApprovalService; use App\Services\SidebarMenuService; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Facades\Cache; @@ -56,10 +57,33 @@ public function boot(): void $menuService = app(SidebarMenuService::class); $menusBySection = $menuService->getMenusBySection(); + // 결재 뱃지 건수 + $menuBadges = ['byRoute' => [], 'byUrl' => []]; + if (auth()->check()) { + try { + $counts = app(ApprovalService::class)->getBadgeCounts(auth()->id()); + $menuBadges = [ + 'byRoute' => [ + 'approvals.pending' => $counts['pending'], + 'approvals.drafts' => $counts['draft'], + 'approvals.references' => $counts['reference_unread'], + ], + 'byUrl' => [ + '/approval-mgmt/pending' => $counts['pending'], + '/approval-mgmt/drafts' => $counts['draft'], + '/approval-mgmt/references' => $counts['reference_unread'], + ], + ]; + } catch (\Throwable $e) { + // 테이블 미존재 등 예외 무시 + } + } + $view->with([ 'mainMenus' => $menusBySection['main'], 'toolsMenus' => $menusBySection['tools'], 'labsMenus' => $menusBySection['labs'], + 'menuBadges' => $menuBadges, ]); }); } diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index 76179166..e98af713 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -95,12 +95,31 @@ class="flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg bo - - + +
+ + + {{-- 드롭다운 --}} + +
@@ -149,15 +168,124 @@ class="flex items-center gap-1 lg:gap-2 p-1.5 lg:px-3 lg:py-2 text-sm font-mediu @push('scripts')