fix: type 오류 fix

main
minuk926 3 years ago
parent 01b819e35d
commit e7e7957507

@ -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

@ -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

@ -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",

@ -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
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item sm={3}>
<FileInputForms
<FileReadInputForm
isDisabled={false}
fieldName="scPicad"
index={1}

@ -49,7 +49,7 @@ FileForm.propTypes = {
selectedFile: PropTypes.string,
handleChangeFile: PropTypes.func.isRequired,
handleFileDownload: PropTypes.func.isRequired,
alert: PropTypes.func.isRequired
alert: PropTypes.object.isRequired
};
export default FileForm;

@ -33,10 +33,10 @@ const FileInputForm = ({ labelName, selectedFile, handleChangeFile, alert }) =>
};
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;

@ -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;

@ -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(<img alt={`${file.name}`} src={URL.createObjectURL(file)} style={{ margin: 'auto' }} />);
}
handleChangeFile(file);
};
return (
<Grid container item spacing={0.5}>
<Grid item xs={12} sm={7.5}>
<TextField
placeholder={labelName}
value={selectedFile}
size="small"
startIcon={<FileUpload stroke={1.5} size="1rem" />}
onClick={() => {}}
/>
</Grid>
<Grid item xs={12} sm={4.5}>
<Button variant="contained" component="label" color="primary" size="small" startIcon={<FileUpload stroke={1.5} size="1rem" />}>
파일
<input type="file" hidden onChange={onChangeFile} />
</Button>
</Grid>
<Grid>
<Typography variant="h4">{selectedFile}</Typography>
</Grid>
</Grid>
);
};
FileReadInputForm.propTypes = {
labelName: PropTypes.number.isRequired,
selectedFile: PropTypes.string,
handleChangeFile: PropTypes.func.isRequired,
alert: PropTypes.object.isRequired
};
export default FileReadInputForm;
Loading…
Cancel
Save