e8dc97a32f
Deploy momo-erp / deploy (push) Successful in 46s
- src/app/(main), admin, admin-panel, common, api/{admin,common,menu} 복원
- /api/auth/login: FITO 인증 다시 활성화 (plm_admin 등 FITO 사용자 로그인 가능)
- 미들웨어: 옛 경로 강제 리다이렉트 제거
- /m/layout.tsx: FITO 슈퍼관리자(isAdmin)도 ADMIN 으로 받아 모모 페이지 진입 허용
- DB 005: menu_info 에 모모유통 루트(9000000) + 자식 19개(/m/* URL 직접 연결)
→ plm_admin 로그인 후 사이드바 [모모유통] 그룹에서 클릭 시 동작
→ 메뉴 관리 UI 에서 추가/수정/삭제 가능
2.0 KiB
2.0 KiB
역할
인증된 사용자 전용 업무 페이지 영역. 영업, 생산, 구매, 재고, 품질, 비용 등 70개 이상의 업무 페이지를 포함. 공통 레이아웃(Header + Sidebar + Content)으로 감싸진 대시보드 시스템.
공통 패턴
페이지 구조
모든 페이지는 "use client" 클라이언트 컴포넌트. 구성:
- 제목:
<h2 className="text-lg font-bold text-gray-800 mb-4">{제목}</h2> - 검색 폼:
SearchForm+SearchField+CodeSelect/Input - 버튼 영역: 조회, 등록, 삭제 등
- 데이터 그리드:
DataGrid+Pagination
데이터 조회
const fetchData = useCallback(async () => {
const res = await fetch("/api/{domain}/{resource}", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ year, category_cd, ... }),
});
if (res.ok) {
const json = await res.json();
setData(json.RESULTLIST || []);
}
}, [dependencies]);
팝업 처리
window.open(url, "formPopup", "width=1200,height=550,left=...,top=...");
행 삭제
if (selectedRows.length === 0) {
Swal.fire({ icon: "warning", title: "항목을 선택하세요." });
return;
}
연결 고리
- API:
POST /api/{domain}/{resource}(RESULTLIST 응답) - Store:
useAuthStore()(user, logout),useMenuStore()(메뉴 상태) - 컴포넌트: DataGrid, SearchForm, SearchField, CodeSelect, Input, Button, Pagination
- 유틸:
numberWithCommas(),cn()
숨겨진 스펙
- 데이터 타입:
Record<string, unknown>[] - DataGrid 높이:
calc(100vh - 350px)패턴 (페이지별 350~400px 차감) - 년도 필터:
Array.from({ length: 5 }, (_, i) => new Date().getFullYear() - i) - 셀 클릭:
col.cellClick콜백으로 상세 폼 팝업 - formatter
"money"→ 통화 형식 - JSP 원본 주석:
// salesMgmt/salesMgmtContractList.jsp 대응 - 에러처리 미비:
if (res.ok)체크만, try-catch 없는 경우 많음
@MISTAKES.md