feat:영업관리 대시보드 HTMX 부분 새로고침 구현
- 기간별 조회 및 실적 새로고침 시 전체 페이지가 아닌 데이터 영역만 갱신 - partial 뷰 분리 (stats, commission-by-role, tenant-stats, no-data) - 컨트롤러에 refresh 메서드 추가 - 로딩 인디케이터 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,26 @@ class SalesDashboardController extends Controller
|
||||
* 대시보드 화면
|
||||
*/
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$data = $this->getDashboardData($request);
|
||||
|
||||
return view('sales.dashboard.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* HTMX 부분 새로고침용 데이터 반환
|
||||
*/
|
||||
public function refresh(Request $request): View
|
||||
{
|
||||
$data = $this->getDashboardData($request);
|
||||
|
||||
return view('sales.dashboard.partials.data-container', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 대시보드 데이터 조회
|
||||
*/
|
||||
private function getDashboardData(Request $request): array
|
||||
{
|
||||
// 기간 설정
|
||||
$period = $request->input('period', 'month'); // month or custom
|
||||
@@ -73,7 +93,7 @@ public function index(Request $request): View
|
||||
'confirmed_commission' => 0, // 확정 가입비 수당
|
||||
];
|
||||
|
||||
return view('sales.dashboard.index', compact(
|
||||
return compact(
|
||||
'stats',
|
||||
'commissionByRole',
|
||||
'totalCommissionRatio',
|
||||
@@ -83,6 +103,6 @@ public function index(Request $request): View
|
||||
'month',
|
||||
'startDate',
|
||||
'endDate'
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user