fix: image view 적용

main
minuk926 3 years ago
parent 0f1d8705ca
commit 530fd10c9a

@ -35,18 +35,16 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
} }
}; };
const viewImg = async (methodName) => { const viewImg = async (methodName, labelName, fileName) => {
// judgeFileDownload(
const res = await judgeImgDownload({ const res = await judgeImgDownload({
scDatagb: rowData.scDatagb, scDatagb: rowData.scDatagb,
scCode: rowData.scCode, scCode: rowData.scCode,
methodName methodName
}); });
console.log(res); setChildTitle(`${labelName} - ${fileName}`);
setChildTitle('ddd');
setChildOpen(true); setChildOpen(true);
setImgUrl(res); setImgUrl(URL.createObjectURL(res));
setImgName('dddd'); setImgName(fileName);
}; };
return ( return (

@ -10,8 +10,8 @@ const style = {
top: '50%', top: '50%',
left: '50%', left: '50%',
transform: 'translate(-50%, -50%)', transform: 'translate(-50%, -50%)',
width: 1050, width: 1000,
minHeight: 500, minHeight: 800,
bgcolor: 'background.paper', bgcolor: 'background.paper',
border: '2px solid #000', border: '2px solid #000',
boxShadow: 24, boxShadow: 24,
@ -53,7 +53,7 @@ CmmImgViewModal.propTypes = {
open: PropTypes.bool, open: PropTypes.bool,
setOpen: PropTypes.func, setOpen: PropTypes.func,
title: PropTypes.string, title: PropTypes.string,
imgUrl: PropTypes.object, imgUrl: PropTypes.string,
imgName: PropTypes.string imgName: PropTypes.string
}; };

@ -6,7 +6,7 @@ const FileForm = ({
isDownload = false, isDownload = false,
isDisabled = false, isDisabled = false,
labelName, labelName,
selectedFile, selectedFile = '',
handleChangeFile, handleChangeFile,
handleFileDownload = () => {}, handleFileDownload = () => {},
alert alert

@ -1,5 +1,5 @@
import { InputAdornment, TextField } from '@mui/material'; import { InputAdornment, TextField } from '@mui/material';
import { FileDownload } from '@mui/icons-material'; import { FileDownload, Info } from '@mui/icons-material';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => ( const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => (
@ -11,12 +11,12 @@ const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleVi
fullWidth fullWidth
label={labelName} label={labelName}
value={fileName} value={fileName}
onClick={() => handleViewImg(methodName)} onClick={() => handleViewImg(methodName, labelName, fileName)}
InputProps={{ InputProps={{
display: 'none', display: 'none',
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
<FileDownload stroke={1.5} size="1rem" cursor="pointer" /> <Info stroke={1.5} size="1rem" cursor="pointer" sx={{ color: 'rgba(255, 255, 255, 0.54)' }} />
</InputAdornment> </InputAdornment>
) )
}} }}

Loading…
Cancel
Save