feat: [공정관리] 품목 전체 삭제 버튼 추가 (등록/수정/상세 화면)

This commit is contained in:
김보곤
2026-03-21 12:58:03 +09:00
parent 6f41e0ee50
commit 480ff620ca
2 changed files with 43 additions and 0 deletions

View File

@@ -142,6 +142,14 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
);
}, []);
// 품목 전체 삭제
const handleRemoveAllItems = useCallback(() => {
if (!confirm(`등록된 품목 ${itemCount}개를 모두 삭제하시겠습니까?`)) return;
setClassificationRules((prev) =>
prev.filter((rule) => rule.registrationType !== 'individual')
);
}, [itemCount]);
// 부서 목록 + 문서양식 목록 로드
useEffect(() => {
const loadInitialData = async () => {
@@ -598,6 +606,18 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
>
</Button>
{itemCount > 0 && (
<Button
type="button"
variant="outline"
size="sm"
onClick={handleRemoveAllItems}
className="shrink-0 text-destructive hover:text-destructive"
>
<Trash2 className="h-3.5 w-3.5 mr-1" />
</Button>
)}
</div>
<p className="text-sm text-muted-foreground mt-1">