fix: 주정차 심사 반영 완료

mpower
minuk926 2 years ago
parent 5996a3c1d8
commit 0303af2827

@ -23,7 +23,8 @@ import {
GET_PARKING_IMAGE2,
GET_PARKING_FRECAD_IMAGE,
GET_PARKING_CONTAD_IMAGE,
GET_PARKING_PICAD_IMAGE
GET_PARKING_PICAD_IMAGE,
GET_PARKING_JUDGE_FILE_DOWNLOAD
} from 'commons/ApiUrl';
import { setRowId } from './common';
import FileSaver from 'file-saver';
@ -235,6 +236,33 @@ export async function findJudgeImages(row) {
return res;
}
async function parkingJudgeImgList(arrImgInfo, fieldName) {
console.log(arrImgInfo);
const arrRtn = [];
// eslint-disable-next-line no-restricted-syntax
for (const idx of _.range(1, arrImgInfo.length + 1, 1)) {
if (arrImgInfo[idx - 1].imgName) {
// eslint-disable-next-line no-await-in-loop
await axios
.get(GET_PARKING_JUDGE_FILE_DOWNLOAD, {
responseType: 'blob',
params: { absFileName: arrImgInfo[idx - 1].url }
})
// eslint-disable-next-line no-loop-func
.then((r) => {
if (r.size > 0) {
arrRtn.push({ imgName: arrImgInfo[idx - 1].imgName, url: URL.createObjectURL(r) });
} else {
arrRtn.push({ imgName: arrImgInfo[idx - 1].imgName, url: '/images/noFile.png' });
}
});
} else {
arrRtn.push({ imgName: '', url: '/images/noImage.png' });
}
}
return arrRtn;
}
export async function saveJudgeResult(params) {
// eslint-disable-next-line no-return-await
return await axios.post(SAVE_JUDGE_RESULT, params);
@ -247,10 +275,16 @@ export async function findParkingImages(rcMaincode) {
await axios.get(GET_PARKING_PICAD_IMAGE + rcMaincode)
]);
const [frecads, contads, picads] = await Promise.all([
parkingJudgeImgList(frecadImgs?.data, 'frecad'),
parkingJudgeImgList(contadImgs?.data, 'contad'),
parkingJudgeImgList(picadImgs?.data, 'picad')
]);
return {
arrFrecadImg: frecadImgs?.data ?? [],
arrContadImg: contadImgs?.data ?? [],
arrPicadImg: picadImgs?.data ?? []
arrFrecadImg: frecads,
arrContadImg: contads,
arrPicadImg: picads
};
}

@ -51,6 +51,7 @@ export const GET_PARKING_CONTAD_IMAGE = '/api/v2/ctgy/parking/judge/contad/';
export const SAVE_PARKING_JUDGE_RESULT = '/api/v2/ctgy/parking/judge';
export const GET_JUDGE_FILE_DOWNLOAD = '/api/v2/ctgy/cmm/download/judge';
export const GET_PARKING_JUDGE_FILE_DOWNLOAD = '/api/v2/ctgy/cmm/download/park';
// 사용자 관리
export const GET_USER_LIST = '/api/v2/ctgy/user';

@ -94,7 +94,7 @@ const ProcessParkingJudge = (props) => {
return (
<>
<Grid container spacing={1}>
<Grid item xs={6.5}>
<Grid item xs={6}>
<ImageList cols={4}>
{frecadImgs?.map((img, idx) => (
<ImgItem key={idx} idx={idx} title={`진술서${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
@ -111,23 +111,18 @@ const ProcessParkingJudge = (props) => {
))}
</ImageList>
</Grid>
<Grid item xs={5.5}>
<Grid item xs={5.9} ml={0.8} border={1}>
<Grid container spacing={1}>
<Grid item xs={12}>
{selectedImg && (
<img
style={{ width: '100%' }}
resizemode="contain"
src={selectedImg.url}
// srcSet={`${selectedImg.url}?w=400&h=400&fit=crop&auto=format&dpr=2 2x`}
alt={selectedImg.imgName}
loading="lazy"
/>
<ImageList sx={{ width: '100%', height: 554, margin: '0' }}>
<img src={selectedImg.url} alt={selectedImg.imgName} loading="lazy" />
</ImageList>
)}
</Grid>
</Grid>
</Grid>
<Grid container m={1}>
<Grid container>
<Grid item xs={12}>
<Divider />
</Grid>

Loading…
Cancel
Save