|
|
|
@ -143,29 +143,29 @@ export async function removeJudge(params) {
|
|
|
|
|
return await axios.post(REMOVE_ADMIN_JUDGE, params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function judgeFileDownload(params, alert) {
|
|
|
|
|
await axios
|
|
|
|
|
.get(GET_JUDGE_FILE_DOWNLOAD, {
|
|
|
|
|
responseType: 'blob',
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
// eslint-disable-next-line consistent-return
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res?.isAxiosError || res?.status === 404 || res?.size <= 0) {
|
|
|
|
|
alert.show('파일을 다운로드 할 수 없습니다 [파일정보 오류]');
|
|
|
|
|
} else {
|
|
|
|
|
// eslint-disable-next-line no-lonely-if
|
|
|
|
|
if (res?.type.includes('image')) {
|
|
|
|
|
// const url = window.URL.createObjectURL(res);
|
|
|
|
|
|
|
|
|
|
alert.show(<img alt="~~~" src={URL.createObjectURL(res)} style={{ margin: 'auto' }} />);
|
|
|
|
|
// URL.revokeObjectURL()
|
|
|
|
|
} else {
|
|
|
|
|
FileSaver.saveAs(res, 'filename');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// export async function judgeFileDownload(params, alert) {
|
|
|
|
|
// await axios
|
|
|
|
|
// .get(GET_JUDGE_FILE_DOWNLOAD, {
|
|
|
|
|
// responseType: 'blob',
|
|
|
|
|
// params
|
|
|
|
|
// })
|
|
|
|
|
// // eslint-disable-next-line consistent-return
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
// if (res?.isAxiosError || res?.status === 404 || res?.size <= 0) {
|
|
|
|
|
// alert.show('파일을 다운로드 할 수 없습니다 [파일정보 오류]');
|
|
|
|
|
// } else {
|
|
|
|
|
// // eslint-disable-next-line no-lonely-if
|
|
|
|
|
// if (res?.type.includes('image')) {
|
|
|
|
|
// // const url = window.URL.createObjectURL(res);
|
|
|
|
|
// alert.show('~~~~~');
|
|
|
|
|
// alert.show(<img alt="~~~" src={URL.createObjectURL(res)} style={{ margin: 'auto' }} />);
|
|
|
|
|
// // URL.revokeObjectURL()
|
|
|
|
|
// } else {
|
|
|
|
|
// FileSaver.saveAs(res, 'filename');
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export async function saveJudgeStds(params) {
|
|
|
|
|
// eslint-disable-next-line no-return-await
|
|
|
|
@ -236,8 +236,8 @@ export async function findJudgeImages(row) {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function parkingJudgeImgList(arrImgInfo, fieldName) {
|
|
|
|
|
console.log(arrImgInfo);
|
|
|
|
|
async function parkingJudgeImgList(arrImgInfo) {
|
|
|
|
|
// console.log(arrImgInfo);
|
|
|
|
|
const arrRtn = [];
|
|
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
|
|
|
for (const idx of _.range(1, arrImgInfo.length + 1, 1)) {
|
|
|
|
@ -276,9 +276,9 @@ export async function findParkingImages(rcMaincode) {
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const [frecads, contads, picads] = await Promise.all([
|
|
|
|
|
parkingJudgeImgList(frecadImgs?.data, 'frecad'),
|
|
|
|
|
parkingJudgeImgList(contadImgs?.data, 'contad'),
|
|
|
|
|
parkingJudgeImgList(picadImgs?.data, 'picad')
|
|
|
|
|
parkingJudgeImgList(frecadImgs?.data),
|
|
|
|
|
parkingJudgeImgList(contadImgs?.data),
|
|
|
|
|
parkingJudgeImgList(picadImgs?.data)
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|