feat(WEB): 상세 페이지 권한 체계 통합 및 레이아웃/문서 기능 개선
권한 시스템 통합: - BadDebtDetail, LaborDetail, PricingDetail 권한 로직 정리 - BoardDetail, ClientDetail, ItemDetail 권한 적용 개선 - ProcessDetail, StepDetail, PermissionDetail 권한 리팩토링 - ContractDetail, HandoverReport, ProgressBilling 권한 연동 - ReceivingDetail, ShipmentDetail, WorkOrderDetail 권한 적용 - InspectionDetail, OrderSalesDetail, QuoteFooterBar 권한 개선 기능 개선: - AuthenticatedLayout 구조 리팩토링 - JointbarInspectionDocument 문서 레이아웃 개선 - PricingTableForm 폼 기능 보강 - DynamicItemForm, SectionsTab 개선 - 주문관리 상세/생산지시 페이지 개선 - VendorLedgerDetail 수정 설정: - Claude hooks 추가 (빌드 차단, 파일 크기 체크, 미사용 import 체크) - 품질감사 문서관리 계획 문서 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
16
.claude/hooks/block-build.sh
Executable file
16
.claude/hooks/block-build.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# PreToolUse Hook: 빌드 명령 차단
|
||||
# CLAUDE.md 규칙: "Claude가 직접 npm run build 실행 금지"
|
||||
|
||||
INPUT=$(cat)
|
||||
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
||||
|
||||
# 빌드 명령 패턴 체크
|
||||
if echo "$COMMAND" | grep -qE '(npm run build|next build|yarn build|pnpm build)(\s|$|;|&&|\|)'; then
|
||||
echo "🚫 빌드 명령이 차단되었습니다." >&2
|
||||
echo " CLAUDE.md 규칙: Claude가 직접 빌드 실행 금지" >&2
|
||||
echo " 빌드가 필요하면 사용자에게 요청하세요." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
exit 0
|
||||
31
.claude/hooks/check-file-size.sh
Executable file
31
.claude/hooks/check-file-size.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# PreToolUse Hook: Write 전 파일 크기 급감 경고
|
||||
# 기존 파일 대비 50% 이상 줄어들면 경고 (최소 50줄 이상 파일만)
|
||||
|
||||
INPUT=$(cat)
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
||||
NEW_CONTENT=$(echo "$INPUT" | jq -r '.tool_input.content // empty')
|
||||
|
||||
# 파일이 없으면 (신규 생성) 통과
|
||||
if [ ! -f "$FILE_PATH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
EXISTING_LINES=$(wc -l < "$FILE_PATH" 2>/dev/null | tr -d ' ')
|
||||
NEW_LINES=$(echo "$NEW_CONTENT" | wc -l | tr -d ' ')
|
||||
|
||||
# 기존 파일이 50줄 미만이면 체크 스킵
|
||||
if [ "$EXISTING_LINES" -lt 50 ] 2>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 새 내용이 기존의 50% 미만이면 경고
|
||||
THRESHOLD=$((EXISTING_LINES / 2))
|
||||
if [ "$NEW_LINES" -lt "$THRESHOLD" ] 2>/dev/null; then
|
||||
echo "⚠️ File size drop: $FILE_PATH" >&2
|
||||
echo " 기존: ${EXISTING_LINES}줄 → 새 내용: ${NEW_LINES}줄 (${THRESHOLD}줄 미만)" >&2
|
||||
echo " 파일 내용이 절반 이상 줄었습니다. 의도한 변경인지 확인하세요." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
exit 0
|
||||
29
.claude/hooks/check-unused-imports.sh
Executable file
29
.claude/hooks/check-unused-imports.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# PostToolUse Hook: Edit/Write 후 미사용 import 체크
|
||||
# 단일 파일 eslint로 빠르게 체크 (전체 tsc보다 빠름)
|
||||
|
||||
INPUT=$(cat)
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
||||
|
||||
# TypeScript 파일만 체크
|
||||
if [[ "$FILE_PATH" != *.ts && "$FILE_PATH" != *.tsx ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 파일 존재 확인
|
||||
if [ ! -f "$FILE_PATH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0
|
||||
|
||||
# eslint로 미사용 변수/import 체크 (단일 파일 → 빠름)
|
||||
RESULT=$(npx eslint --no-eslintrc --rule '{"@typescript-eslint/no-unused-vars": "error"}' --parser @typescript-eslint/parser --plugin @typescript-eslint "$FILE_PATH" 2>&1 | grep "no-unused-vars" | head -10)
|
||||
|
||||
if [ -n "$RESULT" ]; then
|
||||
echo "Unused imports/variables in $FILE_PATH:" >&2
|
||||
echo "$RESULT" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,27 @@
|
||||
# [PLAN] 품질인정심사 - 문서 관리 시스템
|
||||
|
||||
## 개요
|
||||
품질인정심사 시스템의 점검 항목별 관련 문서(PDF, Excel)를 업로드하고 맵핑하는 기능
|
||||
|
||||
## 필요 페이지
|
||||
|
||||
### 1. 관리자 페이지 (신규)
|
||||
- 점검 항목별 관련 문서 업로드 (PDF, Excel)
|
||||
- 문서 ↔ 점검항목 맵핑 관리
|
||||
- 버전 관리 (REV번호, 등록일)
|
||||
- 파일 교체/삭제
|
||||
|
||||
### 2. 품질인정심사 페이지 (기존 화면 수정)
|
||||
- 맵핑된 문서 목록 표시 (현재 UI에 이미 있음)
|
||||
- 보기: PDF → 새 탭에서 브라우저 표시 / Excel → 다운로드 후 실행
|
||||
- 다운로드: 파일 직접 다운로드
|
||||
- 오른쪽 미리보기 영역: 파일 정보(파일명, 크기, 등록일, 등록자) 표시
|
||||
|
||||
## 백엔드 API 필요사항
|
||||
- 파일 업로드 API
|
||||
- 문서 ↔ 점검항목 맵핑 CRUD API
|
||||
- 파일 다운로드/스트리밍 API
|
||||
|
||||
## 상태
|
||||
- 기획 대기 중
|
||||
- 기획서 나오면 상세 설계 진행 예정
|
||||
@@ -3,12 +3,15 @@
|
||||
/**
|
||||
* 조인트바 중간검사 성적서 문서 컴포넌트
|
||||
*
|
||||
* 공통 컴포넌트 사용:
|
||||
* - DocumentHeader: quality 레이아웃 + customApproval (QualityApprovalTable)
|
||||
* 새 기획서(SlatJointBarInspectionContent) 레이아웃 적용:
|
||||
* - 헤더: 다른 중간검사 성적서(스크린/절곡/슬랫)와 동일한 헤딩 + 결재 테이블
|
||||
* - 기본정보: 제품명/슬랫, 규격/슬랫, 수주처, 부서
|
||||
* - 중간검사 기준서 KOPS-20: 도해 이미지 + 겉모양(3행) + 치수(4행)
|
||||
* - 중간검사 DATA: No, 겉모양(가공/조립), ①②③④ 치수, 판정
|
||||
* - 부적합 내용 + 종합판정 (한 행)
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { DocumentHeader, QualityApprovalTable } from '@/components/document-system';
|
||||
|
||||
// 조인트바 중간검사 성적서 데이터 타입
|
||||
export interface JointbarInspectionData {
|
||||
@@ -18,7 +21,7 @@ export interface JointbarInspectionData {
|
||||
client: string;
|
||||
siteName: string;
|
||||
lotNo: string;
|
||||
lotSize: string;
|
||||
department: string;
|
||||
inspectionDate: string;
|
||||
inspector: string;
|
||||
approvers: {
|
||||
@@ -26,23 +29,16 @@ export interface JointbarInspectionData {
|
||||
reviewer?: string;
|
||||
approver?: string;
|
||||
};
|
||||
// 중간검사 기준서 정보
|
||||
standardInfo: {
|
||||
appearance: { criteria: string; method: string; frequency: string; regulation: string };
|
||||
assembly: { criteria: string; method: string; frequency: string; regulation: string };
|
||||
coating: { criteria: string; method: string; frequency: string; regulation: string };
|
||||
dimensions: { criteria: string; method: string; frequency: string; regulation: string };
|
||||
};
|
||||
// 중간검사 DATA
|
||||
inspectionData: {
|
||||
serialNo: string;
|
||||
processState: '양호' | '불량';
|
||||
assemblyState: '양호' | '불량';
|
||||
height: { standard: number; measured: number };
|
||||
height2: { standard: number; measured: number };
|
||||
bandLength: { standard: number; measured: number };
|
||||
gap: { standard: number; measured: number };
|
||||
result: '적합' | '부적합';
|
||||
height1: { standard: string; measured: string };
|
||||
height2: { standard: string; measured: string };
|
||||
length: { standard: string; measured: string };
|
||||
interval: { standard: string; measured: string };
|
||||
result: '적' | '부';
|
||||
}[];
|
||||
notes: string;
|
||||
overallResult: '합격' | '불합격';
|
||||
@@ -51,12 +47,12 @@ export interface JointbarInspectionData {
|
||||
// Mock 데이터
|
||||
export const MOCK_JOINTBAR_INSPECTION: JointbarInspectionData = {
|
||||
documentNo: 'KDQP-01-009',
|
||||
productName: '조인트바',
|
||||
specification: '와이어 클러치 크립지름',
|
||||
productName: '슬랫',
|
||||
specification: '슬랫',
|
||||
client: '주일',
|
||||
siteName: '용산고등학교(4호)',
|
||||
lotNo: 'KD-WE-251015-01-(3)',
|
||||
lotSize: '11 개소',
|
||||
department: '생산부',
|
||||
inspectionDate: '2025.',
|
||||
inspector: '',
|
||||
approvers: {
|
||||
@@ -64,38 +60,12 @@ export const MOCK_JOINTBAR_INSPECTION: JointbarInspectionData = {
|
||||
reviewer: '',
|
||||
approver: '',
|
||||
},
|
||||
standardInfo: {
|
||||
appearance: {
|
||||
criteria: '사용상 해로운 결함이 없을 것',
|
||||
method: '',
|
||||
frequency: 'n = 1, c = 0',
|
||||
regulation: 'KS F 4510 5.1항',
|
||||
},
|
||||
assembly: {
|
||||
criteria: '밴드시트 읍동에 의해\n견고하게 조립되어야 함',
|
||||
method: '확인점검',
|
||||
frequency: '',
|
||||
regulation: 'KS F 4510 9항',
|
||||
},
|
||||
coating: {
|
||||
criteria: '용접부위에 락터스베이\n도포하여야 함',
|
||||
method: '',
|
||||
frequency: '',
|
||||
regulation: '자체규정',
|
||||
},
|
||||
dimensions: {
|
||||
criteria: '⓪\n16.5 ± 1\n14.5 ± 1\n300(밴드마감재) ± 4\n150 ± 4',
|
||||
method: '체크검사',
|
||||
frequency: '',
|
||||
regulation: 'KS F 4510 7항\n외 9',
|
||||
},
|
||||
},
|
||||
inspectionData: [
|
||||
{ serialNo: '1', processState: '양호', assemblyState: '양호', height: { standard: 16.5, measured: 14.5 }, height2: { standard: 14.5, measured: 14.5 }, bandLength: { standard: 300, measured: 300 }, gap: { standard: 150, measured: 150 }, result: '적합' },
|
||||
{ serialNo: '2', processState: '양호', assemblyState: '양호', height: { standard: 16.5, measured: 14.5 }, height2: { standard: 14.5, measured: 14.5 }, bandLength: { standard: 300, measured: 300 }, gap: { standard: 150, measured: 150 }, result: '적합' },
|
||||
{ serialNo: '3', processState: '양호', assemblyState: '양호', height: { standard: 16.5, measured: 14.5 }, height2: { standard: 14.5, measured: 14.5 }, bandLength: { standard: 300, measured: 300 }, gap: { standard: 150, measured: 150 }, result: '적합' },
|
||||
{ serialNo: '4', processState: '양호', assemblyState: '양호', height: { standard: 16.5, measured: 14.5 }, height2: { standard: 14.5, measured: 14.5 }, bandLength: { standard: 300, measured: 300 }, gap: { standard: 150, measured: 150 }, result: '적합' },
|
||||
{ serialNo: '5', processState: '양호', assemblyState: '양호', height: { standard: 16.5, measured: 14.5 }, height2: { standard: 14.5, measured: 14.5 }, bandLength: { standard: 300, measured: 300 }, gap: { standard: 150, measured: 150 }, result: '적합' },
|
||||
{ serialNo: '1', processState: '양호', assemblyState: '양호', height1: { standard: '43.1 ± 0.5', measured: '43.1' }, height2: { standard: '14.5 ± 1', measured: '14.5' }, length: { standard: '', measured: '' }, interval: { standard: '150 ± 4', measured: '150' }, result: '적' },
|
||||
{ serialNo: '2', processState: '양호', assemblyState: '양호', height1: { standard: '43.1 ± 0.5', measured: '43.1' }, height2: { standard: '14.5 ± 1', measured: '14.5' }, length: { standard: '', measured: '' }, interval: { standard: '150 ± 4', measured: '150' }, result: '적' },
|
||||
{ serialNo: '3', processState: '양호', assemblyState: '양호', height1: { standard: '43.1 ± 0.5', measured: '43.1' }, height2: { standard: '14.5 ± 1', measured: '14.5' }, length: { standard: '', measured: '' }, interval: { standard: '150 ± 4', measured: '150' }, result: '적' },
|
||||
{ serialNo: '4', processState: '양호', assemblyState: '양호', height1: { standard: '43.1 ± 0.5', measured: '43.1' }, height2: { standard: '14.5 ± 1', measured: '14.5' }, length: { standard: '', measured: '' }, interval: { standard: '150 ± 4', measured: '150' }, result: '적' },
|
||||
{ serialNo: '5', processState: '양호', assemblyState: '양호', height1: { standard: '43.1 ± 0.5', measured: '43.1' }, height2: { standard: '14.5 ± 1', measured: '14.5' }, length: { standard: '', measured: '' }, interval: { standard: '150 ± 4', measured: '150' }, result: '적' },
|
||||
],
|
||||
notes: '',
|
||||
overallResult: '합격',
|
||||
@@ -108,37 +78,57 @@ interface JointbarInspectionDocumentProps {
|
||||
export const JointbarInspectionDocument = ({ data = MOCK_JOINTBAR_INSPECTION }: JointbarInspectionDocumentProps) => {
|
||||
return (
|
||||
<div className="bg-white p-8 w-full text-sm shadow-sm print:shadow-none">
|
||||
{/* 문서 헤더 (공통 컴포넌트) */}
|
||||
<DocumentHeader
|
||||
title="조인트바"
|
||||
subtitle="중간검사 성적서"
|
||||
layout="quality"
|
||||
logo={{ text: 'KD', subtext: '경동기업\nKYUNGDONG COMPANY' }}
|
||||
customApproval={
|
||||
<QualityApprovalTable
|
||||
type="4col"
|
||||
approvers={data.approvers}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{/* 헤더 영역 - 다른 중간검사 성적서와 동일 패턴 */}
|
||||
<div className="flex justify-between items-start mb-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">중간검사성적서 (조인트바)</h1>
|
||||
<p className="text-xs text-gray-500 mt-1 whitespace-nowrap">
|
||||
문서번호: {data.documentNo} | 검사일자: {data.inspectionDate}
|
||||
</p>
|
||||
</div>
|
||||
{/* 결재란 */}
|
||||
<table className="border-collapse text-sm flex-shrink-0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-4 py-1 text-center align-middle" rowSpan={3}>결<br/>재</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center">작성</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center">승인</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center">승인</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center">승인</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-6 py-3 text-center">{data.approvers.writer || ''}</td>
|
||||
<td className="border border-gray-400 px-6 py-3 text-center text-gray-400">{data.approvers.reviewer || '이름'}</td>
|
||||
<td className="border border-gray-400 px-6 py-3 text-center text-gray-400">{data.approvers.approver || '이름'}</td>
|
||||
<td className="border border-gray-400 px-6 py-3 text-center text-gray-400">이름</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center whitespace-nowrap">부서명</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center whitespace-nowrap">부서명</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center whitespace-nowrap">부서명</td>
|
||||
<td className="border border-gray-400 px-6 py-1 text-center whitespace-nowrap">부서명</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{/* 기본 정보 테이블 */}
|
||||
<table className="w-full border-collapse mb-4 text-xs">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 w-20 font-medium">품 명</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 w-24 font-medium">제품명</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.productName}</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 w-24 font-medium">제품 LOT NO</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 w-28 font-medium">제품 LOT NO</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.lotNo}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">규 격</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.specification}</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">로트크기</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.lotSize}</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">부서</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.department}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">발주처</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">수주처</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.client}</td>
|
||||
<td className="border border-gray-400 px-3 py-2 bg-gray-100 font-medium">검사일자</td>
|
||||
<td className="border border-gray-400 px-3 py-2">{data.inspectionDate}</td>
|
||||
@@ -152,131 +142,174 @@ export const JointbarInspectionDocument = ({ data = MOCK_JOINTBAR_INSPECTION }:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* 중간검사 기준서 */}
|
||||
<table className="w-full border-collapse mb-4 text-xs">
|
||||
<thead>
|
||||
<tr className="bg-gray-100">
|
||||
<th className="border border-gray-400 px-2 py-1 w-24" rowSpan={5}>중간검사<br/>기준서</th>
|
||||
<th className="border border-gray-400 px-2 py-1 w-16">도해</th>
|
||||
<th className="border border-gray-400 px-2 py-1 w-16">검사항목</th>
|
||||
<th className="border border-gray-400 px-2 py-1">검사기준</th>
|
||||
<th className="border border-gray-400 px-2 py-1 w-14">검사방법</th>
|
||||
<th className="border border-gray-400 px-2 py-1 w-14">검사주기</th>
|
||||
<th className="border border-gray-400 px-2 py-1 w-24">관련규정</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{/* 중간검사 기준서 KOPS-20 */}
|
||||
<div className="mb-1 font-bold text-xs">■ 중간검사 기준서 KOPS-20</div>
|
||||
<table className="w-full border-collapse text-xs mb-4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="border border-gray-400 p-1 text-center align-middle" rowSpan={4}>
|
||||
{/* 도해 이미지 영역 */}
|
||||
<div className="w-14 h-20 mx-auto border border-gray-300 bg-gray-50 flex items-center justify-center">
|
||||
<div className="text-center text-gray-400">
|
||||
<div className="flex flex-col items-center gap-1">
|
||||
<span className="w-3 h-3 border border-gray-400 rounded-full flex items-center justify-center text-[6px]">1</span>
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="w-2 h-6 border border-gray-300"></div>
|
||||
<span className="w-3 h-3 border border-gray-400 flex items-center justify-center text-[6px]">조인</span>
|
||||
<div className="w-2 h-6 border border-gray-300"></div>
|
||||
</div>
|
||||
<span className="w-3 h-3 border border-gray-400 rounded-full flex items-center justify-center text-[6px]">2</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* 도해 영역 */}
|
||||
<td className="border border-gray-400 p-4 text-center text-gray-300 align-middle w-1/5" rowSpan={8}>
|
||||
<div className="h-40 flex items-center justify-center">도해 이미지 영역</div>
|
||||
</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">가공상태</td>
|
||||
<td className="border border-gray-400 px-1 py-1">{data.standardInfo.appearance.criteria}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{data.standardInfo.appearance.frequency}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center text-[9px]">{data.standardInfo.appearance.regulation}</td>
|
||||
{/* 헤더 행 */}
|
||||
<th className="border border-gray-400 bg-gray-100 px-2 py-1 text-center" colSpan={2}>검사항목</th>
|
||||
<th className="border border-gray-400 bg-gray-100 px-2 py-1 text-center">검사기준</th>
|
||||
<th className="border border-gray-400 bg-gray-100 px-2 py-1 text-center">검사방법</th>
|
||||
<th className="border border-gray-400 bg-gray-100 px-2 py-1 text-center">검사주기</th>
|
||||
<th className="border border-gray-400 bg-gray-100 px-2 py-1 text-center">관련규정</th>
|
||||
</tr>
|
||||
{/* 겉모양 > 가공상태 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium text-center" rowSpan={3}>겉모양</td>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium">가공상태</td>
|
||||
<td className="border border-gray-400 px-2 py-1">사용상 해로운 결함이 없을것</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center" rowSpan={3}>육안검사</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center" rowSpan={7}>n = 1, c = 0</td>
|
||||
<td className="border border-gray-400 px-2 py-1">KS F 4510 5.1항</td>
|
||||
</tr>
|
||||
{/* 겉모양 > 조립상태 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium" rowSpan={2}>조립상태</td>
|
||||
<td className="border border-gray-400 px-2 py-1">엔드락이 용접에 의해<br/>견고하게 조립되어야 함</td>
|
||||
<td className="border border-gray-400 px-2 py-1">KS F 4510 9항</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 whitespace-pre-line">{data.standardInfo.assembly.criteria}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{data.standardInfo.assembly.method}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center text-[9px]">{data.standardInfo.assembly.regulation}</td>
|
||||
<td className="border border-gray-400 px-2 py-1">용접부위에 락카도색이<br/>되어야 함</td>
|
||||
<td className="border border-gray-400 px-2 py-1">자체규정</td>
|
||||
</tr>
|
||||
{/* 치수 > ① 높이 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 whitespace-pre-line">{data.standardInfo.coating.criteria}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center text-[9px]">{data.standardInfo.coating.regulation}</td>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium bg-gray-50 text-center" rowSpan={4}>치수<br/>(mm)</td>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium">① 높이</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center">43.1 ± 0.5</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center" rowSpan={4}>체크검사</td>
|
||||
<td className="border border-gray-400 px-2 py-1" rowSpan={3}>KS F 4510 7항<br/>표9</td>
|
||||
</tr>
|
||||
{/* 치수 > ② 높이 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">치수<br/>(mm)</td>
|
||||
<td className="border border-gray-400 px-1 py-1 whitespace-pre-line">{data.standardInfo.dimensions.criteria}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{data.standardInfo.dimensions.method}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center"></td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center text-[9px] whitespace-pre-line">{data.standardInfo.dimensions.regulation}</td>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium">② 높이</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center">14.5 ± 1</td>
|
||||
</tr>
|
||||
{/* 치수 > 길이 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium">길이</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center">도면치수 ± 4</td>
|
||||
</tr>
|
||||
{/* 치수 > 간격 */}
|
||||
<tr>
|
||||
<td className="border border-gray-400 px-2 py-1 font-medium">간격</td>
|
||||
<td className="border border-gray-400 px-2 py-1 text-center">150 ± 4</td>
|
||||
<td className="border border-gray-400 px-2 py-1">자체규정</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* 중간검사 DATA */}
|
||||
<div className="mb-2 text-xs font-medium">중간검사 DATA</div>
|
||||
<div className="mb-1 font-bold text-xs">■ 중간검사 DATA</div>
|
||||
<table className="w-full border-collapse text-xs mb-4">
|
||||
<thead>
|
||||
<tr className="bg-gray-100">
|
||||
<th className="border border-gray-400 px-1 py-1" rowSpan={2}>일련<br/>번호</th>
|
||||
<th className="border border-gray-400 px-1 py-1" colSpan={2}>검사항</th>
|
||||
<th className="border border-gray-400 px-1 py-1" colSpan={8}>치수 [mm]</th>
|
||||
<th className="border border-gray-400 px-1 py-1" rowSpan={2}>판정</th>
|
||||
<th className="border border-gray-400 p-1 w-8" rowSpan={2}>No.</th>
|
||||
<th className="border border-gray-400 p-1" colSpan={2}>겉모양</th>
|
||||
<th className="border border-gray-400 p-1" colSpan={2}>① 높이 (mm)</th>
|
||||
<th className="border border-gray-400 p-1" colSpan={2}>② 높이 (mm)</th>
|
||||
<th className="border border-gray-400 p-1" colSpan={2}>③ 길이 (mm)</th>
|
||||
<th className="border border-gray-400 p-1" colSpan={2}>④ 간격</th>
|
||||
<th className="border border-gray-400 p-1 w-14" rowSpan={2}>판정<br/>(적/부)</th>
|
||||
</tr>
|
||||
<tr className="bg-gray-100">
|
||||
<th className="border border-gray-400 px-1 py-1">가공상태</th>
|
||||
<th className="border border-gray-400 px-1 py-1">조립상태</th>
|
||||
<th className="border border-gray-400 px-1 py-1">⓪ 높이<br/>기준치</th>
|
||||
<th className="border border-gray-400 px-1 py-1">측정값</th>
|
||||
<th className="border border-gray-400 px-1 py-1">⓪ 높이<br/>기준치</th>
|
||||
<th className="border border-gray-400 px-1 py-1">측정값</th>
|
||||
<th className="border border-gray-400 px-1 py-1">⓪ 길이 (밴드마감재)<br/>기준치</th>
|
||||
<th className="border border-gray-400 px-1 py-1">측정값</th>
|
||||
<th className="border border-gray-400 px-1 py-1">⓪ 간격<br/>기준치</th>
|
||||
<th className="border border-gray-400 px-1 py-1">측정값</th>
|
||||
<th className="border border-gray-400 p-1 w-16">가공상태</th>
|
||||
<th className="border border-gray-400 p-1 w-16">조립상태</th>
|
||||
<th className="border border-gray-400 p-1 w-16">기준치</th>
|
||||
<th className="border border-gray-400 p-1 w-16">측정값</th>
|
||||
<th className="border border-gray-400 p-1 w-16">기준치</th>
|
||||
<th className="border border-gray-400 p-1 w-16">측정값</th>
|
||||
<th className="border border-gray-400 p-1 w-16">기준치</th>
|
||||
<th className="border border-gray-400 p-1 w-16">측정값</th>
|
||||
<th className="border border-gray-400 p-1 w-16">기준치</th>
|
||||
<th className="border border-gray-400 p-1 w-16">측정값</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{data.inspectionData.map((item, index) => (
|
||||
<tr key={index}>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.serialNo}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">
|
||||
☐ 양호 ☐ 불량
|
||||
<td className="border border-gray-400 p-1 text-center">{item.serialNo}</td>
|
||||
{/* 가공상태 */}
|
||||
<td className="border border-gray-400 p-1">
|
||||
<div className="flex flex-col items-center gap-0.5">
|
||||
<span className="flex items-center gap-0.5 text-xs whitespace-nowrap">
|
||||
<span className={`inline-flex items-center justify-center w-3 h-3 border rounded-sm text-[8px] leading-none ${item.processState === '양호' ? 'border-gray-600 bg-gray-700 text-white' : 'border-gray-400 bg-white'}`}>
|
||||
{item.processState === '양호' ? '✓' : ''}
|
||||
</span>
|
||||
양호
|
||||
</span>
|
||||
<span className="flex items-center gap-0.5 text-xs whitespace-nowrap">
|
||||
<span className={`inline-flex items-center justify-center w-3 h-3 border rounded-sm text-[8px] leading-none ${item.processState === '불량' ? 'border-gray-600 bg-gray-700 text-white' : 'border-gray-400 bg-white'}`}>
|
||||
{item.processState === '불량' ? '✓' : ''}
|
||||
</span>
|
||||
불량
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">
|
||||
☐ 양호 ☐ 불량
|
||||
{/* 조립상태 */}
|
||||
<td className="border border-gray-400 p-1">
|
||||
<div className="flex flex-col items-center gap-0.5">
|
||||
<span className="flex items-center gap-0.5 text-xs whitespace-nowrap">
|
||||
<span className={`inline-flex items-center justify-center w-3 h-3 border rounded-sm text-[8px] leading-none ${item.assemblyState === '양호' ? 'border-gray-600 bg-gray-700 text-white' : 'border-gray-400 bg-white'}`}>
|
||||
{item.assemblyState === '양호' ? '✓' : ''}
|
||||
</span>
|
||||
양호
|
||||
</span>
|
||||
<span className="flex items-center gap-0.5 text-xs whitespace-nowrap">
|
||||
<span className={`inline-flex items-center justify-center w-3 h-3 border rounded-sm text-[8px] leading-none ${item.assemblyState === '불량' ? 'border-gray-600 bg-gray-700 text-white' : 'border-gray-400 bg-white'}`}>
|
||||
{item.assemblyState === '불량' ? '✓' : ''}
|
||||
</span>
|
||||
불량
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.height.standard} ± 1</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.height.measured}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.height2.standard} ± 1</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.height2.measured}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.bandLength.standard} ± 4</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.bandLength.measured}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.gap.standard} ± 4</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">{item.gap.measured}</td>
|
||||
<td className="border border-gray-400 px-1 py-1 text-center">
|
||||
☐ 적합 ☐ 부<br/>적합
|
||||
{/* ① 높이 */}
|
||||
<td className="border border-gray-400 p-1 text-center">{item.height1.standard}</td>
|
||||
<td className="border border-gray-400 p-1 text-center">{item.height1.measured || '-'}</td>
|
||||
{/* ② 높이 */}
|
||||
<td className="border border-gray-400 p-1 text-center">{item.height2.standard}</td>
|
||||
<td className="border border-gray-400 p-1 text-center">{item.height2.measured || '-'}</td>
|
||||
{/* ③ 길이 */}
|
||||
<td className="border border-gray-400 p-1 text-center">{item.length.standard || '-'}</td>
|
||||
<td className="border border-gray-400 p-1 text-center">{item.length.measured || '-'}</td>
|
||||
{/* ④ 간격 */}
|
||||
<td className="border border-gray-400 p-1 text-center">{item.interval.standard}</td>
|
||||
<td className="border border-gray-400 p-1 text-center">{item.interval.measured || '-'}</td>
|
||||
{/* 판정 */}
|
||||
<td className={`border border-gray-400 p-1 text-center font-bold ${
|
||||
item.result === '적' ? 'text-blue-600' : 'text-red-600'
|
||||
}`}>
|
||||
{item.result}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* 부적합 내용 */}
|
||||
<div className="border border-gray-400 mb-4">
|
||||
<div className="bg-gray-100 px-3 py-1 text-xs font-medium border-b border-gray-400">【부적합 내용】</div>
|
||||
<div className="px-3 py-2 text-xs text-gray-600 min-h-[30px]">{data.notes}</div>
|
||||
</div>
|
||||
{/* 부적합 내용 + 종합판정 */}
|
||||
<table className="w-full border-collapse text-xs mb-4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="border border-gray-400 bg-gray-100 px-3 py-2 font-medium w-24 align-middle text-center">부적합 내용</td>
|
||||
<td className="border border-gray-400 px-3 py-2 min-h-[30px]">{data.notes || '\u00A0'}</td>
|
||||
<td className="border border-gray-400 bg-gray-100 px-3 py-2 font-medium text-center w-24">종합판정</td>
|
||||
<td className={`border border-gray-400 px-3 py-2 text-center font-bold text-sm w-24 ${
|
||||
data.overallResult === '합격' ? 'text-blue-600' : 'text-red-600'
|
||||
}`}>
|
||||
{data.overallResult}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* 문서번호 및 종합판정 */}
|
||||
{/* 문서번호 */}
|
||||
<div className="flex justify-between items-end">
|
||||
<div className="text-xs text-gray-500">{data.documentNo}</div>
|
||||
<div className="border border-gray-400">
|
||||
<div className="bg-gray-100 px-4 py-1 text-center text-xs font-medium border-b border-gray-400">종합판정</div>
|
||||
<div className={`px-8 py-2 text-center text-sm font-bold ${data.overallResult === '합격' ? 'text-blue-600' : 'text-red-600'}`}>
|
||||
{data.overallResult}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500">KDPS-10-03</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
} from "@/components/ui/table";
|
||||
import {
|
||||
Edit,
|
||||
PenLine,
|
||||
Factory,
|
||||
XCircle,
|
||||
FileSpreadsheet,
|
||||
@@ -32,6 +33,7 @@ import {
|
||||
Eye,
|
||||
CheckCircle2,
|
||||
RotateCcw,
|
||||
Undo2,
|
||||
Package,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
@@ -776,55 +778,55 @@ export default function OrderDetailPage() {
|
||||
const showRevertConfirmButton = order.status === "order_confirmed";
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<>
|
||||
{/* 견적 수정 */}
|
||||
{showEditQuoteButton && (
|
||||
<Button variant="outline" onClick={handleEditQuote}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
견적 수정
|
||||
<Button variant="outline" size="sm" onClick={handleEditQuote}>
|
||||
<PenLine className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">견적 수정</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* 수주서 보기 */}
|
||||
<Button variant="outline" onClick={handleViewOrderDocument}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
수주서 보기
|
||||
<Button variant="outline" size="sm" onClick={handleViewOrderDocument}>
|
||||
<Eye className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주서 보기</span>
|
||||
</Button>
|
||||
{/* 수주 확정 */}
|
||||
{showConfirmButton && (
|
||||
<Button onClick={handleConfirmOrder} className="bg-green-600 hover:bg-green-700">
|
||||
<CheckCircle2 className="h-4 w-4 mr-2" />
|
||||
수주 확정
|
||||
<Button size="sm" onClick={handleConfirmOrder} className="bg-green-600 hover:bg-green-700">
|
||||
<CheckCircle2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주 확정</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* 수주확정 되돌리기 */}
|
||||
{showRevertConfirmButton && (
|
||||
<Button variant="outline" onClick={handleRevertConfirmation} className="border-slate-300 text-slate-600 hover:border-slate-400 hover:bg-slate-50">
|
||||
<RotateCcw className="h-4 w-4 mr-2" />
|
||||
수주확정 되돌리기
|
||||
<Button variant="outline" size="sm" onClick={handleRevertConfirmation} className="border-slate-300 text-slate-600 hover:border-slate-400 hover:bg-slate-50">
|
||||
<RotateCcw className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주확정 되돌리기</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* 생산지시 생성 */}
|
||||
{showProductionCreateButton && (
|
||||
<Button onClick={handleProductionOrder}>
|
||||
<Factory className="h-4 w-4 mr-2" />
|
||||
생산지시 생성
|
||||
<Button size="sm" onClick={handleProductionOrder}>
|
||||
<Factory className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">생산지시 생성</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* 생산지시 되돌리기 */}
|
||||
{showRevertButton && (
|
||||
<Button variant="outline" onClick={handleRevertProduction} className="border-amber-200 text-amber-600 hover:border-amber-300 hover:bg-amber-50">
|
||||
<RotateCcw className="h-4 w-4 mr-2" />
|
||||
생산지시 되돌리기
|
||||
<Button variant="outline" size="sm" onClick={handleRevertProduction} className="border-amber-200 text-amber-600 hover:border-amber-300 hover:bg-amber-50">
|
||||
<Undo2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">생산지시 되돌리기</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* 수정 */}
|
||||
{showEditButton && (
|
||||
<Button variant="outline" onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button variant="outline" size="sm" onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}, [order, handleEditQuote, handleViewOrderDocument, handleConfirmOrder, handleRevertConfirmation, handleProductionOrder, handleRevertProduction, handleEdit]);
|
||||
|
||||
|
||||
@@ -967,18 +967,19 @@ export default function ProductionOrderCreatePage() {
|
||||
PRIORITY_COLORS[selectedPriority].buttonActive,
|
||||
"border-0"
|
||||
)}>
|
||||
우선순위: {selectedConfig.productionOrder}
|
||||
<span className="hidden md:inline">우선순위: </span>{selectedConfig.productionOrder}
|
||||
</BadgeSm>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" onClick={handleBackToDetail}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
수주상세로
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
<Button variant="outline" onClick={handleBackToDetail} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주상세로</span>
|
||||
</Button>
|
||||
<Button onClick={handleConfirm} disabled={isSubmitting}>
|
||||
<BarChart3 className="h-4 w-4 mr-2" />
|
||||
생산지시 확정 ({screenItems.length}건)
|
||||
<Button onClick={handleConfirm} disabled={isSubmitting} size="sm" className="md:size-default">
|
||||
<BarChart3 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">생산지시 확정</span>
|
||||
<span className="ml-1">({screenItems.length})</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { DeleteConfirmDialog, SaveConfirmDialog } from '@/components/ui/confirm-dialog';
|
||||
import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate';
|
||||
import { badDebtConfig } from './badDebtConfig';
|
||||
import { toast } from 'sonner';
|
||||
@@ -43,7 +42,6 @@ import {
|
||||
} from './types';
|
||||
import { createBadDebt, updateBadDebt, deleteBadDebt, addBadDebtMemo, deleteBadDebtMemo } from './actions';
|
||||
import { isNextRedirectError } from '@/lib/utils/redirect-error';
|
||||
import { usePermission } from '@/hooks/usePermission';
|
||||
|
||||
interface BadDebtDetailProps {
|
||||
mode: 'view' | 'edit' | 'new';
|
||||
@@ -96,7 +94,6 @@ const getEmptyRecord = (): Omit<BadDebtRecord, 'id' | 'createdAt' | 'updatedAt'>
|
||||
|
||||
export function BadDebtDetail({ mode, recordId, initialData }: BadDebtDetailProps) {
|
||||
const router = useRouter();
|
||||
const { canUpdate, canDelete } = usePermission();
|
||||
const isViewMode = mode === 'view';
|
||||
const isNewMode = mode === 'new';
|
||||
|
||||
@@ -114,9 +111,7 @@ export function BadDebtDetail({ mode, recordId, initialData }: BadDebtDetailProp
|
||||
},
|
||||
});
|
||||
|
||||
// 다이얼로그 상태
|
||||
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
|
||||
const [showSaveDialog, setShowSaveDialog] = useState(false);
|
||||
// 상태
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
// 새 메모 입력
|
||||
@@ -132,82 +127,43 @@ export function BadDebtDetail({ mode, recordId, initialData }: BadDebtDetailProp
|
||||
setFormData(prev => ({ ...prev, [field]: value }));
|
||||
}, []);
|
||||
|
||||
// 네비게이션 핸들러
|
||||
const handleEdit = useCallback(() => {
|
||||
router.push(`/ko/accounting/bad-debt-collection/${recordId}?mode=edit`);
|
||||
}, [router, recordId]);
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
if (isNewMode) {
|
||||
router.push('/ko/accounting/bad-debt-collection');
|
||||
} else {
|
||||
router.push(`/ko/accounting/bad-debt-collection/${recordId}?mode=view`);
|
||||
}
|
||||
}, [router, recordId, isNewMode]);
|
||||
|
||||
// 저장 핸들러
|
||||
const handleSave = useCallback(() => {
|
||||
setShowSaveDialog(true);
|
||||
}, []);
|
||||
|
||||
const handleConfirmSave = useCallback(async () => {
|
||||
setIsLoading(true);
|
||||
setShowSaveDialog(false);
|
||||
|
||||
// 저장/등록 핸들러 (IntegratedDetailTemplate onSubmit용)
|
||||
const handleTemplateSubmit = useCallback(async (): Promise<{ success: boolean; error?: string }> => {
|
||||
try {
|
||||
if (isNewMode) {
|
||||
const result = await createBadDebt(formData);
|
||||
if (result.success) {
|
||||
toast.success('악성채권이 등록되었습니다.');
|
||||
router.push('/ko/accounting/bad-debt-collection');
|
||||
} else {
|
||||
toast.error(result.error || '등록에 실패했습니다.');
|
||||
return { success: true };
|
||||
}
|
||||
return { success: false, error: result.error || '등록에 실패했습니다.' };
|
||||
} else {
|
||||
const result = await updateBadDebt(recordId!, formData);
|
||||
if (result.success) {
|
||||
toast.success('악성채권이 수정되었습니다.');
|
||||
router.push(`/ko/accounting/bad-debt-collection/${recordId}?mode=view`);
|
||||
} else {
|
||||
toast.error(result.error || '수정에 실패했습니다.');
|
||||
return { success: true };
|
||||
}
|
||||
return { success: false, error: result.error || '수정에 실패했습니다.' };
|
||||
}
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('저장 오류:', error);
|
||||
toast.error('서버 오류가 발생했습니다.');
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
return { success: false, error: '서버 오류가 발생했습니다.' };
|
||||
}
|
||||
}, [formData, router, recordId, isNewMode]);
|
||||
|
||||
// 삭제 핸들러
|
||||
const handleDelete = useCallback(() => {
|
||||
setShowDeleteDialog(true);
|
||||
}, []);
|
||||
|
||||
const handleConfirmDelete = useCallback(async () => {
|
||||
if (!recordId) return;
|
||||
|
||||
setIsLoading(true);
|
||||
setShowDeleteDialog(false);
|
||||
}, [formData, recordId, isNewMode]);
|
||||
|
||||
// 삭제 핸들러 (IntegratedDetailTemplate onDelete용)
|
||||
const handleTemplateDelete = useCallback(async (id: string | number): Promise<{ success: boolean; error?: string }> => {
|
||||
try {
|
||||
const result = await deleteBadDebt(recordId);
|
||||
const result = await deleteBadDebt(String(id));
|
||||
if (result.success) {
|
||||
toast.success('악성채권이 삭제되었습니다.');
|
||||
router.push('/ko/accounting/bad-debt-collection');
|
||||
} else {
|
||||
toast.error(result.error || '삭제에 실패했습니다.');
|
||||
return { success: true };
|
||||
}
|
||||
return { success: false, error: result.error || '삭제에 실패했습니다.' };
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('삭제 오류:', error);
|
||||
toast.error('서버 오류가 발생했습니다.');
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
return { success: false, error: '서버 오류가 발생했습니다.' };
|
||||
}
|
||||
}, [router, recordId]);
|
||||
}, []);
|
||||
|
||||
// 메모 추가 핸들러
|
||||
const handleAddMemo = useCallback(async () => {
|
||||
@@ -340,39 +296,16 @@ export function BadDebtDetail({ mode, recordId, initialData }: BadDebtDetailProp
|
||||
return {
|
||||
...badDebtConfig,
|
||||
title: titleMap[mode] || badDebtConfig.title,
|
||||
actions: {
|
||||
...badDebtConfig.actions,
|
||||
deleteConfirmMessage: {
|
||||
title: '악성채권 삭제',
|
||||
description: '이 악성채권 기록을 삭제하시겠습니까? 확인 클릭 시 목록으로 이동합니다.',
|
||||
},
|
||||
},
|
||||
};
|
||||
}, [mode]);
|
||||
|
||||
// 커스텀 헤더 액션 (저장 확인 다이얼로그 패턴 유지)
|
||||
const customHeaderActions = useMemo(() => {
|
||||
if (isViewMode) {
|
||||
return (
|
||||
<>
|
||||
{canDelete && (
|
||||
<Button variant="outline" className="text-red-500 border-red-200 hover:bg-red-50" onClick={handleDelete} disabled={isLoading}>
|
||||
{isLoading ? '처리중...' : '삭제'}
|
||||
</Button>
|
||||
)}
|
||||
{canUpdate && (
|
||||
<Button onClick={handleEdit} className="bg-blue-500 hover:bg-blue-600" disabled={isLoading}>
|
||||
수정
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCancel} disabled={isLoading}>
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleSave} className="bg-blue-500 hover:bg-blue-600" disabled={isLoading}>
|
||||
{isLoading ? '처리중...' : (isNewMode ? '등록' : '저장')}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}, [isViewMode, isNewMode, isLoading, handleDelete, handleEdit, handleCancel, handleSave, mode, canUpdate, canDelete]);
|
||||
|
||||
// 입력 필드 렌더링 헬퍼
|
||||
const renderField = (
|
||||
label: string,
|
||||
@@ -1019,40 +952,16 @@ export function BadDebtDetail({ mode, recordId, initialData }: BadDebtDetailProp
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<IntegratedDetailTemplate
|
||||
config={dynamicConfig}
|
||||
mode={isNewMode ? 'create' : (isViewMode ? 'view' : 'edit')}
|
||||
initialData={formData as unknown as Record<string, unknown>}
|
||||
itemId={recordId}
|
||||
isLoading={isLoading}
|
||||
headerActions={customHeaderActions}
|
||||
renderView={() => renderFormContent()}
|
||||
renderForm={() => renderFormContent()}
|
||||
/>
|
||||
|
||||
{/* 삭제 확인 다이얼로그 */}
|
||||
<DeleteConfirmDialog
|
||||
open={showDeleteDialog}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
onConfirm={handleConfirmDelete}
|
||||
title="악성채권 삭제"
|
||||
description={
|
||||
<>
|
||||
'{formData.vendorName}'의 악성채권 기록을 삭제하시겠습니까?
|
||||
<br />
|
||||
확인 클릭 시 목록으로 이동합니다.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* 저장 확인 다이얼로그 */}
|
||||
<SaveConfirmDialog
|
||||
open={showSaveDialog}
|
||||
onOpenChange={setShowSaveDialog}
|
||||
onConfirm={handleConfirmSave}
|
||||
description="입력한 내용을 저장하시겠습니까?"
|
||||
/>
|
||||
</>
|
||||
<IntegratedDetailTemplate
|
||||
config={dynamicConfig}
|
||||
mode={isNewMode ? 'create' : (isViewMode ? 'view' : 'edit')}
|
||||
initialData={formData as unknown as Record<string, unknown>}
|
||||
itemId={recordId}
|
||||
isLoading={isLoading}
|
||||
onSubmit={handleTemplateSubmit}
|
||||
onDelete={handleTemplateDelete}
|
||||
renderView={() => renderFormContent()}
|
||||
renderForm={() => renderFormContent()}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -145,8 +145,8 @@ export function VendorLedgerDetail({
|
||||
size="sm"
|
||||
onClick={handlePdfDownload}
|
||||
>
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
PDF 다운로드
|
||||
<Download className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">PDF 다운로드</span>
|
||||
</Button>
|
||||
);
|
||||
}, [handlePdfDownload]);
|
||||
|
||||
@@ -201,24 +201,25 @@ export function BoardDetail({ post, comments: initialComments, currentUserId }:
|
||||
</div>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
{isMyPost && (
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setShowDeleteDialog(true)}
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground"
|
||||
size="sm"
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground md:size-default"
|
||||
>
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
<Button onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={handleEdit} size="sm" className="md:size-default">
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useCallback, useMemo } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Eye, Download, FileText, X } from 'lucide-react';
|
||||
import { Eye, Download, FileText, X, FilePlus2, Stamp } from 'lucide-react';
|
||||
import { FileInput } from '@/components/ui/file-input';
|
||||
import { FileDropzone } from '@/components/ui/file-dropzone';
|
||||
import { FileList, type NewFile, type ExistingFile } from '@/components/ui/file-list';
|
||||
@@ -232,15 +232,17 @@ export default function ContractDetailForm({
|
||||
if (!isViewMode) return null;
|
||||
return (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCreateChangeContract}>
|
||||
변경 계약서 생성
|
||||
<Button variant="outline" onClick={handleCreateChangeContract} size="sm">
|
||||
<FilePlus2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">변경 계약서 생성</span>
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleViewDocument}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
계약서 보기
|
||||
<Button variant="outline" onClick={handleViewDocument} size="sm">
|
||||
<Eye className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">계약서 보기</span>
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleApproval}>
|
||||
전자결재
|
||||
<Button variant="outline" onClick={handleApproval} size="sm">
|
||||
<Stamp className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">전자결재</span>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useCallback, useMemo } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Plus, X, Eye } from 'lucide-react';
|
||||
import { Plus, X, Eye, Stamp } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
@@ -149,12 +149,13 @@ export default function HandoverReportDetailForm({
|
||||
if (!isViewMode) return null;
|
||||
return (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleViewDocument}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
인수인계보고서 보기
|
||||
<Button variant="outline" onClick={handleViewDocument} size="sm">
|
||||
<Eye className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">인수인계보고서 보기</span>
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleApproval}>
|
||||
전자결재
|
||||
<Button variant="outline" onClick={handleApproval} size="sm">
|
||||
<Stamp className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">전자결재</span>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -404,53 +404,54 @@ export default function LaborDetailClient({
|
||||
</div>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
{mode === 'view' && (
|
||||
<>
|
||||
{canDelete && (
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setDeleteDialogOpen(true)}
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground"
|
||||
size="sm"
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground md:size-default"
|
||||
>
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
)}
|
||||
{canUpdate && (
|
||||
<Button onClick={handleEditMode}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={handleEditMode} size="sm" className="md:size-default">
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{mode === 'edit' && (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCancel}>
|
||||
<X className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<Button variant="outline" onClick={handleCancel} size="sm" className="md:size-default">
|
||||
<X className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={isSaving}>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{isSaving ? '저장 중...' : '저장'}
|
||||
<Button onClick={handleSave} disabled={isSaving} size="sm" className="md:size-default">
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isSaving ? '저장 중...' : '저장'}</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{mode === 'new' && (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCancel}>
|
||||
<X className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<Button variant="outline" onClick={handleCancel} size="sm" className="md:size-default">
|
||||
<X className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={isSaving}>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
{isSaving ? '등록 중...' : '등록'}
|
||||
<Button onClick={handleSave} disabled={isSaving} size="sm" className="md:size-default">
|
||||
<Plus className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isSaving ? '등록 중...' : '등록'}</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -397,53 +397,54 @@ export default function PricingDetailClient({ id, mode }: PricingDetailClientPro
|
||||
</div>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
{isViewMode && (
|
||||
<>
|
||||
{canDelete && (
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setDeleteDialogOpen(true)}
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground"
|
||||
size="sm"
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground md:size-default"
|
||||
>
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
)}
|
||||
{canUpdate && (
|
||||
<Button onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={handleEdit} size="sm" className="md:size-default">
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{isEditMode && (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCancel}>
|
||||
<X className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<Button variant="outline" onClick={handleCancel} size="sm" className="md:size-default">
|
||||
<X className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={isLoading}>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{isLoading ? '저장 중...' : '저장'}
|
||||
<Button onClick={handleSave} disabled={isLoading} size="sm" className="md:size-default">
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isLoading ? '저장 중...' : '저장'}</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{isCreateMode && (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleCancel}>
|
||||
<X className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<Button variant="outline" onClick={handleCancel} size="sm" className="md:size-default">
|
||||
<X className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={isLoading}>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
{isLoading ? '등록 중...' : '등록'}
|
||||
<Button onClick={handleSave} disabled={isLoading} size="sm" className="md:size-default">
|
||||
<Plus className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isLoading ? '등록 중...' : '등록'}</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Eye } from 'lucide-react';
|
||||
import { Hammer, Wrench, Image } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate';
|
||||
import { progressBillingConfig } from './progressBillingConfig';
|
||||
@@ -91,17 +91,17 @@ export default function ProgressBillingDetailForm({
|
||||
if (!isViewMode) return null;
|
||||
return (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleViewDirectConstruction}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
직접 공사 내역 보기
|
||||
<Button variant="outline" onClick={handleViewDirectConstruction} size="sm">
|
||||
<Hammer className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">직접 공사 내역 보기</span>
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleViewIndirectConstruction}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
간접 공사 내역 보기
|
||||
<Button variant="outline" onClick={handleViewIndirectConstruction} size="sm">
|
||||
<Wrench className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">간접 공사 내역 보기</span>
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleViewPhotoDocument}>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
사진대지 보기
|
||||
<Button variant="outline" onClick={handleViewPhotoDocument} size="sm">
|
||||
<Image className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">사진대지 보기</span>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -233,19 +233,19 @@ export function ClientDetail({
|
||||
</div>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={onBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={onBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" onClick={onDelete} className="text-destructive hover:bg-destructive hover:text-destructive-foreground">
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
<Button variant="outline" onClick={onDelete} size="sm" className="text-destructive hover:bg-destructive hover:text-destructive-foreground md:size-default">
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
<Button onClick={onEdit}>
|
||||
<Pencil className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={onEdit} size="sm" className="md:size-default">
|
||||
<Pencil className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1046,22 +1046,26 @@ export default function DynamicItemForm({
|
||||
/>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => router.back()}
|
||||
disabled={isSubmitting}
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<X className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<X className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={!selectedItemType || isSubmitting}
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{isSubmitting ? '저장 중...' : '저장'}
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isSubmitting ? '저장 중...' : '저장'}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -618,22 +618,26 @@ export default function ItemDetailClient({ item }: ItemDetailClientProps) {
|
||||
)}
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => router.back()}
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4 mr-2" />
|
||||
목록으로
|
||||
<ArrowLeft className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
{canUpdate && (
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => router.push(`/production/screen-production/${encodeURIComponent(item.itemCode)}?mode=edit&type=${item.itemType}&id=${item.id}`)}
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<Edit className="w-4 h-4 mr-2" />
|
||||
수정
|
||||
<Edit className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -84,11 +84,11 @@ export function SectionsTab({
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<div>
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<div className="min-w-0">
|
||||
<CardTitle>섹션 템플릿 관리</CardTitle>
|
||||
<CardDescription>재사용 가능한 섹션 템플릿을 관리합니다</CardDescription>
|
||||
<CardDescription className="truncate">재사용 가능한 섹션 템플릿을 관리합니다</CardDescription>
|
||||
</div>
|
||||
{/* 변경사항 배지 - 나중에 사용 예정으로 임시 숨김 */}
|
||||
{false && hasUnsavedChanges && pendingChanges.sectionTemplates.length > 0 && (
|
||||
@@ -97,8 +97,8 @@ export function SectionsTab({
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<Button onClick={() => setIsSectionTemplateDialogOpen(true)}>
|
||||
<Plus className="h-4 w-4 mr-2" />섹션추가
|
||||
<Button size="sm" className="shrink-0" onClick={() => setIsSectionTemplateDialogOpen(true)}>
|
||||
<Plus className="h-4 w-4 md:mr-2" /><span className="hidden md:inline">섹션추가</span>
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
@@ -143,19 +143,19 @@ export function SectionsTab({
|
||||
{sectionTemplates.filter(t => t.section_type !== 'BOM').map((template) => (
|
||||
<Card key={template.id}>
|
||||
<CardHeader className="pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3 flex-1">
|
||||
<Folder className="h-5 w-5 text-blue-500" />
|
||||
<div className="flex-1">
|
||||
<CardTitle className="text-base">{template.template_name}</CardTitle>
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="flex items-center gap-3 min-w-0 flex-1">
|
||||
<Folder className="h-5 w-5 text-blue-500 shrink-0" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<CardTitle className="text-base truncate">{template.template_name}</CardTitle>
|
||||
{template.description && (
|
||||
<CardDescription className="text-sm mt-0.5">{template.description}</CardDescription>
|
||||
<CardDescription className="text-sm mt-0.5 truncate">{template.description}</CardDescription>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 shrink-0">
|
||||
{template.category && template.category.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1 mr-2">
|
||||
<div className="hidden md:flex flex-wrap gap-1 mr-2">
|
||||
{template.category.map((cat, idx) => (
|
||||
<Badge key={idx} variant="secondary" className="text-xs">
|
||||
{ITEM_TYPE_OPTIONS.find(t => t.value === cat)?.label || cat}
|
||||
@@ -193,11 +193,11 @@ export function SectionsTab({
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div className="mb-4 flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
이 템플릿과 관련되는 항목 목록을 조회합니다
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<div className="flex gap-2 shrink-0">
|
||||
{setIsImportFieldDialogOpen && setImportFieldTargetSectionId && (
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -243,27 +243,27 @@ export function SectionsTab({
|
||||
{template.fields.map((field, index) => (
|
||||
<div
|
||||
key={`${template.id}-${field.id}-${index}`}
|
||||
className="flex items-center justify-between p-3 border rounded hover:bg-gray-50 transition-colors"
|
||||
className="flex items-center justify-between gap-2 p-3 border rounded hover:bg-gray-50 transition-colors"
|
||||
>
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<GripVertical className="h-4 w-4 text-gray-400" />
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-1.5 flex-wrap">
|
||||
<GripVertical className="h-4 w-4 text-gray-400 shrink-0" />
|
||||
<span className="text-sm font-medium">{field.name}</span>
|
||||
<Badge variant="outline" className="text-xs">
|
||||
<Badge variant="outline" className="text-xs shrink-0">
|
||||
{INPUT_TYPE_OPTIONS.find(t => t.value === field.property.inputType)?.label}
|
||||
</Badge>
|
||||
{field.property.required && (
|
||||
<Badge variant="destructive" className="text-xs">필수</Badge>
|
||||
<Badge variant="destructive" className="text-xs shrink-0">필수</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="ml-6 text-xs text-gray-500 mt-1">
|
||||
<div className="ml-6 text-xs text-gray-500 mt-1 truncate">
|
||||
필드키: {field.fieldKey}
|
||||
{field.description && (
|
||||
<span className="ml-2">• {field.description}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<div className="flex gap-1 shrink-0">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
@@ -307,19 +307,19 @@ export function SectionsTab({
|
||||
{sectionTemplates.filter(t => t.section_type === 'BOM').map((template) => (
|
||||
<Card key={template.id}>
|
||||
<CardHeader className="pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3 flex-1">
|
||||
<Package className="h-5 w-5 text-green-500" />
|
||||
<div className="flex-1">
|
||||
<CardTitle className="text-base">{template.template_name}</CardTitle>
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="flex items-center gap-3 min-w-0 flex-1">
|
||||
<Package className="h-5 w-5 text-green-500 shrink-0" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<CardTitle className="text-base truncate">{template.template_name}</CardTitle>
|
||||
{template.description && (
|
||||
<CardDescription className="text-sm mt-0.5">{template.description}</CardDescription>
|
||||
<CardDescription className="text-sm mt-0.5 truncate">{template.description}</CardDescription>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 shrink-0">
|
||||
{template.category && template.category.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1 mr-2">
|
||||
<div className="hidden md:flex flex-wrap gap-1 mr-2">
|
||||
{template.category.map((cat, idx) => (
|
||||
<Badge key={idx} variant="secondary" className="text-xs">
|
||||
{ITEM_TYPE_OPTIONS.find(t => t.value === cat)?.label || cat}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import { useState, useCallback, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Upload, FileText, Search, X, Plus } from 'lucide-react';
|
||||
import { Upload, FileText, Search, X, Plus, ClipboardCheck } from 'lucide-react';
|
||||
import { FileDropzone } from '@/components/ui/file-dropzone';
|
||||
import { ItemSearchModal } from '@/components/quotes/ItemSearchModal';
|
||||
import { InspectionModalV2 } from '@/app/[locale]/(protected)/quality/qms/components/InspectionModalV2';
|
||||
@@ -687,21 +687,12 @@ export function ReceivingDetail({ id, mode = 'view' }: Props) {
|
||||
}, [formData, adjustments]);
|
||||
|
||||
// ===== 커스텀 헤더 액션 (view/edit 모드) =====
|
||||
// 수정 버튼은 IntegratedDetailTemplate의 DetailActions에서 아이콘으로 제공하므로 중복 제거
|
||||
const customHeaderActions = (isViewMode || isEditMode) && detail ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" onClick={handleInspection}>
|
||||
수입검사하기
|
||||
</Button>
|
||||
{isViewMode && (
|
||||
<Button
|
||||
variant="default"
|
||||
className="bg-gray-900 text-white hover:bg-gray-800"
|
||||
onClick={() => router.push(`/ko/material/receiving-management/${id}?mode=edit`)}
|
||||
>
|
||||
수정
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<Button variant="outline" size="sm" onClick={handleInspection}>
|
||||
<ClipboardCheck className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수입검사하기</span>
|
||||
</Button>
|
||||
) : undefined;
|
||||
|
||||
// 에러 상태 표시 (view/edit 모드에서만)
|
||||
|
||||
@@ -254,21 +254,21 @@ export function OrderSalesDetailView({ orderId }: OrderSalesDetailViewProps) {
|
||||
return (
|
||||
<>
|
||||
{showConfirmButton && (
|
||||
<Button onClick={handleConfirmOrder} className="bg-green-600 hover:bg-green-700">
|
||||
<CheckCircle2 className="h-4 w-4 mr-2" />
|
||||
수주 확정
|
||||
<Button onClick={handleConfirmOrder} className="bg-green-600 hover:bg-green-700" size="sm">
|
||||
<CheckCircle2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주 확정</span>
|
||||
</Button>
|
||||
)}
|
||||
{showProductionCreateButton && (
|
||||
<Button onClick={handleProductionOrder}>
|
||||
<Factory className="h-4 w-4 mr-2" />
|
||||
생산지시 생성
|
||||
<Button onClick={handleProductionOrder} size="sm">
|
||||
<Factory className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">생산지시 생성</span>
|
||||
</Button>
|
||||
)}
|
||||
{showCancelButton && (
|
||||
<Button variant="outline" onClick={handleCancel} className="border-orange-200 text-orange-600 hover:border-orange-300">
|
||||
<XCircle className="h-4 w-4 mr-2" />
|
||||
취소
|
||||
<Button variant="outline" onClick={handleCancel} className="border-orange-200 text-orange-600 hover:border-orange-300" size="sm">
|
||||
<XCircle className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">취소</span>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -272,56 +272,45 @@ export function ShipmentDetail({ id }: ShipmentDetailProps) {
|
||||
if (!detail) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setPreviewDocument('shipping')}
|
||||
>
|
||||
<FileText className="w-4 h-4 mr-1" />
|
||||
출고증 보기
|
||||
<FileText className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">출고증 보기</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setPreviewDocument('delivery')}
|
||||
>
|
||||
<ClipboardList className="w-4 h-4 mr-1" />
|
||||
납품확인서 보기
|
||||
<ClipboardList className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">납품확인서 보기</span>
|
||||
</Button>
|
||||
{/* 거래명세서 - 추후 활성화 */}
|
||||
{/* <Button variant="outline" size="sm">
|
||||
<Receipt className="w-4 h-4 mr-1" />
|
||||
거래명세서 보기
|
||||
</Button> */}
|
||||
{canDelete && (
|
||||
<>
|
||||
<div className="w-px h-6 bg-border mx-2" />
|
||||
<Button
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
onClick={() => setShowDeleteDialog(true)}
|
||||
>
|
||||
<Trash2 className="w-4 h-4 mr-1" />
|
||||
삭제
|
||||
</Button>
|
||||
</>
|
||||
<Button
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
onClick={() => setShowDeleteDialog(true)}
|
||||
>
|
||||
<Trash2 className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
)}
|
||||
{STATUS_TRANSITIONS[detail.status] && (
|
||||
<>
|
||||
<div className="w-px h-6 bg-border mx-2" />
|
||||
<Button
|
||||
variant="default"
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-700"
|
||||
onClick={() => handleOpenStatusDialog(STATUS_TRANSITIONS[detail.status]!)}
|
||||
>
|
||||
<ArrowRight className="w-4 h-4 mr-1" />
|
||||
{SHIPMENT_STATUS_LABELS[STATUS_TRANSITIONS[detail.status]!]}으로 변경
|
||||
</Button>
|
||||
</>
|
||||
<Button
|
||||
variant="default"
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-700"
|
||||
onClick={() => handleOpenStatusDialog(STATUS_TRANSITIONS[detail.status]!)}
|
||||
>
|
||||
<ArrowRight className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{SHIPMENT_STATUS_LABELS[STATUS_TRANSITIONS[detail.status]!]}으로 변경</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}, [detail, canDelete, handleOpenStatusDialog]);
|
||||
|
||||
|
||||
@@ -437,33 +437,33 @@ export function PricingTableForm({ mode, initialData }: PricingTableFormProps) {
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div
|
||||
className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}
|
||||
className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}
|
||||
>
|
||||
<Button variant="outline" onClick={handleList}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<Button variant="outline" onClick={handleList} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
{isEdit ? (
|
||||
<>
|
||||
{canDelete && (
|
||||
<Button variant="outline" onClick={() => setDeleteDialogOpen(true)}>
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<Button variant="outline" onClick={() => setDeleteDialogOpen(true)} size="sm" className="md:size-default">
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
)}
|
||||
{canUpdate && (
|
||||
<Button onClick={handleSave} disabled={isSaving}>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{isSaving ? '저장 중...' : '수정'}
|
||||
<Button onClick={handleSave} disabled={isSaving} size="sm" className="md:size-default">
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isSaving ? '저장 중...' : '수정'}</span>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
canCreate && (
|
||||
<Button onClick={handleSave} disabled={isSaving}>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{isSaving ? '저장 중...' : '등록'}
|
||||
<Button onClick={handleSave} disabled={isSaving} size="sm" className="md:size-default">
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">{isSaving ? '저장 중...' : '등록'}</span>
|
||||
</Button>
|
||||
)
|
||||
)}
|
||||
|
||||
@@ -321,16 +321,16 @@ export function ProcessDetail({ process }: ProcessDetailProps) {
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div
|
||||
className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}
|
||||
className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}
|
||||
>
|
||||
<Button variant="outline" onClick={handleList}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<Button variant="outline" onClick={handleList} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
{canUpdate && (
|
||||
<Button onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={handleEdit} size="sm" className="md:size-default">
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -125,16 +125,16 @@ export function StepDetail({ step, processId }: StepDetailProps) {
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div
|
||||
className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}
|
||||
className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}
|
||||
>
|
||||
<Button variant="outline" onClick={handleBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
공정으로 돌아가기
|
||||
<Button variant="outline" onClick={handleBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">공정으로 돌아가기</span>
|
||||
</Button>
|
||||
{canUpdate && (
|
||||
<Button onClick={handleEdit}>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
수정
|
||||
<Button onClick={handleEdit} size="sm" className="md:size-default">
|
||||
<Edit className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -256,13 +256,14 @@ export function WorkOrderDetail({ orderId }: WorkOrderDetailProps) {
|
||||
onClick={() => handleStatusChange('in_progress')}
|
||||
disabled={isStatusUpdating}
|
||||
className="bg-green-600 hover:bg-green-700"
|
||||
size="sm"
|
||||
>
|
||||
{isStatusUpdating ? (
|
||||
<Loader2 className="w-4 h-4 mr-1.5 animate-spin" />
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<Play className="w-4 h-4 mr-1.5" />
|
||||
<Play className="w-4 h-4 md:mr-2" />
|
||||
)}
|
||||
작업 시작
|
||||
<span className="hidden md:inline">작업 시작</span>
|
||||
</Button>
|
||||
)}
|
||||
{order.status === 'in_progress' && (
|
||||
@@ -272,25 +273,27 @@ export function WorkOrderDetail({ orderId }: WorkOrderDetailProps) {
|
||||
onClick={() => handleStatusChange('waiting')}
|
||||
disabled={isStatusUpdating}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
size="sm"
|
||||
>
|
||||
{isStatusUpdating ? (
|
||||
<Loader2 className="w-4 h-4 mr-1.5 animate-spin" />
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<Undo2 className="w-4 h-4 mr-1.5" />
|
||||
<Undo2 className="w-4 h-4 md:mr-2" />
|
||||
)}
|
||||
작업 취소
|
||||
<span className="hidden md:inline">작업 취소</span>
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => handleStatusChange('completed')}
|
||||
disabled={isStatusUpdating}
|
||||
className="bg-purple-600 hover:bg-purple-700"
|
||||
size="sm"
|
||||
>
|
||||
{isStatusUpdating ? (
|
||||
<Loader2 className="w-4 h-4 mr-1.5 animate-spin" />
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<CheckCircle2 className="w-4 h-4 mr-1.5" />
|
||||
<CheckCircle2 className="w-4 h-4 md:mr-2" />
|
||||
)}
|
||||
작업 완료
|
||||
<span className="hidden md:inline">작업 완료</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
@@ -300,25 +303,27 @@ export function WorkOrderDetail({ orderId }: WorkOrderDetailProps) {
|
||||
onClick={() => handleStatusChange('in_progress')}
|
||||
disabled={isStatusUpdating}
|
||||
className="text-orange-600 hover:text-orange-700 border-orange-300 hover:bg-orange-50"
|
||||
size="sm"
|
||||
>
|
||||
{isStatusUpdating ? (
|
||||
<Loader2 className="w-4 h-4 mr-1.5 animate-spin" />
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<Undo2 className="w-4 h-4 mr-1.5" />
|
||||
<Undo2 className="w-4 h-4 md:mr-2" />
|
||||
)}
|
||||
되돌리기
|
||||
<span className="hidden md:inline">되돌리기</span>
|
||||
</Button>
|
||||
)}
|
||||
<Button variant="outline" onClick={() => setIsWorkLogOpen(true)}>
|
||||
<FileText className="w-4 h-4 mr-1.5" />
|
||||
작업일지 보기
|
||||
<Button variant="outline" onClick={() => setIsWorkLogOpen(true)} size="sm">
|
||||
<FileText className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">작업일지 보기</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setIsInspectionOpen(true)}
|
||||
size="sm"
|
||||
>
|
||||
<ClipboardCheck className="w-4 h-4 mr-1.5" />
|
||||
중간검사성적서 보기
|
||||
<ClipboardCheck className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">중간검사성적서 보기</span>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
@@ -331,25 +336,25 @@ export function WorkOrderDetail({ orderId }: WorkOrderDetailProps) {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* 기본 정보 (기획서 4열 구성) */}
|
||||
<div className="bg-amber-50 border border-amber-200 rounded-lg p-6">
|
||||
<div className="bg-amber-50 border border-amber-200 rounded-lg p-4 md:p-6">
|
||||
<h3 className="font-semibold mb-4">기본 정보</h3>
|
||||
<div className="grid grid-cols-4 gap-x-6 gap-y-4">
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-x-4 md:gap-x-6 gap-y-4">
|
||||
{/* 1행: 작업번호 | 수주일 | 공정구분 | 로트번호 */}
|
||||
<div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm text-muted-foreground mb-1">작업번호</p>
|
||||
<p className="font-medium">{order.workOrderNo}</p>
|
||||
<p className="font-medium truncate">{order.workOrderNo}</p>
|
||||
</div>
|
||||
<div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm text-muted-foreground mb-1">수주일</p>
|
||||
<p className="font-medium">{order.salesOrderDate || '-'}</p>
|
||||
</div>
|
||||
<div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm text-muted-foreground mb-1">공정구분</p>
|
||||
<p className="font-medium">{order.processName}</p>
|
||||
</div>
|
||||
<div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm text-muted-foreground mb-1">로트번호</p>
|
||||
<p className="font-medium">{order.lotNo}</p>
|
||||
<p className="font-medium truncate">{order.lotNo}</p>
|
||||
</div>
|
||||
|
||||
{/* 2행: 수주처 | 현장명 | 수주 담당자 | 담당자 연락처 */}
|
||||
|
||||
@@ -390,14 +390,14 @@ export function InspectionDetail({ id }: InspectionDetailProps) {
|
||||
if (isEditMode || !inspection) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<>
|
||||
<Button variant="outline" size="sm" onClick={() => setRequestDocOpen(true)}>
|
||||
<FileText className="w-4 h-4 mr-1" />
|
||||
검사제품요청서 보기
|
||||
<FileText className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">검사제품요청서 보기</span>
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" onClick={() => setReportDocOpen(true)}>
|
||||
<PlayCircle className="w-4 h-4 mr-1" />
|
||||
제품검사하기
|
||||
<PlayCircle className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">제품검사하기</span>
|
||||
</Button>
|
||||
{inspection.status !== '완료' && (
|
||||
<Button
|
||||
@@ -405,11 +405,11 @@ export function InspectionDetail({ id }: InspectionDetailProps) {
|
||||
className="bg-green-600 hover:bg-green-700"
|
||||
onClick={() => setShowCompleteDialog(true)}
|
||||
>
|
||||
<CheckCircle2 className="w-4 h-4 mr-1" />
|
||||
검사 완료
|
||||
<CheckCircle2 className="w-4 h-4 md:mr-2" />
|
||||
<span className="hidden md:inline">검사 완료</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}, [isEditMode, inspection]);
|
||||
|
||||
|
||||
@@ -70,38 +70,40 @@ export function QuoteFooterBar({
|
||||
}: QuoteFooterBarProps) {
|
||||
return (
|
||||
<div className="sticky bottom-0 bg-gradient-to-r from-blue-50 to-indigo-50 border-t border-blue-200 shadow-lg">
|
||||
<div className="px-6 py-4 flex items-center justify-between">
|
||||
<div className="px-3 py-3 md:px-6 md:py-4 flex items-center justify-between">
|
||||
{/* 왼쪽: 뒤로가기 + 금액 표시 */}
|
||||
<div className="flex items-center gap-6">
|
||||
<div className="flex items-center gap-3 md:gap-6">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={onBack}
|
||||
className="gap-2"
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
목록으로
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
|
||||
<div>
|
||||
<p className="text-sm text-gray-600">예상 전체 견적금액</p>
|
||||
<p className="text-3xl font-bold text-blue-600">
|
||||
<p className="text-xs md:text-sm text-gray-600">예상 전체 견적금액</p>
|
||||
<p className="text-lg md:text-3xl font-bold text-blue-600">
|
||||
{totalAmount.toLocaleString()}
|
||||
<span className="text-lg font-normal text-gray-500 ml-1">원</span>
|
||||
<span className="text-sm md:text-lg font-normal text-gray-500 ml-1">원</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 오른쪽: 버튼들 */}
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex items-center gap-1 md:gap-3">
|
||||
{/* 견적서 보기 */}
|
||||
<Button
|
||||
onClick={onQuoteView}
|
||||
disabled={totalLocations === 0}
|
||||
variant="outline"
|
||||
className="gap-2 px-6"
|
||||
size="sm"
|
||||
className="md:size-default md:px-6"
|
||||
>
|
||||
<FileText className="h-4 w-4" />
|
||||
견적서 보기
|
||||
<FileText className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">견적서 보기</span>
|
||||
</Button>
|
||||
|
||||
{/* 거래명세서 보기 */}
|
||||
@@ -109,10 +111,11 @@ export function QuoteFooterBar({
|
||||
onClick={onTransactionView}
|
||||
disabled={totalLocations === 0}
|
||||
variant="outline"
|
||||
className="gap-2 px-6"
|
||||
size="sm"
|
||||
className="md:size-default md:px-6"
|
||||
>
|
||||
<ClipboardList className="h-4 w-4" />
|
||||
거래명세서 보기
|
||||
<ClipboardList className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">거래명세서 보기</span>
|
||||
</Button>
|
||||
|
||||
{/* 수식보기 - 개발환경(local/development)에서만 표시 */}
|
||||
@@ -121,10 +124,11 @@ export function QuoteFooterBar({
|
||||
onClick={onFormulaView}
|
||||
disabled={!hasBomResult}
|
||||
variant="outline"
|
||||
className="gap-2 px-6 border-purple-300 text-purple-600 hover:bg-purple-50"
|
||||
size="sm"
|
||||
className="border-purple-300 text-purple-600 hover:bg-purple-50 md:size-default md:px-6"
|
||||
>
|
||||
<Calculator className="h-4 w-4" />
|
||||
수식보기
|
||||
<Calculator className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수식보기</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -133,10 +137,11 @@ export function QuoteFooterBar({
|
||||
<Button
|
||||
onClick={onEdit}
|
||||
variant="outline"
|
||||
className="gap-2 px-6"
|
||||
size="sm"
|
||||
className="md:size-default md:px-6"
|
||||
>
|
||||
<Pencil className="h-4 w-4" />
|
||||
수정
|
||||
<Pencil className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수정</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -146,10 +151,11 @@ export function QuoteFooterBar({
|
||||
onClick={onDiscount}
|
||||
disabled={isViewMode}
|
||||
variant="outline"
|
||||
className="gap-2 px-6 border-orange-300 text-orange-600 hover:bg-orange-50"
|
||||
size="sm"
|
||||
className="border-orange-300 text-orange-600 hover:bg-orange-50 md:size-default md:px-6"
|
||||
>
|
||||
<Percent className="h-4 w-4" />
|
||||
할인하기
|
||||
<Percent className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">할인하기</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -158,14 +164,15 @@ export function QuoteFooterBar({
|
||||
<Button
|
||||
onClick={onSave}
|
||||
disabled={isSaving}
|
||||
className="bg-slate-500 hover:bg-slate-600 text-white gap-2 px-6"
|
||||
size="sm"
|
||||
className="bg-slate-500 hover:bg-slate-600 text-white md:size-default md:px-6"
|
||||
>
|
||||
{isSaving ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<Save className="h-4 w-4" />
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
)}
|
||||
저장
|
||||
<span className="hidden md:inline">저장</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -174,14 +181,15 @@ export function QuoteFooterBar({
|
||||
<Button
|
||||
onClick={onFinalize}
|
||||
disabled={isSaving || totalAmount === 0}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white gap-2 px-6"
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white md:size-default md:px-6"
|
||||
>
|
||||
{isSaving ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<Check className="h-4 w-4" />
|
||||
<Check className="h-4 w-4 md:mr-2" />
|
||||
)}
|
||||
최종확정
|
||||
<span className="hidden md:inline">최종확정</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -189,10 +197,11 @@ export function QuoteFooterBar({
|
||||
{status === "final" && onOrderRegister && (
|
||||
<Button
|
||||
onClick={onOrderRegister}
|
||||
className="bg-green-600 hover:bg-green-700 text-white gap-2 px-6"
|
||||
size="sm"
|
||||
className="bg-green-600 hover:bg-green-700 text-white md:size-default md:px-6"
|
||||
>
|
||||
<ClipboardList className="h-4 w-4" />
|
||||
수주등록
|
||||
<ClipboardList className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">수주등록</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -625,35 +625,32 @@ export function PermissionDetailClient({ permissionId, isNew = false, mode = 'vi
|
||||
</div>
|
||||
|
||||
{/* 하단 액션 버튼 (sticky) */}
|
||||
<div className={`fixed bottom-6 ${sidebarCollapsed ? 'left-[156px]' : 'left-[316px]'} right-[48px] px-6 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack}>
|
||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||
목록으로
|
||||
<div className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}>
|
||||
<Button variant="outline" onClick={handleBack} size="sm" className="md:size-default">
|
||||
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">목록으로</span>
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1 md:gap-2">
|
||||
{isNew ? (
|
||||
<Button onClick={handleSaveNew} disabled={isSaving}>
|
||||
<Button onClick={handleSaveNew} disabled={isSaving} size="sm" className="md:size-default">
|
||||
{isSaving ? (
|
||||
<>
|
||||
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
||||
저장 중...
|
||||
</>
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
등록
|
||||
<Plus className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">등록</span>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleUpdateRole} disabled={isSaving}>
|
||||
<Button variant="outline" onClick={handleUpdateRole} disabled={isSaving} size="sm" className="md:size-default">
|
||||
{isSaving ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
정보 저장
|
||||
<Save className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">정보 저장</span>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
@@ -662,17 +659,20 @@ export function PermissionDetailClient({ permissionId, isNew = false, mode = 'vi
|
||||
reloadPermissions();
|
||||
toast.success('권한 정보가 저장되었습니다.');
|
||||
}}
|
||||
size="sm"
|
||||
className="md:size-default"
|
||||
>
|
||||
<Shield className="h-4 w-4 mr-2" />
|
||||
권한 정보 저장
|
||||
<Shield className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">권한 정보 저장</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={handleDelete}
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground"
|
||||
size="sm"
|
||||
className="text-destructive hover:bg-destructive hover:text-destructive-foreground md:size-default"
|
||||
>
|
||||
<Trash2 className="h-4 w-4 mr-2" />
|
||||
삭제
|
||||
<Trash2 className="h-4 w-4 md:mr-2" />
|
||||
<span className="hidden md:inline">삭제</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -101,8 +101,8 @@ export default function AuthenticatedLayout({ children }: AuthenticatedLayoutPro
|
||||
const router = useRouter();
|
||||
const pathname = usePathname(); // 현재 경로 추적
|
||||
|
||||
// 폰트 크기 조절 (12~18px, 기본 16px)
|
||||
const FONT_SIZES = [12, 13, 14, 15, 16] as const;
|
||||
// 폰트 크기 조절 (12~20px, 기본 16px)
|
||||
const FONT_SIZES = [12, 13, 14, 15, 16, 17, 18, 19, 20] as const;
|
||||
const [fontSize, setFontSize] = useState(16);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -110,7 +110,7 @@ export default function AuthenticatedLayout({ children }: AuthenticatedLayoutPro
|
||||
const saved = localStorage.getItem('sam-font-size');
|
||||
if (saved) {
|
||||
const size = parseInt(saved, 10);
|
||||
if (size >= 12 && size <= 18) {
|
||||
if (size >= 12 && size <= 20) {
|
||||
setFontSize(size);
|
||||
document.documentElement.style.setProperty('--font-size', `${size}px`);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ export default function AuthenticatedLayout({ children }: AuthenticatedLayoutPro
|
||||
}, []);
|
||||
|
||||
const handleFontSizeChange = useCallback((size: number) => {
|
||||
const clamped = Math.max(12, Math.min(18, size));
|
||||
const clamped = Math.max(12, Math.min(20, size));
|
||||
setFontSize(clamped);
|
||||
document.documentElement.style.setProperty('--font-size', `${clamped}px`);
|
||||
localStorage.setItem('sam-font-size', String(clamped));
|
||||
@@ -929,6 +929,38 @@ export default function AuthenticatedLayout({ children }: AuthenticatedLayoutPro
|
||||
{/* 구분선 */}
|
||||
<div className="my-2 border-t border-border" />
|
||||
|
||||
{/* 글자 크기 조절 */}
|
||||
<div className="px-2 py-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<Type className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
|
||||
<span className="text-xs font-medium text-muted-foreground">글자 크기</span>
|
||||
<div className="flex items-center gap-1 ml-auto">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize - 1); }}
|
||||
disabled={fontSize <= 12}
|
||||
>
|
||||
<Minus className="h-3 w-3" />
|
||||
</Button>
|
||||
<span className="text-sm font-semibold text-foreground w-10 text-center">{fontSize}px</span>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize + 1); }}
|
||||
disabled={fontSize >= 20}
|
||||
>
|
||||
<Plus className="h-3 w-3" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 구분선 */}
|
||||
<div className="my-2 border-t border-border" />
|
||||
|
||||
{/* 로그아웃 */}
|
||||
<DropdownMenuItem onClick={handleLogout} className="rounded-lg text-red-600 hover:text-red-700 hover:bg-red-50">
|
||||
<LogOut className="mr-2 h-4 w-4" />
|
||||
@@ -1180,46 +1212,30 @@ export default function AuthenticatedLayout({ children }: AuthenticatedLayoutPro
|
||||
|
||||
{/* 글자 크기 조절 */}
|
||||
<div className="px-2 py-1">
|
||||
<div className="flex items-center gap-1 text-sm text-muted-foreground mb-1.5">
|
||||
<Type className="h-3.5 w-3.5" />
|
||||
<span className="text-xs font-medium">글자 크기</span>
|
||||
<span className="ml-auto text-xs font-semibold text-foreground">{fontSize}px</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize - 1); }}
|
||||
disabled={fontSize <= 12}
|
||||
>
|
||||
<Minus className="h-3 w-3" />
|
||||
</Button>
|
||||
<div className="flex items-center gap-0.5 flex-1 justify-center">
|
||||
{FONT_SIZES.map((size) => (
|
||||
<button
|
||||
key={size}
|
||||
type="button"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(size); }}
|
||||
className={`h-6 min-w-[28px] rounded text-xs font-medium transition-colors ${
|
||||
fontSize === size
|
||||
? 'bg-primary text-primary-foreground'
|
||||
: 'hover:bg-muted text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{size}
|
||||
</button>
|
||||
))}
|
||||
<div className="flex items-center gap-2">
|
||||
<Type className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
|
||||
<span className="text-xs font-medium text-muted-foreground">글자 크기</span>
|
||||
<div className="flex items-center gap-1 ml-auto">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize - 1); }}
|
||||
disabled={fontSize <= 12}
|
||||
>
|
||||
<Minus className="h-3 w-3" />
|
||||
</Button>
|
||||
<span className="text-sm font-semibold text-foreground w-10 text-center">{fontSize}px</span>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize + 1); }}
|
||||
disabled={fontSize >= 20}
|
||||
>
|
||||
<Plus className="h-3 w-3" />
|
||||
</Button>
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 shrink-0"
|
||||
onClick={(e) => { e.preventDefault(); handleFontSizeChange(fontSize + 1); }}
|
||||
disabled={fontSize >= 18}
|
||||
>
|
||||
<Plus className="h-3 w-3" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user