|
|
@ -23,7 +23,8 @@ import {
|
|
|
|
GET_PARKING_IMAGE2,
|
|
|
|
GET_PARKING_IMAGE2,
|
|
|
|
GET_PARKING_FRECAD_IMAGE,
|
|
|
|
GET_PARKING_FRECAD_IMAGE,
|
|
|
|
GET_PARKING_CONTAD_IMAGE,
|
|
|
|
GET_PARKING_CONTAD_IMAGE,
|
|
|
|
GET_PARKING_PICAD_IMAGE
|
|
|
|
GET_PARKING_PICAD_IMAGE,
|
|
|
|
|
|
|
|
GET_PARKING_JUDGE_FILE_DOWNLOAD
|
|
|
|
} from 'commons/ApiUrl';
|
|
|
|
} from 'commons/ApiUrl';
|
|
|
|
import { setRowId } from './common';
|
|
|
|
import { setRowId } from './common';
|
|
|
|
import FileSaver from 'file-saver';
|
|
|
|
import FileSaver from 'file-saver';
|
|
|
@ -235,6 +236,33 @@ export async function findJudgeImages(row) {
|
|
|
|
return res;
|
|
|
|
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) {
|
|
|
|
export async function saveJudgeResult(params) {
|
|
|
|
// eslint-disable-next-line no-return-await
|
|
|
|
// eslint-disable-next-line no-return-await
|
|
|
|
return await axios.post(SAVE_JUDGE_RESULT, params);
|
|
|
|
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)
|
|
|
|
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 {
|
|
|
|
return {
|
|
|
|
arrFrecadImg: frecadImgs?.data ?? [],
|
|
|
|
arrFrecadImg: frecads,
|
|
|
|
arrContadImg: contadImgs?.data ?? [],
|
|
|
|
arrContadImg: contads,
|
|
|
|
arrPicadImg: picadImgs?.data ?? []
|
|
|
|
arrPicadImg: picads
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|