diff --git a/src/apis/judge.js b/src/apis/judge.js
index 16047e3..db95379 100644
--- a/src/apis/judge.js
+++ b/src/apis/judge.js
@@ -169,7 +169,7 @@ export async function findByUserJudges(params) {
}
// eslint-disable-next-line consistent-return
-async function judgeImgDownload(params, alert) {
+export async function judgeImgDownload(params) {
// const res = await
// eslint-disable-next-line no-return-await
return await axios.get(GET_JUDGE_FILE_DOWNLOAD, {
@@ -178,13 +178,13 @@ async function judgeImgDownload(params, alert) {
});
}
-async function judgeImgList(res, scCode, fieldCnt, fieldName, dataGb, methodName, alert) {
+async function judgeImgList(res, scCode, fieldCnt, fieldName, dataGb, methodName) {
const arrRtn = [];
// eslint-disable-next-line no-restricted-syntax
for (const idx of _.range(1, fieldCnt, 1)) {
if (res?.data[`${fieldName}${idx}`]) {
// eslint-disable-next-line no-await-in-loop
- await judgeImgDownload({ scDatagb: dataGb, scCode, methodName: `${methodName}${idx}` }, alert).then((r) => {
+ await judgeImgDownload({ scDatagb: dataGb, scCode, methodName: `${methodName}${idx}` }).then((r) => {
if (r.size > 0) {
arrRtn.push({ imgName: res?.data[`${fieldName}${idx}`], url: URL.createObjectURL(r) });
} else {
@@ -199,16 +199,16 @@ async function judgeImgList(res, scCode, fieldCnt, fieldName, dataGb, methodName
return arrRtn;
}
-export async function findImages(row, alert) {
+export async function findImages(row) {
const dataGb = row?.msDatagb;
const scCode = row?.msMaincode;
const res = await findJudge(scCode);
if (res.success) {
const [frecadImgs, contadImgs, picadImgs] = await Promise.all([
- judgeImgList(res, scCode, 5, 'scFrecad', dataGb, 'getScFrecad', alert),
- judgeImgList(res, scCode, 9, 'scContad', dataGb, 'getScContad', alert),
- judgeImgList(res, scCode, 5, 'scPicad', dataGb, 'getScPicad', alert)
+ judgeImgList(res, scCode, 5, 'scFrecad', dataGb, 'getScFrecad'),
+ judgeImgList(res, scCode, 9, 'scContad', dataGb, 'getScContad'),
+ judgeImgList(res, scCode, 5, 'scPicad', dataGb, 'getScPicad')
]);
return {
diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx
index 85e03cf..0a50791 100644
--- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx
+++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx
@@ -9,14 +9,19 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } f
import Button from '@mui/material/Button';
import { Delete, List } from '@mui/icons-material';
-import { judgeFileDownload } from 'apis/judge';
+import { judgeFileDownload, judgeImgDownload } from 'apis/judge';
import ImageFileViewForm from '../../../cmm/file-ctl/ImageFileViewForm';
+import CmmImgViewModal from '../../../cmm/CmmImgViewModal';
const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => {
const showAlert = useAlert();
const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc);
const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb);
+ const [childOpen, setChildOpen] = useState(false);
+ const [childTitle, setChildTitle] = useState();
+ const [imgUrl, setImgUrl] = useState();
+ const [imgName, setImgName] = useState();
const onList = () => {
setOpen(false);
@@ -30,15 +35,18 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
}
};
- const viewImg = (methodName) => {
- judgeFileDownload(
- {
- scDatagb: rowData.scDatagb,
- scCode: rowData.scCode,
- methodName
- },
- showAlert
- );
+ const viewImg = async (methodName) => {
+ // judgeFileDownload(
+ const res = await judgeImgDownload({
+ scDatagb: rowData.scDatagb,
+ scCode: rowData.scCode,
+ methodName
+ });
+ console.log(res);
+ setChildTitle('ddd');
+ setChildOpen(true);
+ setImgUrl(res);
+ setImgName('dddd');
};
return (
@@ -156,7 +164,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
required
label="위반장소"
fullWidth
- value={rowData?.scPos}
+ value={rowData?.scPos || ''}
/>
@@ -231,6 +239,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
+