diff --git a/src/apis/judge.js b/src/apis/judge.js index 11af1c6..8d53737 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -227,9 +227,9 @@ export async function findJudgeImages(row) { ]); return { - arrFrecadImg: frecadImgs.data, - arrContadImg: contadImgs.data, - arrPicadImg: picadImgs.data + arrFrecadImg: frecadImgs, + arrContadImg: contadImgs, + arrPicadImg: picadImgs }; } return res; @@ -240,61 +240,11 @@ export async function saveJudgeResult(params) { return await axios.post(SAVE_JUDGE_RESULT, params); } -export async function findParkingImages2(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 res = await axios.get(GET_PARKING_IMAGE2 + row?.rcMaincode); - - return { - arrFrecadImg: [], - arrContadImg: [], - arrPicadImg: [] - }; -} - -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; - +export async function findParkingImages(rcMaincode) { 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) + await axios.get(GET_PARKING_FRECAD_IMAGE + rcMaincode), + await axios.get(GET_PARKING_CONTAD_IMAGE + rcMaincode), + await axios.get(GET_PARKING_PICAD_IMAGE + rcMaincode) ]); return { diff --git a/src/views/biz/judge/ProcessJudge.jsx b/src/views/biz/judge/ProcessJudge.jsx index e023ba9..6893218 100644 --- a/src/views/biz/judge/ProcessJudge.jsx +++ b/src/views/biz/judge/ProcessJudge.jsx @@ -22,6 +22,7 @@ const ProcessJudge = (props) => { const getImgList = (row) => { findJudgeImages(row).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; + console.log(arrFrecadImg, arrContadImg, arrPicadImg); setFrecadImgs(arrFrecadImg); setContadImgs(arrContadImg); setPicadImgs(arrPicadImg); @@ -142,11 +143,11 @@ const ProcessJudge = (props) => { label="위반일자" format="####-##-##" fullWidth - value={rowDatas[pageRef.current].msWdate} + value={rowDatas[pageRef.current]?.msWdate || ''} /> - + diff --git a/src/views/biz/judge/ProcessParkingJudge.jsx b/src/views/biz/judge/ProcessParkingJudge.jsx index 57d928c..19e9fda 100644 --- a/src/views/biz/judge/ProcessParkingJudge.jsx +++ b/src/views/biz/judge/ProcessParkingJudge.jsx @@ -20,7 +20,7 @@ const ProcessParkingJudge = (props) => { const [selectedImg, setSelectedImg] = useState({}); const getImgList = (row) => { - findParkingImages(row).then((res) => { + findParkingImages(row?.rcMaincode).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; console.log(arrFrecadImg, arrContadImg, arrPicadImg); setFrecadImgs(arrFrecadImg); @@ -97,17 +97,17 @@ const ProcessParkingJudge = (props) => { {frecadImgs?.map((img, idx) => ( - + ))} {contadImgs?.map((img, idx) => ( - + ))} {picadImgs?.map((img, idx) => ( - + ))} @@ -143,11 +143,11 @@ const ProcessParkingJudge = (props) => { label="위반일자" format="####-##-##" fullWidth - value={rowDatas[pageRef.current].msWdate} + value={rowDatas[pageRef.current]?.msWdate || ''} /> - +