feat: DevToolbar 견적V2 채우기 기능 추가
- DevFillContext: quoteV2 페이지 타입 추가 - DevToolbar: test-new/test/[id] 패턴 및 견적V2 버튼 추가 - DevToolbar: 축소 상태에서 채우기 버튼 표시 - QuoteRegistrationV2: DevFill 훅 연동 (1~5개 랜덤 개소 생성) - 층, 부호, 가로, 세로, 제품, 수량 등 랜덤 데이터 - 로그인 사용자 정보(localStorage) 연동
This commit is contained in:
@@ -16,7 +16,7 @@ import React, { createContext, useContext, useState, useCallback, useEffect, Rea
|
||||
|
||||
// 지원하는 페이지 타입
|
||||
export type DevFillPageType =
|
||||
| 'quote' | 'order' | 'workOrder' | 'workOrderComplete' | 'shipment' // 판매/생산 플로우
|
||||
| 'quote' | 'quoteV2' | 'order' | 'workOrder' | 'workOrderComplete' | 'shipment' // 판매/생산 플로우
|
||||
| 'deposit' | 'withdrawal' | 'purchaseApproval' | 'cardTransaction' // 회계 플로우
|
||||
| 'client'; // 기준정보
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ import { useDevFillContext, type DevFillPageType } from './DevFillContext';
|
||||
// 페이지 경로와 타입 매핑 (pathname만으로 매칭되는 패턴)
|
||||
const PAGE_PATTERNS: { pattern: RegExp; type: DevFillPageType; label: string }[] = [
|
||||
// 판매/생산 플로우
|
||||
{ pattern: /\/quote-management\/test-new/, type: 'quoteV2', label: '견적V2' },
|
||||
{ pattern: /\/quote-management\/test\/\d+/, type: 'quoteV2', label: '견적V2' },
|
||||
{ pattern: /\/quote-management\/new/, type: 'quote', label: '견적' },
|
||||
{ pattern: /\/quote-management\/\d+\/edit/, type: 'quote', label: '견적' },
|
||||
{ pattern: /\/order-management-sales\/new/, type: 'order', label: '수주' },
|
||||
@@ -67,6 +69,7 @@ const MODE_NEW_PAGES: { pattern: RegExp; type: DevFillPageType; label: string }[
|
||||
|
||||
// 플로우 단계 정의
|
||||
const FLOW_STEPS: { type: DevFillPageType; label: string; icon: typeof FileText; path: string }[] = [
|
||||
{ type: 'quoteV2', label: '견적V2', icon: FileText, path: '/sales/quote-management/test-new' },
|
||||
{ type: 'quote', label: '견적', icon: FileText, path: '/sales/quote-management/new' },
|
||||
{ type: 'order', label: '수주', icon: ClipboardList, path: '/sales/order-management-sales/new' },
|
||||
{ type: 'workOrder', label: '작업지시', icon: Wrench, path: '/production/work-orders/create' },
|
||||
@@ -192,6 +195,24 @@ export function DevToolbar() {
|
||||
{flowData.workOrderId && ` → 작업#${flowData.workOrderId}`}
|
||||
</Badge>
|
||||
)}
|
||||
{/* 축소 상태에서 채우기 버튼 */}
|
||||
{!isExpanded && activePage && hasRegisteredForm(activePage) && (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="default"
|
||||
disabled={isLoading === activePage}
|
||||
className="h-6 bg-yellow-500 hover:bg-yellow-600 text-white text-xs px-2"
|
||||
onClick={() => handleFillForm(activePage)}
|
||||
title="폼 자동 채우기"
|
||||
>
|
||||
{isLoading === activePage ? (
|
||||
<Loader2 className="w-3 h-3 mr-1 animate-spin" />
|
||||
) : (
|
||||
<Play className="w-3 h-3 mr-1" />
|
||||
)}
|
||||
채우기
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
{hasFlowData && (
|
||||
|
||||
Reference in New Issue
Block a user