260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import {useEffect, useMemo, useState} from 'react'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { KriDialog } from '@/components/common/KriDialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import {Trash2, Plus, Download} from 'lucide-react'
|
||||
@@ -77,6 +71,7 @@ const ResultCodeDialog = ({
|
||||
resultCdTy: resultCodeType,
|
||||
resultCd: lastCode + 1,
|
||||
resultCdLbl: '',
|
||||
isDefault: false,
|
||||
}
|
||||
])
|
||||
}
|
||||
@@ -220,23 +215,46 @@ const ResultCodeDialog = ({
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={handleClose}>
|
||||
<KriDialog
|
||||
open={open ?? false}
|
||||
onOpenChange={(nextOpen) => {
|
||||
if (!nextOpen) handleClose()
|
||||
}}
|
||||
title={<div className="text-2xl font-bold">결과 코드 설정</div>}
|
||||
contentClassName={[
|
||||
'overflow-hidden',
|
||||
'transition-all duration-200',
|
||||
importMode ? 'sm:max-w-6xl' : 'sm:max-w-3xl',
|
||||
'w-[calc(100vw-2rem)]',
|
||||
'max-h-[85vh]',
|
||||
'gap-2',
|
||||
].join(' ')}
|
||||
bodyClassName="min-h-0 p-0"
|
||||
footerClassName="px-6 py-4 border-t bg-white"
|
||||
footer={
|
||||
importMode ? (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleImportCancel}>
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleImportApply} disabled={!importProject} className="gap-2">
|
||||
<Download className="w-4 h-4" />
|
||||
가져오기 적용
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleClose}>
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleSave}>
|
||||
저장
|
||||
</Button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
>
|
||||
{/* importMode일 때 더 넓게(그리고 애니메이션으로 부드럽게) */}
|
||||
<DialogContent
|
||||
className={[
|
||||
'p-0 overflow-hidden',
|
||||
'transition-all duration-200',
|
||||
importMode ? 'sm:max-w-6xl' : 'sm:max-w-3xl',
|
||||
'w-[calc(100vw-2rem)]',
|
||||
'max-h-[85vh]',
|
||||
'gap-2',
|
||||
].join(' ')}
|
||||
>
|
||||
<DialogHeader className="px-6 pt-6 pb-4 border-b">
|
||||
<DialogTitle className="flex items-center justify-between gap-3">
|
||||
<span>결과 코드 설정</span>
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
{/* 상단 버튼 영역 */}
|
||||
<div className="px-6 pt-1 pb-3 border-b bg-white flex justify-end">
|
||||
@@ -272,7 +290,7 @@ const ResultCodeDialog = ({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="px-6 pt-4 flex flex-wrap items-center gap-2">
|
||||
<div className="px-6 py-2 flex flex-wrap items-center gap-1">
|
||||
{RESULT_CODE_TYPE_OPTIONS
|
||||
.filter((opt) => opt.value !== ResultCodeType.SURVEY)
|
||||
.map((opt) => (
|
||||
@@ -315,7 +333,9 @@ const ResultCodeDialog = ({
|
||||
<tbody className="divide-y">
|
||||
{resultCodeArray
|
||||
.filter((rc) => rc.resultCdTy === resultCodeType)
|
||||
.map((code, index) => (
|
||||
.map((code, index) => {
|
||||
const isLocked = code.isDefault;
|
||||
return (
|
||||
<tr key={index} className="hover:bg-gray-50">
|
||||
<td className="px-4 py-2 align-middle">
|
||||
<Input
|
||||
@@ -323,7 +343,7 @@ const ResultCodeDialog = ({
|
||||
onChange={(e) => handleCodeChange(code.resultCdUUID, 'resultCd', e.target.value)}
|
||||
onBlur={(e) => checkDuplicate(code.resultCdUUID, Number(e.target.value), e.target)}
|
||||
className="h-9"
|
||||
disabled={importMode}
|
||||
disabled={importMode || isLocked}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-4 py-2 align-middle">
|
||||
@@ -331,15 +351,15 @@ const ResultCodeDialog = ({
|
||||
value={code.resultCdLbl}
|
||||
onChange={(e) => handleCodeChange(code.resultCdUUID, 'resultCdLbl', e.target.value)}
|
||||
className="h-9"
|
||||
disabled={importMode}
|
||||
disabled={importMode || isLocked}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-2 py-2 align-middle">
|
||||
{!importMode && (
|
||||
{!importMode && !isLocked && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => handleDeleteCode(index)}
|
||||
onClick={() => handleDeleteCode(code.resultCd)}
|
||||
aria-label="delete"
|
||||
>
|
||||
<Trash2 className="w-4 h-4 text-red-600" />
|
||||
@@ -347,7 +367,8 @@ const ResultCodeDialog = ({
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -398,30 +419,7 @@ const ResultCodeDialog = ({
|
||||
)}
|
||||
</div>
|
||||
|
||||
<DialogFooter className="px-6 py-4 border-t bg-white">
|
||||
{importMode ? (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleImportCancel}>
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleImportApply} disabled={!importProject} className="gap-2">
|
||||
<Download className="w-4 h-4" />
|
||||
가져오기 적용
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Button variant="outline" onClick={handleClose}>
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleSave}>
|
||||
저장
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</KriDialog>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user