260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
} from '@dnd-kit/sortable'
|
||||
import { CSS } from '@dnd-kit/utilities'
|
||||
import { GripVertical, Plus, Trash2 } from 'lucide-react'
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
||||
import { KriDialog } from '@/components/common/KriDialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Checkbox } from '@/components/ui/checkbox'
|
||||
import { Input } from '@/components/ui/input'
|
||||
@@ -35,6 +35,7 @@ export type ListHeaderManageDialogProps = {
|
||||
dialogId?: DialogId
|
||||
open?: boolean
|
||||
onOpenChange?: (open: boolean) => void
|
||||
prjctIdx: number
|
||||
rows: listHeader[]
|
||||
onConfirm: (rows: listHeader[]) => void | Promise<void>
|
||||
}
|
||||
@@ -76,7 +77,7 @@ const ListHeaderRow = ({ row, activeId, onHeaderNameChange, onHeaderTypeChange,
|
||||
style={style}
|
||||
className={cn(
|
||||
'h-12 px-4 border-b last:border-b-0 grid grid-cols-[56px_1fr_150px_96px_96px_110px_110px_88px] items-center gap-2',
|
||||
(activeId === row.listHderId || isDragging) && 'bg-muted/40',
|
||||
(activeId === row.listHderId || isDragging) && 'bg-muted',
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
@@ -173,6 +174,7 @@ const ListHeaderManageDialog = ({
|
||||
dialogId = 'listHeaderManageDialog',
|
||||
open,
|
||||
onOpenChange,
|
||||
prjctIdx,
|
||||
rows,
|
||||
onConfirm,
|
||||
}: ListHeaderManageDialogProps) => {
|
||||
@@ -275,6 +277,7 @@ const ListHeaderManageDialog = ({
|
||||
const newIndex = prev.filter((row) => row.listHderNm.startsWith('신규 헤더')).length + 1
|
||||
|
||||
const nextRow: listHeader = {
|
||||
prjctIdx,
|
||||
listHderId: nextId,
|
||||
listHderOrder: prev.length + 1,
|
||||
listHderGrad: ListHeaderGrade.COMMON,
|
||||
@@ -295,6 +298,7 @@ const ListHeaderManageDialog = ({
|
||||
try {
|
||||
const orderedRows = localRows.map((row, index) => ({
|
||||
...row,
|
||||
prjctIdx: row.prjctIdx ?? prjctIdx,
|
||||
listHderOrder: index + 1,
|
||||
}))
|
||||
await onConfirm(orderedRows)
|
||||
@@ -305,13 +309,24 @@ const ListHeaderManageDialog = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={resolvedOpen} onOpenChange={handleOpenChange}>
|
||||
<DialogContent className="sm:max-w-[1200px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-2xl font-bold">리스트 헤더 관리</DialogTitle>
|
||||
</DialogHeader>
|
||||
<KriDialog
|
||||
open={resolvedOpen}
|
||||
onOpenChange={handleOpenChange}
|
||||
title={<span className="text-2xl font-bold">리스트 헤더 관리</span>}
|
||||
contentClassName="sm:max-w-[1200px]"
|
||||
footer={
|
||||
<>
|
||||
<Button type="button" variant="outline" onClick={() => handleOpenChange(false)} disabled={submitting}>
|
||||
취소
|
||||
</Button>
|
||||
<Button type="button" onClick={handleConfirm} disabled={submitting}>
|
||||
저장
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<div className="flex justify-end mb-2">
|
||||
<Button type="button" className="gap-2 bg-blue" onClick={handleAddHeader} disabled={submitting}>
|
||||
<Plus className="w-4 h-4" />
|
||||
헤더 추가
|
||||
@@ -319,7 +334,7 @@ const ListHeaderManageDialog = ({
|
||||
</div>
|
||||
|
||||
<div className="rounded-md border overflow-hidden">
|
||||
<div className="h-11 px-4 border-b bg-muted/40 grid grid-cols-[56px_1fr_150px_96px_96px_110px_110px_88px] items-center gap-2 text-sm font-semibold">
|
||||
<div className="h-11 px-4 border-b bg-muted grid grid-cols-[56px_1fr_150px_96px_96px_110px_110px_88px] items-center gap-2 text-sm font-semibold">
|
||||
<span>순서</span>
|
||||
<span>헤더명</span>
|
||||
<span>헤더 타입</span>
|
||||
@@ -355,16 +370,7 @@ const ListHeaderManageDialog = ({
|
||||
</DndContext>
|
||||
</div>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => handleOpenChange(false)} disabled={submitting}>
|
||||
취소
|
||||
</Button>
|
||||
<Button type="button" onClick={handleConfirm} disabled={submitting}>
|
||||
저장
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</KriDialog>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user