diff --git a/src/views/biz/judge/JudgeDataModifyForm.jsx b/src/views/biz/judge/JudgeDataModifyForm.jsx index 0155d6b..2383c74 100644 --- a/src/views/biz/judge/JudgeDataModifyForm.jsx +++ b/src/views/biz/judge/JudgeDataModifyForm.jsx @@ -11,7 +11,6 @@ import { IconSearch } from '@tabler/icons'; import FileInputForms from 'views/cmm/file-ctl/FileInputForms'; import DaumPost from '../../cmm/DaumPost'; -import FileReadInputForm from '../../cmm/file-ctl/FileReadInputForm'; // const toDate = new Date(); @@ -104,6 +103,12 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav // const file = new File(); } } + + // eslint-disable-next-line no-restricted-syntax + // for (const pair of formData.entries()) { + // console.log(pair[0], pair[1]); + // } + handleModalSave('SAVE', formData); }; @@ -115,19 +120,21 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav setPicads((picads) => { const updated = { ...picads }; updated[fileArrKey] = e.target.files[0]; - e.target.fileName = e.target.files[0].name; + rowData[fileArrKey] = e.target.files[0].name; return updated; }); } else if (fileKey === 'scFrecad') { setFrecads((frecads) => { const updated = { ...frecads }; updated[fileArrKey] = e.target.files[0]; + rowData[fileArrKey] = e.target.files[0].name; return updated; }); } else if (fileKey === 'scContad') { setContads((contads) => { const updated = { ...contads }; updated[fileArrKey] = e.target.files[0]; + rowData[fileArrKey] = e.target.files[0].name; return updated; }); } @@ -151,10 +158,27 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav setIsPostOpen(false); }; + const setFileUploadBtn = (fieldName, idx) => { + let isDisabled = false; + switch (idx) { + case 1: + isDisabled = false; + break; + default: + isDisabled = + rowData[`${fieldName}${idx}`] || rowData[`${fieldName}${idx - 1}`] + ? false + : typeof picads[`${fieldName}${idx - 1}`] === 'undefined'; + break; + } + return isDisabled; + }; + useEffect(() => { // eslint-disable-next-line no-plusplus for (let idx = 1; idx < 5; idx++) { if (rowData[`scPicad${idx}`]) { + // URL.createObjectURL(rowData[`scPicad${idx}`]); console.log(rowData[`scPicad${idx}`]); // const file = new File(); } @@ -314,7 +338,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav {_.range(1, 5, 1).map((idx) => ( ( (