260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { Plus, X } 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 { Input } from '@/components/ui/input'
|
||||
import {
|
||||
@@ -107,7 +107,7 @@ const ListBatchEditDialog = ({
|
||||
const handleConfirm = async () => {
|
||||
const normalized = rows.filter((row) => row.headerId > 0 && row.value.trim().length > 0)
|
||||
if (normalized.length === 0) {
|
||||
alert('일괄 수정할 항목을 입력해 주세요.')
|
||||
alert('일괄 수정할 항목을 입력해주세요.')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -121,87 +121,86 @@ const ListBatchEditDialog = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={resolvedOpen} onOpenChange={handleOpenChange}>
|
||||
<DialogContent className="sm:max-w-[900px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-2xl font-bold">일괄 수정</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="rounded-md border px-4 py-3 text-sm">
|
||||
<p className="font-semibold mb-1">적용된 필터</p>
|
||||
<p className="text-muted-foreground">
|
||||
{filterSummary.length > 0 ? filterSummary : '적용된 필터가 없습니다.'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="rounded-md border overflow-hidden">
|
||||
<div className="h-11 px-4 border-b bg-muted/40 grid grid-cols-[1fr_2fr_64px] items-center text-sm font-semibold">
|
||||
<span>헤더</span>
|
||||
<span>수정 값</span>
|
||||
<span />
|
||||
</div>
|
||||
|
||||
<div className="max-h-72 overflow-auto">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.id}
|
||||
className="h-12 px-4 border-b last:border-b-0 grid grid-cols-[1fr_2fr_64px] items-center gap-2"
|
||||
>
|
||||
<Select
|
||||
value={String(row.headerId)}
|
||||
onValueChange={(v) => handleChangeHeader(row.id, Number(v))}
|
||||
>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="헤더 선택" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{headerOptions.map((option) => (
|
||||
<SelectItem key={option.id} value={String(option.id)}>
|
||||
{option.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<Input
|
||||
value={row.value}
|
||||
onChange={(e) => handleChangeValue(row.id, e.target.value)}
|
||||
placeholder="수정할 값을 입력해 주세요"
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
onClick={() => handleRemoveRow(row.id)}
|
||||
aria-label="행 제거"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="button" variant="outline" onClick={handleAddRow} className="gap-2">
|
||||
<Plus className="w-4 h-4" />
|
||||
행 추가
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<DialogFooter>
|
||||
<KriDialog
|
||||
open={resolvedOpen}
|
||||
onOpenChange={handleOpenChange}
|
||||
title={<span className="text-2xl font-bold">일괄 수정</span>}
|
||||
contentClassName="sm:max-w-[900px]"
|
||||
bodyClassName="space-y-4"
|
||||
footer={
|
||||
<>
|
||||
<Button type="button" variant="outline" onClick={() => handleOpenChange(false)} disabled={submitting}>
|
||||
취소
|
||||
</Button>
|
||||
<Button type="button" onClick={handleConfirm} disabled={submitting}>
|
||||
적용
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<div className="rounded-md border px-4 py-3 text-sm">
|
||||
<p className="font-semibold mb-1">적용된 필터</p>
|
||||
<p className="text-muted-foreground">
|
||||
{filterSummary.length > 0 ? filterSummary : '적용된 필터가 없습니다.'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="rounded-md border overflow-hidden">
|
||||
<div className="h-11 px-4 border-b bg-muted grid grid-cols-[1fr_2fr_64px] items-center text-sm font-semibold">
|
||||
<span>헤더</span>
|
||||
<span>수정 값</span>
|
||||
<span />
|
||||
</div>
|
||||
|
||||
<div className="max-h-72 overflow-auto">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.id}
|
||||
className="h-12 px-4 border-b last:border-b-0 grid grid-cols-[1fr_2fr_64px] items-center gap-2"
|
||||
>
|
||||
<Select
|
||||
value={String(row.headerId)}
|
||||
onValueChange={(v) => handleChangeHeader(row.id, Number(v))}
|
||||
>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="헤더 선택" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{headerOptions.map((option) => (
|
||||
<SelectItem key={option.id} value={String(option.id)}>
|
||||
{option.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<Input
|
||||
value={row.value}
|
||||
onChange={(e) => handleChangeValue(row.id, e.target.value)}
|
||||
placeholder="수정할 값을 입력해주세요"
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
onClick={() => handleRemoveRow(row.id)}
|
||||
aria-label="행 제거"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="button" variant="outline" onClick={handleAddRow} className="gap-2">
|
||||
<Plus className="w-4 h-4" />
|
||||
행 추가
|
||||
</Button>
|
||||
</KriDialog>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user