From 05d096b08f58d699817e3ff57272c65e40e51316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 12 Mar 2026 11:17:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[juil]=20=EA=B1=B4=EC=84=A4PMIS=20?= =?UTF-8?q?=EC=A2=8C=EC=B8=A1=20=EC=82=AC=EC=9D=B4=EB=93=9C=EB=B0=94=20?= =?UTF-8?q?=EB=B0=8F=20=EA=B0=9C=EC=9D=B8=EC=A0=95=EB=B3=B4=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EB=AA=A8=EB=8B=AC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PMIS 전용 좌측 사이드바 (사용자 프로필 + 네비게이션 메뉴) - 개인정보 관리 모달 (보기/수정 모드 전환) - 연락처, 이메일, 성별 편집 및 서버 저장 기능 - 프로필 조회/수정 JSON API 엔드포인트 추가 - 3컬럼 레이아웃 (좌측 사이드바 + 대시보드 + 우측 퀵메뉴) --- .../Controllers/Juil/PlanningController.php | 48 +++ .../views/juil/construction-pmis.blade.php | 354 +++++++++++++++--- routes/web.php | 2 + 3 files changed, 362 insertions(+), 42 deletions(-) diff --git a/app/Http/Controllers/Juil/PlanningController.php b/app/Http/Controllers/Juil/PlanningController.php index cba356ba..980ef2df 100644 --- a/app/Http/Controllers/Juil/PlanningController.php +++ b/app/Http/Controllers/Juil/PlanningController.php @@ -53,4 +53,52 @@ public function pmisWeather(WeatherService $weatherService): JsonResponse return response()->json(['forecasts' => array_slice($forecasts, 0, 2)]); } + + public function pmisProfile(): JsonResponse + { + $user = auth()->user(); + $tenantId = session('current_tenant_id', 1); + + $departments = $user->getDepartmentsForTenant($tenantId); + $roles = $user->getRolesForTenant($tenantId); + + return response()->json([ + 'user' => [ + 'name' => $user->name, + 'user_id' => $user->user_id, + 'email' => $user->email, + 'phone' => $user->phone, + 'role' => $user->role, + 'profile_photo_path' => $user->profile_photo_path, + 'department' => $departments->first()?->name ?? '-', + 'position' => $user->getOption('position') ?? '-', + 'gender' => data_get($user->options, 'gender', ''), + 'role_names' => $roles->pluck('name')->join(', ') ?: '-', + 'created_at' => $user->created_at?->format('Y-m-d'), + 'last_login_at' => $user->last_login_at?->format('Y-m-d H:i'), + ], + ]); + } + + public function pmisProfileUpdate(Request $request): JsonResponse + { + $request->validate([ + 'phone' => ['nullable', 'string', 'max:20'], + 'email' => ['nullable', 'email', 'max:255'], + 'gender' => ['nullable', 'string', 'in:남,여'], + ]); + + $user = auth()->user(); + $user->phone = $request->input('phone'); + $user->email = $request->input('email'); + + $options = $user->options ?? []; + $options['gender'] = $request->input('gender'); + $user->options = $options; + + $user->updated_by = $user->id; + $user->save(); + + return response()->json(['success' => true, 'message' => '개인정보가 저장되었습니다.']); + } } diff --git a/resources/views/juil/construction-pmis.blade.php b/resources/views/juil/construction-pmis.blade.php index ae3d5057..bb4dc11d 100644 --- a/resources/views/juil/construction-pmis.blade.php +++ b/resources/views/juil/construction-pmis.blade.php @@ -11,7 +11,282 @@ @include('partials.react-cdn')