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) => {
// judgeFileDownload(
const viewImg = async (methodName, labelName, fileName) => {
const res = await judgeImgDownload({
scDatagb: rowData.scDatagb,
scCode: rowData.scCode,
methodName
});
console.log(res);
setChildTitle('ddd');
setChildTitle(`${labelName} - ${fileName}`);
setChildOpen(true);
setImgUrl(res);
setImgName('dddd');
setImgUrl(URL.createObjectURL(res));
setImgName(fileName);
};
return (

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

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

@ -1,5 +1,5 @@
import { InputAdornment, TextField } from '@mui/material';
import { FileDownload } from '@mui/icons-material';
import { FileDownload, Info } from '@mui/icons-material';
import PropTypes from 'prop-types';
const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => (
@ -11,12 +11,12 @@ const ImageFileViewForm = ({ labelName = '', fileName, methodName = '', handleVi
fullWidth
label={labelName}
value={fileName}
onClick={() => handleViewImg(methodName)}
onClick={() => handleViewImg(methodName, labelName, fileName)}
InputProps={{
display: 'none',
endAdornment: (
<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>
)
}}

Loading…
Cancel
Save