From 530fd10c9ab52692b7417c24df340a17c6c93eaf Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 30 May 2022 11:55:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20image=20view=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/biz/admin/judge/JudgeDataDetailForm.jsx | 10 ++++------ src/views/cmm/CmmImgViewModal.jsx | 6 +++--- src/views/cmm/file-ctl/FileForm.jsx | 2 +- src/views/cmm/file-ctl/ImageFileViewForm.jsx | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx index 0a50791..e268014 100644 --- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx @@ -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 ( diff --git a/src/views/cmm/CmmImgViewModal.jsx b/src/views/cmm/CmmImgViewModal.jsx index 8559b45..35dc34e 100644 --- a/src/views/cmm/CmmImgViewModal.jsx +++ b/src/views/cmm/CmmImgViewModal.jsx @@ -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 }; diff --git a/src/views/cmm/file-ctl/FileForm.jsx b/src/views/cmm/file-ctl/FileForm.jsx index 33fd2cc..13f1792 100644 --- a/src/views/cmm/file-ctl/FileForm.jsx +++ b/src/views/cmm/file-ctl/FileForm.jsx @@ -6,7 +6,7 @@ const FileForm = ({ isDownload = false, isDisabled = false, labelName, - selectedFile, + selectedFile = '', handleChangeFile, handleFileDownload = () => {}, alert diff --git a/src/views/cmm/file-ctl/ImageFileViewForm.jsx b/src/views/cmm/file-ctl/ImageFileViewForm.jsx index 2965a1a..4e71e2e 100644 --- a/src/views/cmm/file-ctl/ImageFileViewForm.jsx +++ b/src/views/cmm/file-ctl/ImageFileViewForm.jsx @@ -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: ( - + ) }}