fix: debug console 에러 fix

main
minuk926 3 years ago
parent d509a8e47b
commit 77fdda9333

@ -10,7 +10,7 @@ import Button from '@mui/material/Button';
import { Delete, List } from '@mui/icons-material'; import { Delete, List } from '@mui/icons-material';
import { judgeFileDownload } from 'apis/judge'; import { judgeFileDownload } from 'apis/judge';
import ImageFileTextForm from '../../../cmm/file-ctl/ImageFileTextForm'; import ImageFileViewForm from '../../../cmm/file-ctl/ImageFileViewForm';
const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => { const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => {
const showAlert = useAlert(); const showAlert = useAlert();
@ -175,7 +175,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<ImageFileTextForm <ImageFileViewForm
labelName={`단속사진${idx}`} labelName={`단속사진${idx}`}
fileName={rowData[`scPicad${idx}`]} fileName={rowData[`scPicad${idx}`]}
handleViewImg={viewImg} handleViewImg={viewImg}
@ -187,7 +187,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<ImageFileTextForm <ImageFileViewForm
labelName={`진술서${idx}`} labelName={`진술서${idx}`}
fileName={rowData[`scFrecad${idx}`]} fileName={rowData[`scFrecad${idx}`]}
handleViewImg={viewImg} handleViewImg={viewImg}
@ -199,7 +199,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 9, 1).map((idx) => ( {_.range(1, 9, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<ImageFileTextForm <ImageFileViewForm
labelName={`첨부자료${idx}`} labelName={`첨부자료${idx}`}
fileName={rowData[`scContad${idx}`]} fileName={rowData[`scContad${idx}`]}
handleViewImg={viewImg} handleViewImg={viewImg}

@ -9,7 +9,7 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import FileInputForms from 'views/cmm/file-ctl/FileInputForms'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms';
import DaumPost from '../../../cmm/DaumPost'; import DaumPost from '../../../cmm/DaumPost';
const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => { const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => {
@ -360,7 +360,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={setFileUploadBtn('scPicad', idx)} isDisabled={setFileUploadBtn('scPicad', idx)}
fieldName="scPicad" fieldName="scPicad"
index={idx} index={idx}
@ -377,7 +377,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={setFileUploadBtn('scFrecad', idx)} isDisabled={setFileUploadBtn('scFrecad', idx)}
fieldName="scFrecad" fieldName="scFrecad"
index={idx} index={idx}
@ -394,7 +394,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 9, 1).map((idx) => ( {_.range(1, 9, 1).map((idx) => (
<Grid item xs={3} key={idx}> <Grid item xs={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={setFileUploadBtn('scContad', idx)} isDisabled={setFileUploadBtn('scContad', idx)}
fieldName="scContad" fieldName="scContad"
index={idx} index={idx}

@ -10,7 +10,7 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import FileInputForms from 'views/cmm/file-ctl/FileInputForms'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms';
import DaumPost from '../../../cmm/DaumPost'; import DaumPost from '../../../cmm/DaumPost';
const toDate = new Date(); const toDate = new Date();
@ -284,7 +284,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item sm={3} key={idx}> <Grid item sm={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={idx === 1 ? false : typeof picads[`scPicad${idx - 1}`] === 'undefined'} isDisabled={idx === 1 ? false : typeof picads[`scPicad${idx - 1}`] === 'undefined'}
fieldName="scPicad" fieldName="scPicad"
index={idx} index={idx}
@ -300,7 +300,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => ( {_.range(1, 5, 1).map((idx) => (
<Grid item sm={3} key={idx}> <Grid item sm={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={idx === 1 ? false : typeof frecads[`scFrecad${idx - 1}`] === 'undefined'} isDisabled={idx === 1 ? false : typeof frecads[`scFrecad${idx - 1}`] === 'undefined'}
fieldName="scFrecad" fieldName="scFrecad"
index={idx} index={idx}
@ -316,7 +316,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
<Grid container spacing={1} mt={1}> <Grid container spacing={1} mt={1}>
{_.range(1, 9, 1).map((idx) => ( {_.range(1, 9, 1).map((idx) => (
<Grid item sm={3} key={idx}> <Grid item sm={3} key={idx}>
<FileInputForms <ImageFileInputForms
isDisabled={idx === 1 ? false : typeof contads[`scContad${idx - 1}`] === 'undefined'} isDisabled={idx === 1 ? false : typeof contads[`scContad${idx - 1}`] === 'undefined'}
fieldName="scContad" fieldName="scContad"
index={idx} index={idx}

@ -3,7 +3,7 @@ import { Button, Grid, TextField } from '@mui/material';
import { FileUpload } from '@mui/icons-material'; import { FileUpload } from '@mui/icons-material';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, handleChangeFile, alert, isDisabled = true }) => { const ImageFileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, handleChangeFile, alert, isDisabled = true }) => {
const onChangeFile = (e) => { const onChangeFile = (e) => {
const file = e.target.files[0]; const file = e.target.files[0];
if (file.type.includes('image')) { if (file.type.includes('image')) {
@ -27,14 +27,14 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h
startIcon={React.cloneElement(<FileUpload />)} startIcon={React.cloneElement(<FileUpload />)}
> >
파일 파일
<input type="file" name={fieldName || ''} data-index={index} hidden onChange={onChangeFile} /> <input type="file" name={fieldName || ''} data-index={index} hidden onChange={onChangeFile} accept="image/*" />
</Button> </Button>
</Grid> </Grid>
</Grid> </Grid>
); );
}; };
FileInputForms.propTypes = { ImageFileInputForms.propTypes = {
fieldName: PropTypes.string.isRequired, fieldName: PropTypes.string.isRequired,
index: PropTypes.number.isRequired, index: PropTypes.number.isRequired,
labelName: PropTypes.string.isRequired, labelName: PropTypes.string.isRequired,
@ -45,4 +45,4 @@ FileInputForms.propTypes = {
alert: PropTypes.object.isRequired alert: PropTypes.object.isRequired
}; };
export default FileInputForms; export default ImageFileInputForms;

@ -2,7 +2,7 @@ import { InputAdornment, TextField } from '@mui/material';
import { FileDownload } from '@mui/icons-material'; import { FileDownload } from '@mui/icons-material';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const ImageFileTextForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => ( const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => (
<> <>
{fileName && ( {fileName && (
<TextField <TextField
@ -24,11 +24,11 @@ const ImageFileTextForm = ({ labelName = '', fileName, methodName = '', handleVi
)} )}
</> </>
); );
ImageFileTextForm.propTypes = { ImageFileViewForm.propTypes = {
labelName: PropTypes.string.isRequired, labelName: PropTypes.string.isRequired,
fileName: PropTypes.string, fileName: PropTypes.string,
methodName: PropTypes.string.isRequired, methodName: PropTypes.string.isRequired,
handleViewImg: PropTypes.func.isRequired handleViewImg: PropTypes.func.isRequired
}; };
export default ImageFileTextForm; export default ImageFileViewForm;
Loading…
Cancel
Save