diff --git a/src/apis/judge.js b/src/apis/judge.js index 517ed2c..11af1c6 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -19,8 +19,11 @@ import { SAVE_JUDGE_RESULT, SAVE_ADMIN_JUDGE_STDS, GET_DASHBOARD, - GET_PARKING_IMAGE, - SAVE_PARKING_JUDGE_RESULT + SAVE_PARKING_JUDGE_RESULT, + GET_PARKING_IMAGE2, + GET_PARKING_FRECAD_IMAGE, + GET_PARKING_CONTAD_IMAGE, + GET_PARKING_PICAD_IMAGE } from 'commons/ApiUrl'; import { setRowId } from './common'; import FileSaver from 'file-saver'; @@ -224,9 +227,9 @@ export async function findJudgeImages(row) { ]); return { - arrFrecadImg: frecadImgs, - arrContadImg: contadImgs, - arrPicadImg: picadImgs + arrFrecadImg: frecadImgs.data, + arrContadImg: contadImgs.data, + arrPicadImg: picadImgs.data }; } return res; @@ -237,7 +240,7 @@ export async function saveJudgeResult(params) { return await axios.post(SAVE_JUDGE_RESULT, params); } -export async function findParkingImages(row) { +export async function findParkingImages2(row) { const dataGb = row?.msDatagb; const scCode = row?.msMaincode; @@ -258,7 +261,7 @@ export async function findParkingImages(row) { // } // return res; - const res = await axios.get(GET_PARKING_IMAGE + row?.rcMaincode); + const res = await axios.get(GET_PARKING_IMAGE2 + row?.rcMaincode); return { arrFrecadImg: [], @@ -267,6 +270,40 @@ export async function findParkingImages(row) { }; } +export async function findParkingImages(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'), + // judgeImgList(res, scCode, 9, 'scContad', dataGb, 'getScContad'), + // judgeImgList(res, scCode, 5, 'scPicad', dataGb, 'getScPicad') + // ]); + // + // return { + // arrFrecadImg: frecadImgs, + // arrContadImg: contadImgs, + // arrPicadImg: picadImgs + // }; + // + // } + // return res; + + const [frecadImgs, contadImgs, picadImgs] = await Promise.all([ + await axios.get(GET_PARKING_FRECAD_IMAGE + row?.rcMaincode), + await axios.get(GET_PARKING_CONTAD_IMAGE + row?.rcMaincode), + await axios.get(GET_PARKING_PICAD_IMAGE + row?.rcMaincode) + ]); + + return { + arrFrecadImg: frecadImgs?.data ?? [], + arrContadImg: contadImgs?.data ?? [], + arrPicadImg: picadImgs?.data ?? [] + }; +} + export async function saveParkingJudgeResult(params) { // eslint-disable-next-line no-return-await return await axios.post(SAVE_PARKING_JUDGE_RESULT, params); diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 154580a..7e53332 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -44,7 +44,10 @@ export const SAVE_ADMIN_JUDGE_STDS = '/api/v2/ctgy/admin/judge'; export const GET_JUDGE_LIST = '/api/v2/ctgy/judge'; export const SAVE_JUDGE_RESULT = '/api/v2/ctgy/judge'; -export const GET_PARKING_IMAGE = '/api/v2/ctgy/parking/judge/'; +export const GET_PARKING_IMAGE2 = '/api/v2/ctgy/parking/judge2/'; +export const GET_PARKING_PICAD_IMAGE = '/api/v2/ctgy/parking/judge/picad/'; +export const GET_PARKING_FRECAD_IMAGE = '/api/v2/ctgy/parking/judge/frecad/'; +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'; diff --git a/src/views/biz/judge/ProcessParkingJudge.jsx b/src/views/biz/judge/ProcessParkingJudge.jsx index fe0723b..57d928c 100644 --- a/src/views/biz/judge/ProcessParkingJudge.jsx +++ b/src/views/biz/judge/ProcessParkingJudge.jsx @@ -22,6 +22,7 @@ const ProcessParkingJudge = (props) => { const getImgList = (row) => { findParkingImages(row).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; + console.log(arrFrecadImg, arrContadImg, arrPicadImg); setFrecadImgs(arrFrecadImg); setContadImgs(arrContadImg); setPicadImgs(arrPicadImg);