feat(WEB): 입력 컴포넌트 공통화 및 UI 개선
- 숫자/통화/전화번호/사업자번호 등 특수 입력 컴포넌트 추가 - MobileCard 컴포넌트 통합 (ListMobileCard 제거) - IntegratedListTemplateV2 페이지네이션 버그 수정 (NaN 이슈) - IntegratedDetailTemplate 타이틀 중복 수정 - 문서 시스템 컴포넌트 추가 - 헤더 벨 아이콘 포커스 스타일 개선 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
113
src/components/document-system/presets/index.ts
Normal file
113
src/components/document-system/presets/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import { PresetConfig, PresetType } from '../types';
|
||||
|
||||
/**
|
||||
* 문서 프리셋 정의
|
||||
* - inspection: QMS 검사 문서용 (인쇄/다운로드)
|
||||
* - construction: 건설 프로젝트용 (수정/삭제/인쇄)
|
||||
* - approval: 결재 문서용 (수정/상신/인쇄)
|
||||
* - readonly: 조회 전용 (인쇄만)
|
||||
*/
|
||||
export const DOCUMENT_PRESETS: Record<PresetType, PresetConfig> = {
|
||||
// QMS 검사 문서용
|
||||
inspection: {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: true,
|
||||
},
|
||||
actions: ['print', 'download'],
|
||||
},
|
||||
|
||||
// 건설 프로젝트용 (CRUD)
|
||||
construction: {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: false,
|
||||
},
|
||||
actions: ['edit', 'delete', 'print'],
|
||||
},
|
||||
|
||||
// 결재 문서용 (기본)
|
||||
approval: {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: false,
|
||||
},
|
||||
actions: ['edit', 'submit', 'print'],
|
||||
},
|
||||
|
||||
// 결재 문서용 - 기안함 모드 (임시저장 상태: 복제, 상신, 인쇄)
|
||||
'approval-draft': {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: false,
|
||||
},
|
||||
actions: ['copy', 'submit', 'print'],
|
||||
},
|
||||
|
||||
// 결재 문서용 - 결재함 모드 (수정, 반려, 승인, 인쇄)
|
||||
'approval-inbox': {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: false,
|
||||
},
|
||||
actions: ['edit', 'reject', 'approve', 'print'],
|
||||
},
|
||||
|
||||
// 조회 전용
|
||||
readonly: {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: false,
|
||||
},
|
||||
actions: ['print'],
|
||||
},
|
||||
|
||||
// 견적서/문서 전송용 (PDF, 이메일, 팩스, 카카오톡, 인쇄)
|
||||
quote: {
|
||||
features: {
|
||||
zoom: true,
|
||||
drag: true,
|
||||
print: true,
|
||||
download: true,
|
||||
},
|
||||
actions: ['pdf', 'email', 'fax', 'kakao', 'print'],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 프리셋 가져오기
|
||||
*/
|
||||
export function getPreset(preset: PresetType): PresetConfig {
|
||||
return DOCUMENT_PRESETS[preset] || DOCUMENT_PRESETS.readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
* 프리셋과 커스텀 설정 병합
|
||||
*/
|
||||
export function mergeWithPreset(
|
||||
preset: PresetType | undefined,
|
||||
customFeatures?: Partial<PresetConfig['features']>,
|
||||
customActions?: PresetConfig['actions']
|
||||
): PresetConfig {
|
||||
const base = preset ? getPreset(preset) : DOCUMENT_PRESETS.readonly;
|
||||
|
||||
return {
|
||||
features: {
|
||||
...base.features,
|
||||
...customFeatures,
|
||||
},
|
||||
actions: customActions || base.actions,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user