From e7e79575070b5105feb29c70ce3bbde2b61c5de9 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 25 Apr 2022 20:56:26 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20type=20=EC=98=A4=EB=A5=98=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 -- .env.production | 4 ++ package.json | 1 + src/views/biz/judge/JudgeDataModifyForm.jsx | 17 +++++++- src/views/cmm/file-ctl/FileForm.jsx | 2 +- src/views/cmm/file-ctl/FileInputForm.jsx | 4 +- src/views/cmm/file-ctl/FileInputForms.jsx | 2 +- src/views/cmm/file-ctl/FileReadInputForm.jsx | 45 ++++++++++++++++++++ 8 files changed, 70 insertions(+), 9 deletions(-) delete mode 100755 .env create mode 100644 .env.production create mode 100644 src/views/cmm/file-ctl/FileReadInputForm.jsx diff --git a/.env b/.env deleted file mode 100755 index c4959fd..0000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -REACT_APP_VERSION = v0.0.1 -#REACT_APP_API_URL=http://211.119.124.9:8090 -REACT_APP_API_URL=http://localhost:8090 -REACT_APP_SERVER_TIMEOUT=6000 \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..6fa20b9 --- /dev/null +++ b/.env.production @@ -0,0 +1,4 @@ +REACT_APP_MODE=production +REACT_APP_VERSION = v0.0.1 +REACT_APP_API_URL=http://211.119.124.9:8090 +REACT_APP_SERVER_TIMEOUT=6000 \ No newline at end of file diff --git a/package.json b/package.json index 649685b..569239d 100755 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "date-fns": "^2.28.0", "draft-js": "^0.11.7", "emoji-picker-react": "^3.5.1", + "env-cmd": "^10.1.0", "exceljs": "^4.3.0", "file-saver": "^2.0.5", "formik": "^2.2.9", diff --git a/src/views/biz/judge/JudgeDataModifyForm.jsx b/src/views/biz/judge/JudgeDataModifyForm.jsx index 5583656..98502fc 100644 --- a/src/views/biz/judge/JudgeDataModifyForm.jsx +++ b/src/views/biz/judge/JudgeDataModifyForm.jsx @@ -10,9 +10,24 @@ 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(); +function FileReadInputForms(props) { + return null; +} + +FileReadInputForms.propTypes = { + selectedFile: PropTypes.any, + handleChangeFile: PropTypes.func, + fileName: PropTypes.any, + fieldName: PropTypes.string, + index: PropTypes.number, + isDisabled: PropTypes.bool, + labelName: PropTypes.string, + isOrgFileInfo: PropTypes.bool +}; const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => { const alert = useAlert(); const [isPostOpen, setIsPostOpen] = useState(false); @@ -259,7 +274,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - }; FileInputForm.propTypes = { - labelName: PropTypes.number.isRequired, + labelName: PropTypes.string.isRequired, selectedFile: PropTypes.string, handleChangeFile: PropTypes.func.isRequired, - alert: 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 349a82c..9b928e5 100644 --- a/src/views/cmm/file-ctl/FileInputForms.jsx +++ b/src/views/cmm/file-ctl/FileInputForms.jsx @@ -41,7 +41,7 @@ FileInputForms.propTypes = { fileName: PropTypes.string, isDisabled: PropTypes.bool.isRequired, handleChangeFile: PropTypes.func.isRequired, - alert: PropTypes.func.isRequired + alert: PropTypes.object.isRequired }; export default FileInputForms; diff --git a/src/views/cmm/file-ctl/FileReadInputForm.jsx b/src/views/cmm/file-ctl/FileReadInputForm.jsx new file mode 100644 index 0000000..1a3d1bd --- /dev/null +++ b/src/views/cmm/file-ctl/FileReadInputForm.jsx @@ -0,0 +1,45 @@ +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;