[feat] negodata: 견적 목표가 산정 개편 + 협상 초청메일 + 카드 사용구분
[견적·목표가] - 목표가 산정 KTC 기준 정비(MD 우선, 없으면 인터넷최저가·매입가·판매가 중 최저 / 신규는 인터넷최저가만) - 인터넷 평균 수수료 0.078 상수화(견적설정 컬럼 제거) - 앵커링가 세션 저장 + 목표가 클릭 시 산정내역 모달 - 재생성 시 목표가·앵커링가 재계산 없이 직전 값 상속(KTC) - MD 제시가·협력사 유형(유통·제조·총판·기타) 입력 [협상카드] - 사용 구분(공통/신규견적전용/재견적전용) [협상 진행] - 협력사 초청 메일 발송(일괄/개별·재발송, 발송상태 표시) [기타] - 견적상세 창 닫기 버그 수정, 불필요한 컬럼 주석 정리 - DB: 기존 DB는 postgres-init/04-alter.sql 적용 필요(자동 마이그레이션 없음) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b42d084063
commit
019f3dbeac
51 files changed
+1263
-163
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { useState, type ReactNode, type ElementType } from 'react';
|
||||
import { PageType } from '@/types';
|
||||
import { useAuth } from '@/features/auth/useAuth';
|
||||
import { ProfileSheet } from '@/features/auth/components/ProfileSheet';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Typography } from '@/components/ui/typography';
|
||||
@@ -8,6 +9,8 @@ import { cn } from '@/lib/utils';
|
||||
import {
|
||||
Briefcase,
|
||||
Users,
|
||||
UserCog,
|
||||
UserPen,
|
||||
FileSpreadsheet,
|
||||
Layers,
|
||||
LogOut,
|
||||
@@ -28,11 +31,13 @@ interface LayoutProps {
|
||||
|
||||
type SidebarUser = ReturnType<typeof useAuth>['user'];
|
||||
|
||||
const menuItems = [
|
||||
{ type: 'PRODUCTS' as PageType, label: '상품관리', icon: Briefcase, id: 'sidebar-products' },
|
||||
{ type: 'PARTNERS' as PageType, label: '협력사관리', icon: Users, id: 'sidebar-partners' },
|
||||
{ type: 'QUOTATION' as PageType, label: '견적관리', icon: FileSpreadsheet, id: 'sidebar-quotation' },
|
||||
{ type: 'CARDS' as PageType, label: '협상카드관리', icon: Layers, id: 'sidebar-cards' },
|
||||
// ownerOnly 항목은 최고관리자에게만 노출된다(렌더 시 user.role 로 필터).
|
||||
const menuItems: { type: PageType; label: string; icon: ElementType; id: string; ownerOnly?: boolean }[] = [
|
||||
{ type: 'PRODUCTS', label: '상품관리', icon: Briefcase, id: 'sidebar-products' },
|
||||
{ type: 'PARTNERS', label: '협력사관리', icon: Users, id: 'sidebar-partners' },
|
||||
{ type: 'QUOTATION', label: '견적관리', icon: FileSpreadsheet, id: 'sidebar-quotation' },
|
||||
{ type: 'CARDS', label: '협상카드관리', icon: Layers, id: 'sidebar-cards' },
|
||||
{ type: 'MEMBERS', label: '회원관리', icon: UserCog, id: 'sidebar-members', ownerOnly: true },
|
||||
];
|
||||
|
||||
const pageLabelMap: Record<PageType, string> = {
|
||||
@@ -40,6 +45,7 @@ const pageLabelMap: Record<PageType, string> = {
|
||||
PARTNERS: '협력사관리',
|
||||
QUOTATION: '견적관리',
|
||||
CARDS: '협상카드관리',
|
||||
MEMBERS: '회원관리',
|
||||
};
|
||||
|
||||
export default function Layout({ children, currentPage, setPage, onLogout }: LayoutProps) {
|
||||
@@ -50,6 +56,7 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
const [isDark, setIsDark] = useState(false);
|
||||
const [isSidebarOpen, setIsSidebarOpen] = useState(true); // 데스크톱 접기 토글
|
||||
const [isMobileOpen, setIsMobileOpen] = useState(false); // 모바일 드로어 열림
|
||||
const [isProfileOpen, setIsProfileOpen] = useState(false); // 내 정보 수정 시트
|
||||
|
||||
// 사이드바 펼침 여부(라벨/프로필 노출 기준). 모바일 드로어는 항상 펼친 상태로 본다.
|
||||
const expanded = isMobileOpen || isSidebarOpen;
|
||||
@@ -126,7 +133,9 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
|
||||
{/* Nav Items */}
|
||||
<nav className="mt-2 px-3 space-y-1">
|
||||
{menuItems.map((item) => (
|
||||
{menuItems
|
||||
.filter((item) => !item.ownerOnly || user?.role === '최고관리자')
|
||||
.map((item) => (
|
||||
<NavItem
|
||||
key={item.type}
|
||||
item={item}
|
||||
@@ -143,6 +152,17 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
|
||||
{/* Sidebar Footer Controls */}
|
||||
<div className="p-2 border-t border-border space-y-1">
|
||||
{/* 내 정보 수정 */}
|
||||
<Button
|
||||
id="sidebar-profile-edit"
|
||||
variant="ghost"
|
||||
onClick={() => setIsProfileOpen(true)}
|
||||
className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-muted-foreground"
|
||||
>
|
||||
<UserPen size={14} className="size-3.5" />
|
||||
{expanded && <span>내 정보 수정</span>}
|
||||
</Button>
|
||||
|
||||
{/* Theme switcher */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -205,6 +225,8 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
<Typography variant="mono">Copyright © O2O Inc. All rights reserved</Typography>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{isProfileOpen && <ProfileSheet open onClose={() => setIsProfileOpen(false)} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ const typographyVariants = cva("", {
|
||||
mono: "text-xs font-mono uppercase tracking-wider text-muted-foreground",
|
||||
// 사이드바/헤더 등 chrome 메타텍스트: type scale 최소(text-xs=12px)보다 작은 11px 캡션
|
||||
caption: "text-[11px] text-muted-foreground leading-normal",
|
||||
// 링크/클릭 가능한 텍스트: 상시 밑줄 + primary 색. 크기/굵기는 className 으로 합성한다
|
||||
// (variant 는 배타적이라 폰트 사이즈를 박지 않음). react-router <Link>/<button> 엔
|
||||
// typographyVariants({ variant: 'link' }) 를 className 에 합성해 같은 토큰을 공유한다.
|
||||
link: "text-primary underline underline-offset-2 decoration-1 cursor-pointer transition-colors hover:text-primary/80",
|
||||
},
|
||||
},
|
||||
defaultVariants: { variant: "body" },
|
||||
@@ -37,6 +41,7 @@ const defaultTag: Record<NonNullable<VariantProps<typeof typographyVariants>["va
|
||||
label: "span",
|
||||
mono: "span",
|
||||
caption: "span",
|
||||
link: "span",
|
||||
}
|
||||
|
||||
type TypographyProps = React.HTMLAttributes<HTMLElement> &
|
||||
|
||||
Reference in new issue
Block a user