From 0793ef1e3aa2232ce72debd57ba449a699e0c734 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 4 Jul 2025 04:32:04 +0000 Subject: (최겸) 0704 평가기준표 수정(create, detail, update 및 excel 기능) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/reg-eval-criteria-form-sheet.tsx | 1138 ++++++++++---------- 1 file changed, 569 insertions(+), 569 deletions(-) (limited to 'lib/evaluation-criteria/table/reg-eval-criteria-form-sheet.tsx') diff --git a/lib/evaluation-criteria/table/reg-eval-criteria-form-sheet.tsx b/lib/evaluation-criteria/table/reg-eval-criteria-form-sheet.tsx index 3362d810..8f4c4413 100644 --- a/lib/evaluation-criteria/table/reg-eval-criteria-form-sheet.tsx +++ b/lib/evaluation-criteria/table/reg-eval-criteria-form-sheet.tsx @@ -1,586 +1,586 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ +// /* eslint-disable @typescript-eslint/no-explicit-any */ -'use client'; +// 'use client'; -/* IMPORT */ -import { Button } from '@/components/ui/button'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; -import { - createRegEvalCriteriaWithDetails, - getRegEvalCriteriaWithDetails, - modifyRegEvalCriteriaWithDetails, -} from '../service'; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from '@/components/ui/form'; -import { Input } from '@/components/ui/input'; -import { Plus, Trash2 } from 'lucide-react'; -import { - REG_EVAL_CRITERIA_CATEGORY, - REG_EVAL_CRITERIA_CATEGORY2, - REG_EVAL_CRITERIA_ITEM, - type RegEvalCriteriaDetails, - type RegEvalCriteriaView, -} from '@/db/schema'; -import { ScrollArea } from '@/components/ui/scroll-area'; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue -} from '@/components/ui/select'; -import { - Sheet, - SheetContent, - SheetDescription, - SheetHeader, - SheetTitle, -} from '@/components/ui/sheet'; -import { Textarea } from '@/components/ui/textarea'; -import { toast } from 'sonner'; -import { useForm, useFieldArray } from 'react-hook-form'; -import { useEffect, useTransition } from 'react'; -import { z } from 'zod'; -import { zodResolver } from '@hookform/resolvers/zod'; +// /* IMPORT */ +// import { Button } from '@/components/ui/button'; +// import { +// Card, +// CardContent, +// CardDescription, +// CardHeader, +// CardTitle, +// } from '@/components/ui/card'; +// import { +// createRegEvalCriteriaWithDetails, +// getRegEvalCriteriaWithDetails, +// modifyRegEvalCriteriaWithDetails, +// } from '../service'; +// import { +// Form, +// FormControl, +// FormField, +// FormItem, +// FormLabel, +// FormMessage, +// } from '@/components/ui/form'; +// import { Input } from '@/components/ui/input'; +// import { Plus, Trash2 } from 'lucide-react'; +// import { +// REG_EVAL_CRITERIA_CATEGORY, +// REG_EVAL_CRITERIA_CATEGORY2, +// REG_EVAL_CRITERIA_ITEM, +// type RegEvalCriteriaDetails, +// type RegEvalCriteriaView, +// } from '@/db/schema'; +// import { ScrollArea } from '@/components/ui/scroll-area'; +// import { +// Select, +// SelectContent, +// SelectItem, +// SelectTrigger, +// SelectValue +// } from '@/components/ui/select'; +// import { +// Sheet, +// SheetContent, +// SheetDescription, +// SheetHeader, +// SheetTitle, +// } from '@/components/ui/sheet'; +// import { Textarea } from '@/components/ui/textarea'; +// import { toast } from 'sonner'; +// import { useForm, useFieldArray } from 'react-hook-form'; +// import { useEffect, useTransition } from 'react'; +// import { z } from 'zod'; +// import { zodResolver } from '@hookform/resolvers/zod'; -// ---------------------------------------------------------------------------------------------------- +// // ---------------------------------------------------------------------------------------------------- -/* TYPES */ -const regEvalCriteriaFormSchema = z.object({ - category: z.string().min(1, '평가부문은 필수 항목입니다.'), - category2: z.string().min(1, '점수구분은 필수 항목입니다.'), - item: z.string().min(1, '항목은 필수 항목입니다.'), - classification: z.string().min(1, '구분은 필수 항목입니다.'), - range: z.string().nullable().optional(), - remarks: z.string().nullable().optional(), - criteriaDetails: z.array( - z.object({ - id: z.number().optional(), - detail: z.string().min(1, '평가내용은 필수 항목입니다.'), - scoreEquipShip: z.coerce.number().nullable().optional(), - scoreEquipMarine: z.coerce.number().nullable().optional(), - scoreBulkShip: z.coerce.number().nullable().optional(), - scoreBulkMarine: z.coerce.number().nullable().optional(), - }) - ).min(1, '최소 1개의 평가 내용이 필요합니다.'), -}); -type RegEvalCriteriaFormData = z.infer; -interface CriteriaDetailFormProps { - index: number - form: any - onRemove: () => void - canRemove: boolean - disabled?: boolean -} -interface RegEvalCriteriaFormSheetProps { - open: boolean, - onOpenChange: (open: boolean) => void, - criteriaViewData: RegEvalCriteriaView | null, - onSuccess: () => void, -}; +// /* TYPES */ +// const regEvalCriteriaFormSchema = z.object({ +// category: z.string().min(1, '평가부문은 필수 항목입니다.'), +// category2: z.string().min(1, '점수구분은 필수 항목입니다.'), +// item: z.string().min(1, '항목은 필수 항목입니다.'), +// classification: z.string().min(1, '구분은 필수 항목입니다.'), +// range: z.string().nullable().optional(), +// remarks: z.string().nullable().optional(), +// criteriaDetails: z.array( +// z.object({ +// id: z.number().optional(), +// detail: z.string().min(1, '평가내용은 필수 항목입니다.'), +// scoreEquipShip: z.coerce.number().nullable().optional(), +// scoreEquipMarine: z.coerce.number().nullable().optional(), +// scoreBulkShip: z.coerce.number().nullable().optional(), +// scoreBulkMarine: z.coerce.number().nullable().optional(), +// }) +// ).min(1, '최소 1개의 평가 내용이 필요합니다.'), +// }); +// type RegEvalCriteriaFormData = z.infer; +// interface CriteriaDetailFormProps { +// index: number +// form: any +// onRemove: () => void +// canRemove: boolean +// disabled?: boolean +// } +// interface RegEvalCriteriaFormSheetProps { +// open: boolean, +// onOpenChange: (open: boolean) => void, +// criteriaViewData: RegEvalCriteriaView | null, +// onSuccess: () => void, +// }; -// ---------------------------------------------------------------------------------------------------- +// // ---------------------------------------------------------------------------------------------------- -/* CRITERIA DETAIL FORM COPONENT */ -function CriteriaDetailForm({ - index, - form, - onRemove, - canRemove, - disabled = false, -}: CriteriaDetailFormProps) { +// /* CRITERIA DETAIL FORM COPONENT */ +// function CriteriaDetailForm({ +// index, +// form, +// onRemove, +// canRemove, +// disabled = false, +// }: CriteriaDetailFormProps) { - return ( - - -
- Detail Item - {index + 1} - {canRemove && ( - - )} -
-
- - ( - - )} - /> - ( - - 평가내용 - -