From 06c08b756b694ce656684574841a794e65039c6a Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 6 May 2022 18:13:18 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EA=B0=9C=EB=B0=9C=EC=9E=90?= =?UTF-8?q?=EB=8F=84=EA=B5=AC=20=EC=BD=98=EC=86=94=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/admin/judge/JudgeDataDetailForm.jsx | 63 +++++++++++-------- .../biz/admin/judge/JudgeDataModifyForm.jsx | 35 ++++------- .../biz/admin/judge/JudgeDataNewForm.jsx | 19 +++--- .../biz/pboard/ModifyPublicBoardForm.jsx | 2 +- src/views/cmm/file-ctl/FileInputForm.jsx | 42 ------------- src/views/cmm/file-ctl/FileInputForms.jsx | 4 +- src/views/cmm/file-ctl/FileReadInputForm.jsx | 45 ------------- src/views/cmm/file-ctl/Filedownload.jsx | 23 ------- 8 files changed, 61 insertions(+), 172 deletions(-) delete mode 100644 src/views/cmm/file-ctl/FileInputForm.jsx delete mode 100644 src/views/cmm/file-ctl/FileReadInputForm.jsx delete mode 100644 src/views/cmm/file-ctl/Filedownload.jsx diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx index 87fcf27..2348aa7 100644 --- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx @@ -40,7 +40,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav return ( <> - + @@ -54,7 +54,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + @@ -104,7 +104,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + - + @@ -168,43 +168,52 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + {_.range(1, 5, 1).map((idx) => ( - + + + ))} - + {_.range(1, 5, 1).map((idx) => ( - + + + ))} - + {_.range(1, 9, 1).map((idx) => ( - + + + ))} - + - + - - - ); -}; - -FileInputForm.propTypes = { - labelName: PropTypes.string.isRequired, - selectedFile: PropTypes.string, - handleChangeFile: PropTypes.func.isRequired, - alert: PropTypes.object.isRequired -}; - -export default FileInputForm; diff --git a/src/views/cmm/file-ctl/FileInputForms.jsx b/src/views/cmm/file-ctl/FileInputForms.jsx index 65a1be6..0fcb939 100644 --- a/src/views/cmm/file-ctl/FileInputForms.jsx +++ b/src/views/cmm/file-ctl/FileInputForms.jsx @@ -26,7 +26,7 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h @@ -36,7 +36,7 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h FileInputForms.propTypes = { fieldName: PropTypes.string.isRequired, index: PropTypes.number.isRequired, - labelName: PropTypes.number.isRequired, + labelName: PropTypes.string.isRequired, selectedFile: PropTypes.string, fileName: PropTypes.string, isDisabled: PropTypes.bool.isRequired, diff --git a/src/views/cmm/file-ctl/FileReadInputForm.jsx b/src/views/cmm/file-ctl/FileReadInputForm.jsx deleted file mode 100644 index 1a3d1bd..0000000 --- a/src/views/cmm/file-ctl/FileReadInputForm.jsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Button, Grid, TextField, Typography } from '@mui/material'; -import { FileUpload } from '@mui/icons-material'; -import PropTypes from 'prop-types'; - -const FileReadInputForm = ({ labelName, selectedFile, handleChangeFile, alert }) => { - const onChangeFile = (e) => { - const file = e.target.files[0]; - if (file.type.includes('image')) { - alert.show({`${file.name}`}); - } - handleChangeFile(file); - }; - - return ( - - - } - onClick={() => {}} - /> - - - - - - {selectedFile} - - - ); -}; - -FileReadInputForm.propTypes = { - labelName: PropTypes.number.isRequired, - selectedFile: PropTypes.string, - handleChangeFile: PropTypes.func.isRequired, - alert: PropTypes.object.isRequired -}; - -export default FileReadInputForm; diff --git a/src/views/cmm/file-ctl/Filedownload.jsx b/src/views/cmm/file-ctl/Filedownload.jsx deleted file mode 100644 index 97f119d..0000000 --- a/src/views/cmm/file-ctl/Filedownload.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; - -const Filedownload = () => { - useEffect(() => { - if (fileData) { - const url = window.URL.createObjectURL(new Blob([fileData.data])); - const link = document.createElement('a'); - link.href = url; - link.setAttribute('download', 'test.xlsx'); - link.setAttribute('id', 'tempLink'); - document.body.appendChild(link); - link.click(); - } - return () => { - const link = document.querySelector('#tempLink'); - link && link.remove(); - }; - }, [fileData]); - - return
; -}; - -export default Filedownload;