feat(WEB): 출퇴근 설정 페이지 부서 트리 구조 연동

- MultiSelectCombobox에 depth 옵션 추가 (계층 들여쓰기)
- AttendanceSettings actions.ts: serverFetch 패턴 적용 및 트리 API 사용
- getDepartments(): /departments/tree API 호출 후 평탄화
- 부서 선택 시 계층 구조(depth)에 따른 들여쓰기 표시
This commit is contained in:
2025-12-30 21:31:30 +09:00
parent 258c8e4179
commit 5011bac596
3 changed files with 112 additions and 34 deletions

View File

@@ -17,6 +17,7 @@ import { cn } from './utils';
export interface MultiSelectOption {
value: string;
label: string;
depth?: number; // 트리 구조 들여쓰기용
}
interface MultiSelectComboboxProps {
@@ -107,14 +108,15 @@ export function MultiSelectCombobox({
value={option.label}
onSelect={() => handleSelect(option.value)}
className="cursor-pointer"
style={{ paddingLeft: option.depth ? `${(option.depth * 16) + 8}px` : undefined }}
>
<Check
className={cn(
'mr-2 h-4 w-4',
'mr-2 h-4 w-4 shrink-0',
value.includes(option.value) ? 'opacity-100' : 'opacity-0'
)}
/>
{option.label}
<span className="truncate">{option.label}</span>
</CommandItem>
))}
</CommandGroup>