feat(WEB): Vercel 배포 대응 및 타입 안정성 개선
- puppeteer → puppeteer-core + @sparticuz/chromium 전환 (Vercel 서버리스 호환) - PDF 생성 API 로컬/Vercel 환경 분기 처리 - next.config.ts: ignoreBuildErrors false로 전환 - WorkOrder items에 orderNodeId/orderNodeName 필드 추가 - 결재선 데이터에 name/dept 필드 추가 - OrderSalesDetailView 타입 캐스팅 안전하게 수정 - vercel.json 설정 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -210,9 +210,9 @@ const createQmsMockWorkOrder = (subType?: string): WorkOrder => ({
|
||||
shutterCount: 5,
|
||||
department: '생산부',
|
||||
items: [
|
||||
{ id: '1', no: 1, status: 'completed', productName: '와이어 스크린', floorCode: '1층/FSS-01', specification: '3000×2500', quantity: 2, unit: 'EA' },
|
||||
{ id: '2', no: 2, status: 'in_progress', productName: '메쉬 스크린', floorCode: '2층/FSS-03', specification: '3000×2500', quantity: 3, unit: 'EA' },
|
||||
{ id: '3', no: 3, status: 'waiting', productName: '광폭 와이어', floorCode: '3층/FSS-05', specification: '12000×4500', quantity: 1, unit: 'EA' },
|
||||
{ id: '1', no: 1, status: 'completed', productName: '와이어 스크린', floorCode: '1층/FSS-01', specification: '3000×2500', quantity: 2, unit: 'EA', orderNodeId: null, orderNodeName: '' },
|
||||
{ id: '2', no: 2, status: 'in_progress', productName: '메쉬 스크린', floorCode: '2층/FSS-03', specification: '3000×2500', quantity: 3, unit: 'EA', orderNodeId: null, orderNodeName: '' },
|
||||
{ id: '3', no: 3, status: 'waiting', productName: '광폭 와이어', floorCode: '3층/FSS-05', specification: '12000×4500', quantity: 1, unit: 'EA', orderNodeId: null, orderNodeName: '' },
|
||||
],
|
||||
currentStep: 2,
|
||||
issues: [],
|
||||
@@ -314,7 +314,7 @@ export const InspectionModalV2 = ({
|
||||
// 저장된 측정값을 initialValues로 변환
|
||||
const docData = result.resolveData?.document?.data;
|
||||
if (docData && docData.length > 0) {
|
||||
const values = parseSavedDataToInitialValues(tmpl, docData);
|
||||
const values = parseSavedDataToInitialValues(tmpl, docData.map((d: { field_key: string; field_value?: string | null }) => ({ field_key: d.field_key, field_value: d.field_value ?? null })));
|
||||
setImportInitialValues(values);
|
||||
} else {
|
||||
setImportInitialValues(undefined);
|
||||
|
||||
@@ -13,6 +13,7 @@ export const MOCK_WORK_ORDER: WorkOrder = {
|
||||
projectName: '강남 아파트 단지',
|
||||
assignees: ['김작업', '이생산'],
|
||||
quantity: 5,
|
||||
shutterCount: 3,
|
||||
dueDate: '2024-10-05',
|
||||
priority: 1,
|
||||
status: 'inProgress',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import puppeteer from 'puppeteer';
|
||||
import puppeteer from 'puppeteer-core';
|
||||
import chromium from '@sparticuz/chromium';
|
||||
|
||||
/**
|
||||
* PDF 생성 API
|
||||
@@ -35,17 +36,20 @@ export async function POST(request: NextRequest) {
|
||||
);
|
||||
}
|
||||
|
||||
// Puppeteer 브라우저 실행 (Docker Alpine에서는 시스템 Chromium 사용)
|
||||
// 로컬 개발 vs Vercel 환경 분기
|
||||
const isVercel = process.env.VERCEL === '1';
|
||||
const browser = await puppeteer.launch({
|
||||
headless: true,
|
||||
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || undefined,
|
||||
args: [
|
||||
args: isVercel ? chromium.args : [
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-gpu',
|
||||
'--disable-software-rasterizer',
|
||||
],
|
||||
executablePath: isVercel
|
||||
? await chromium.executablePath()
|
||||
: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/google-chrome-stable',
|
||||
headless: true,
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
|
||||
Reference in New Issue
Block a user