[feat] negodata/front: 견적 재생성·차수 체인 UI + 담당자/메모 + 스크롤·목업 정비
- 견적 재생성(다음 견적) 엔드포인트 연동 모달: 연결 공급사+협상단계 표시, 마지막 차수에서만 - 차수 체인 타임라인/견적번호 클릭 필터, 생성 응답 슬림(qt_id/session_count) 반영 - 상세 시트 스크롤 수정(min-h-0)·배경 스크롤 락(useScrollLock)·헤더2:탭1 비율 - 담당자=로그인 유저(store) 자동 전송 + 생성 모달 메모 입력 추가 - 목업/가짜 폴백 제거(담당자·견적명·번호·메모 → '-'), 시드 회사 placeholder UUID→실 UUID - 견적상태 CREATED 칩 pulse 제거 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f948075e5
commit
9f947e4823
23 files changed
+565
-86
No files matched your search
@@ -9,6 +9,7 @@ import { useLocation, useNavigate, useSearchParams } from 'react-router';
|
||||
// overlay.has('new') // ?new 존재 여부 — 플래그 오버레이
|
||||
// overlay.open('detail', id) // ?detail=<id> (다른 오버레이 키는 지움) — 히스토리 push
|
||||
// overlay.open('new') // ?new (값 생략 시 '1')
|
||||
// overlay.open('detail', id, { replace: true }) // 같은 오버레이 내 값만 교체(히스토리 안 쌓음)
|
||||
// overlay.close() // 그룹 내 모든 오버레이 키 제거
|
||||
const OVERLAY_PUSHED = '__overlayPushed';
|
||||
|
||||
@@ -29,11 +30,22 @@ export function useOverlayRouter<K extends string>(keys: readonly K[]) {
|
||||
return s ? `?${s}` : '';
|
||||
};
|
||||
|
||||
const open = (key: K, value = '1') =>
|
||||
const open = (key: K, value = '1', opts?: { replace?: boolean }) => {
|
||||
const replace = opts?.replace ?? false;
|
||||
navigate(
|
||||
{ pathname: location.pathname, search: buildSearch((p) => p.set(key, value)) },
|
||||
{ state: { ...(location.state ?? {}), [OVERLAY_PUSHED]: true } },
|
||||
{
|
||||
replace,
|
||||
// push: 새 히스토리 → 닫을 때 navigate(-1)로 빠지게 표식.
|
||||
// replace(같은 오버레이 안에서 값만 교체, 예: 차수 전환): 히스토리를 안 쌓고,
|
||||
// 원래 열림이 push였는지 표식을 그대로 물려준다(닫기 동작이 일관되게 리스트로 빠지도록).
|
||||
state: {
|
||||
...(location.state ?? {}),
|
||||
[OVERLAY_PUSHED]: replace ? location.state?.[OVERLAY_PUSHED] ?? false : true,
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
if (location.state?.[OVERLAY_PUSHED]) {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
// 오버레이(시트/모달)가 열려 있는 동안 뒤 페이지 스크롤을 잠근다.
|
||||
// 이 앱 레이아웃 루트는 min-h-screen(높이 제약 없음)이라 <main> 이 아니라 문서(html/body)가 스크롤된다.
|
||||
// 그래서 실제 스크롤 주체인 document.scrollingElement(보통 <html>)를 잠근다.
|
||||
// 중첩 오버레이 대비 카운터로 관리 — 마지막 하나가 닫힐 때만 원복.
|
||||
let lockCount = 0;
|
||||
let prevOverflow = '';
|
||||
|
||||
function scroller(): HTMLElement {
|
||||
return (document.scrollingElement as HTMLElement | null) ?? document.documentElement;
|
||||
}
|
||||
|
||||
export function useScrollLock(active = true) {
|
||||
useEffect(() => {
|
||||
if (!active) return;
|
||||
if (lockCount === 0) {
|
||||
const el = scroller();
|
||||
prevOverflow = el.style.overflow;
|
||||
el.style.overflow = 'hidden';
|
||||
}
|
||||
lockCount += 1;
|
||||
return () => {
|
||||
lockCount -= 1;
|
||||
if (lockCount === 0) {
|
||||
scroller().style.overflow = prevOverflow;
|
||||
}
|
||||
};
|
||||
}, [active]);
|
||||
}
|
||||
Reference in new issue
Block a user