feat: [공정관리] 품목 전체 삭제 버튼 추가 (등록/수정/상세 화면)
This commit is contained in:
@@ -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">
|
||||
품목을 선택하면 이 공정으로 분류됩니다
|
||||
|
||||
Reference in New Issue
Block a user