엑셀 다운로드, 업로드, 사진촬영(바코드 스캔기능) 추가
This commit is contained in:
@@ -267,6 +267,9 @@ export const ButtonConfigPanel: React.FC<ButtonConfigPanelProps> = ({
|
||||
<SelectItem value="modal">모달 열기</SelectItem>
|
||||
<SelectItem value="control">제어 흐름</SelectItem>
|
||||
<SelectItem value="view_table_history">테이블 이력 보기</SelectItem>
|
||||
<SelectItem value="excel_download">엑셀 다운로드</SelectItem>
|
||||
<SelectItem value="excel_upload">엑셀 업로드</SelectItem>
|
||||
<SelectItem value="barcode_scan">바코드 스캔</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
@@ -709,6 +712,132 @@ export const ButtonConfigPanel: React.FC<ButtonConfigPanelProps> = ({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 엑셀 다운로드 액션 설정 */}
|
||||
{(component.componentConfig?.action?.type || "save") === "excel_download" && (
|
||||
<div className="mt-4 space-y-4 rounded-lg border bg-muted/50 p-4">
|
||||
<h4 className="text-sm font-medium text-foreground">엑셀 다운로드 설정</h4>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="excel-filename">파일명 (선택사항)</Label>
|
||||
<Input
|
||||
id="excel-filename"
|
||||
placeholder="예: 데이터목록 (기본값: export)"
|
||||
value={config.action?.excelFileName || ""}
|
||||
onChange={(e) => onUpdateProperty("componentConfig.action.excelFileName", e.target.value)}
|
||||
className="h-8 text-xs"
|
||||
/>
|
||||
<p className="mt-1 text-xs text-muted-foreground">확장자(.xlsx)는 자동으로 추가됩니다</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="excel-sheetname">시트명 (선택사항)</Label>
|
||||
<Input
|
||||
id="excel-sheetname"
|
||||
placeholder="예: Sheet1 (기본값)"
|
||||
value={config.action?.excelSheetName || ""}
|
||||
onChange={(e) => onUpdateProperty("componentConfig.action.excelSheetName", e.target.value)}
|
||||
className="h-8 text-xs"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<Label htmlFor="excel-include-headers">헤더 포함</Label>
|
||||
<Switch
|
||||
id="excel-include-headers"
|
||||
checked={config.action?.excelIncludeHeaders !== false}
|
||||
onCheckedChange={(checked) => onUpdateProperty("componentConfig.action.excelIncludeHeaders", checked)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 엑셀 업로드 액션 설정 */}
|
||||
{(component.componentConfig?.action?.type || "save") === "excel_upload" && (
|
||||
<div className="mt-4 space-y-4 rounded-lg border bg-muted/50 p-4">
|
||||
<h4 className="text-sm font-medium text-foreground">📤 엑셀 업로드 설정</h4>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="excel-upload-mode">업로드 모드</Label>
|
||||
<Select
|
||||
value={config.action?.excelUploadMode || "insert"}
|
||||
onValueChange={(value) => onUpdateProperty("componentConfig.action.excelUploadMode", value)}
|
||||
>
|
||||
<SelectTrigger className="h-8 text-xs">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="insert">신규 삽입 (INSERT)</SelectItem>
|
||||
<SelectItem value="update">기존 수정 (UPDATE)</SelectItem>
|
||||
<SelectItem value="upsert">삽입/수정 (UPSERT)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{(config.action?.excelUploadMode === "update" || config.action?.excelUploadMode === "upsert") && (
|
||||
<div>
|
||||
<Label htmlFor="excel-key-column">
|
||||
키 컬럼명 <span className="text-destructive">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="excel-key-column"
|
||||
placeholder="예: id, code"
|
||||
value={config.action?.excelKeyColumn || ""}
|
||||
onChange={(e) => onUpdateProperty("componentConfig.action.excelKeyColumn", e.target.value)}
|
||||
className="h-8 text-xs"
|
||||
/>
|
||||
<p className="mt-1 text-xs text-muted-foreground">UPDATE/UPSERT 시 기준이 되는 컬럼명</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 바코드 스캔 액션 설정 */}
|
||||
{(component.componentConfig?.action?.type || "save") === "barcode_scan" && (
|
||||
<div className="mt-4 space-y-4 rounded-lg border bg-muted/50 p-4">
|
||||
<h4 className="text-sm font-medium text-foreground">📷 바코드 스캔 설정</h4>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="barcode-target-field">
|
||||
대상 필드명 <span className="text-destructive">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="barcode-target-field"
|
||||
placeholder="예: barcode, qr_code"
|
||||
value={config.action?.barcodeTargetField || ""}
|
||||
onChange={(e) => onUpdateProperty("componentConfig.action.barcodeTargetField", e.target.value)}
|
||||
className="h-8 text-xs"
|
||||
/>
|
||||
<p className="mt-1 text-xs text-muted-foreground">스캔 결과가 입력될 폼 필드명</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="barcode-format">바코드 형식</Label>
|
||||
<Select
|
||||
value={config.action?.barcodeFormat || "all"}
|
||||
onValueChange={(value) => onUpdateProperty("componentConfig.action.barcodeFormat", value)}
|
||||
>
|
||||
<SelectTrigger className="h-8 text-xs">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="all">모든 형식</SelectItem>
|
||||
<SelectItem value="1d">1D 바코드만 (CODE128, EAN13 등)</SelectItem>
|
||||
<SelectItem value="2d">2D 바코드만 (QR코드, DataMatrix 등)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<Label htmlFor="barcode-auto-submit">스캔 후 자동 저장</Label>
|
||||
<Switch
|
||||
id="barcode-auto-submit"
|
||||
checked={config.action?.barcodeAutoSubmit === true}
|
||||
onCheckedChange={(checked) => onUpdateProperty("componentConfig.action.barcodeAutoSubmit", checked)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 제어 기능 섹션 */}
|
||||
<div className="mt-8 border-t border-border pt-6">
|
||||
<ImprovedButtonControlConfigPanel component={component} onUpdateProperty={onUpdateProperty} />
|
||||
|
||||
Reference in New Issue
Block a user