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 { 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 showAlert = useAlert();
@ -175,7 +175,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}>
<ImageFileTextForm
<ImageFileViewForm
labelName={`단속사진${idx}`}
fileName={rowData[`scPicad${idx}`]}
handleViewImg={viewImg}
@ -187,7 +187,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}>
{_.range(1, 5, 1).map((idx) => (
<Grid item xs={3} key={idx}>
<ImageFileTextForm
<ImageFileViewForm
labelName={`진술서${idx}`}
fileName={rowData[`scFrecad${idx}`]}
handleViewImg={viewImg}
@ -199,7 +199,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
<Grid container spacing={1} mt={1}>
{_.range(1, 9, 1).map((idx) => (
<Grid item xs={3} key={idx}>
<ImageFileTextForm
<ImageFileViewForm
labelName={`첨부자료${idx}`}
fileName={rowData[`scContad${idx}`]}
handleViewImg={viewImg}

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

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

@ -3,7 +3,7 @@ import { Button, Grid, TextField } from '@mui/material';
import { FileUpload } from '@mui/icons-material';
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 file = e.target.files[0];
if (file.type.includes('image')) {
@ -27,14 +27,14 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h
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>
</Grid>
</Grid>
);
};
FileInputForms.propTypes = {
ImageFileInputForms.propTypes = {
fieldName: PropTypes.string.isRequired,
index: PropTypes.number.isRequired,
labelName: PropTypes.string.isRequired,
@ -45,4 +45,4 @@ FileInputForms.propTypes = {
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 PropTypes from 'prop-types';
const ImageFileTextForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => (
const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => (
<>
{fileName && (
<TextField
@ -24,11 +24,11 @@ const ImageFileTextForm = ({ labelName = '', fileName, methodName = '', handleVi
)}
</>
);
ImageFileTextForm.propTypes = {
ImageFileViewForm.propTypes = {
labelName: PropTypes.string.isRequired,
fileName: PropTypes.string,
methodName: PropTypes.string.isRequired,
handleViewImg: PropTypes.func.isRequired
};
export default ImageFileTextForm;
export default ImageFileViewForm;
Loading…
Cancel
Save