From e9b1a7c4eb9e8cf5529a5e4c60e8c989acc6ce5e Mon Sep 17 00:00:00 2001 From: minuk926 Date: Wed, 13 Jul 2022 13:54:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20dashboard=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=A0=9C=EB=AA=A9=20=EC=83=89=EC=83=81=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 2 +- .env.production | 2 +- src/apis/judge.js | 35 +++++++++++++++++-- src/commons/ApiUrl.js | 1 + .../biz/judge/ParkingJudgeByUserReview.jsx | 20 ++++++----- src/views/biz/judge/ProcessJudge.jsx | 15 +++++--- src/views/biz/judge/ProcessParkingJudge.jsx | 8 ++--- src/views/biz/user/UserManager.jsx | 4 +-- src/views/biz/user/UserManagerForm.jsx | 1 + 9 files changed, 64 insertions(+), 24 deletions(-) diff --git a/.env.local b/.env.local index 47e637d..97aab2a 100644 --- a/.env.local +++ b/.env.local @@ -3,4 +3,4 @@ REACT_APP_MODE=local REACT_APP_VERSION = v0.0.1 REACT_APP_API_URL=http://localhost:8090 #REACT_APP_API_URL=http://211.119.124.73:8090 -REACT_APP_SERVER_TIMEOUT=6000 \ No newline at end of file +REACT_APP_SERVER_TIMEOUT=60000 \ No newline at end of file diff --git a/.env.production b/.env.production index 9afe313..6462870 100644 --- a/.env.production +++ b/.env.production @@ -4,4 +4,4 @@ REACT_APP_VERSION = v0.0.1 #REACT_APP_API_URL=http://localhost:8090 #REACT_APP_API_URL=http://211.119.124.9:8090 REACT_APP_API_URL=http://211.119.124.107:8090 -REACT_APP_SERVER_TIMEOUT=6000 \ No newline at end of file +REACT_APP_SERVER_TIMEOUT=60000 \ No newline at end of file diff --git a/src/apis/judge.js b/src/apis/judge.js index 57f16d1..4663d65 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -18,7 +18,8 @@ import { GET_JUDGE_LIST, SAVE_JUDGE_RESULT, SAVE_ADMIN_JUDGE_STDS, - GET_DASHBOARD + GET_DASHBOARD, + GET_PARKING_IMAGE } from 'commons/ApiUrl'; import { setRowId } from './common'; import FileSaver from 'file-saver'; @@ -209,7 +210,7 @@ async function judgeImgList(res, scCode, fieldCnt, fieldName, dataGb, methodName return arrRtn; } -export async function findImages(row) { +export async function findJudgeImages(row) { const dataGb = row?.msDatagb; const scCode = row?.msMaincode; @@ -234,3 +235,33 @@ export async function saveJudgeResult(params) { // eslint-disable-next-line no-return-await return await axios.post(SAVE_JUDGE_RESULT, params); } + +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 res = await axios.get(GET_PARKING_IMAGE + row?.rcMaincode); + + return { + arrFrecadImg: [], + arrContadImg: [], + arrPicadImg: [] + }; +} diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 4e425d4..19ca86c 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -44,6 +44,7 @@ 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_JUDGE_FILE_DOWNLOAD = '/api/v2/ctgy/cmm/download/judge'; diff --git a/src/views/biz/judge/ParkingJudgeByUserReview.jsx b/src/views/biz/judge/ParkingJudgeByUserReview.jsx index 7657b08..5d14aa0 100644 --- a/src/views/biz/judge/ParkingJudgeByUserReview.jsx +++ b/src/views/biz/judge/ParkingJudgeByUserReview.jsx @@ -18,6 +18,8 @@ import ProcessParkingJudge from './ProcessParkingJudge'; import useAuth from 'hooks/useAuth'; import Button from '@mui/material/Button'; import { useAlert } from 'react-alert'; +import PropTypes from 'prop-types'; +import JudgeByUserReview from './JudgeByUserReview'; const ParkingJudgeByUserReview = () => { const { user } = useAuth(); @@ -31,7 +33,7 @@ const ParkingJudgeByUserReview = () => { }); const [open, setOpen] = useState(false); const [title, setTitle] = useState(''); - const [rowDatas] = useState([]); + const [rowDatas, setRowDatas] = useState([]); const [minSdate, setMinSdate] = useState(''); const [maxEdate, setMaxEdate] = useState(''); const [minSeq, setMinSeq] = useState(0); @@ -55,18 +57,18 @@ const ParkingJudgeByUserReview = () => { }, []); const onJudge = () => { - // setRowDatas(rowsState?.rows); - // setTitle(`주정차 의견진술 심의 결정`); - // setOpen(true); - alert('적용예정'); + setRowDatas(rowsState?.rows); + setTitle(`주정차 의견진술 심의 결정`); + setOpen(true); + // alert('적용예정'); }; const processJudge = useCallback( (row) => () => { - // setRowDatas([row]); - // setTitle(`주정차 의견진술 심의 결정`); - // setOpen(true); - alert('적용예정'); + setRowDatas([row]); + setTitle(`주정차 의견진술 심의 결정`); + setOpen(true); + // alert('적용예정'); }, [] ); diff --git a/src/views/biz/judge/ProcessJudge.jsx b/src/views/biz/judge/ProcessJudge.jsx index 6c7a9d2..e023ba9 100644 --- a/src/views/biz/judge/ProcessJudge.jsx +++ b/src/views/biz/judge/ProcessJudge.jsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'; import PropTypes from 'prop-types'; import { Button, Divider, FormControl, Grid, ImageList, InputLabel, MenuItem, Select, TextField } from '@mui/material'; -import { findImages, saveJudgeResult } from 'apis/judge'; +import { findJudgeImages, saveJudgeResult } from 'apis/judge'; import { SkipNext, SkipPrevious, Save } from '@mui/icons-material'; import ImgItem from '../../cmm/ImgItem'; import NumberFormat from 'react-number-format'; @@ -20,7 +20,7 @@ const ProcessJudge = (props) => { const [selectedImg, setSelectedImg] = useState({}); const getImgList = (row) => { - findImages(row).then((res) => { + findJudgeImages(row).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; setFrecadImgs(arrFrecadImg); setContadImgs(arrContadImg); @@ -53,7 +53,12 @@ const ProcessJudge = (props) => { showAlert.show('결정사유는 필수 입력해야 합니다.'); return; } - saveJudgeResult({ msuCode: curDataRef.current.msuCode, msuResult: selectedResult, msuReason: reason }).then((res) => { + saveJudgeResult({ + msuCode: curDataRef.current.msuCode, + msuUserid: rowDatas[pageRef.current].msuUserid, + msuResult: selectedResult, + msuReason: reason + }).then((res) => { if (res?.success) { curDataRef.current.msuResult = selectedResult; curDataRef.current.msuReason = reason; @@ -137,11 +142,11 @@ const ProcessJudge = (props) => { label="위반일자" format="####-##-##" fullWidth - value={rowDatas[pageRef.current].scWdate} + value={rowDatas[pageRef.current].msWdate} /> - + diff --git a/src/views/biz/judge/ProcessParkingJudge.jsx b/src/views/biz/judge/ProcessParkingJudge.jsx index bbdaeb7..d14ee3a 100644 --- a/src/views/biz/judge/ProcessParkingJudge.jsx +++ b/src/views/biz/judge/ProcessParkingJudge.jsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'; import PropTypes from 'prop-types'; import { Button, Divider, FormControl, Grid, ImageList, InputLabel, MenuItem, Select, TextField } from '@mui/material'; -import { findImages, saveJudgeResult } from 'apis/judge'; +import { findJudgeImages, findParkingImages, saveJudgeResult } from 'apis/judge'; import { SkipNext, SkipPrevious, Save } from '@mui/icons-material'; import ImgItem from '../../cmm/ImgItem'; import NumberFormat from 'react-number-format'; @@ -20,7 +20,7 @@ const ProcessParkingJudge = (props) => { const [selectedImg, setSelectedImg] = useState({}); const getImgList = (row) => { - findImages(row).then((res) => { + findParkingImages(row).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; setFrecadImgs(arrFrecadImg); setContadImgs(arrContadImg); @@ -136,11 +136,11 @@ const ProcessParkingJudge = (props) => { label="위반일자" format="####-##-##" fullWidth - value={rowDatas[pageRef.current].scWdate} + value={rowDatas[pageRef.current].msWdate} /> - + diff --git a/src/views/biz/user/UserManager.jsx b/src/views/biz/user/UserManager.jsx index e0b473a..c0edf29 100644 --- a/src/views/biz/user/UserManager.jsx +++ b/src/views/biz/user/UserManager.jsx @@ -104,8 +104,8 @@ const UserManager = () => { align: 'center', width: 80, valueFormatter: (params) => (params.value === '0' ? '비활성' : '활성') - }, - { headerName: '구청코드', headerAlign: 'center', field: 'gu', align: 'right' } + } + // { headerName: '구청코드', headerAlign: 'center', field: 'gu', align: 'right' } ]; // 리스트 조회 const search = useCallback(() => { diff --git a/src/views/biz/user/UserManagerForm.jsx b/src/views/biz/user/UserManagerForm.jsx index 1eda86f..128f792 100644 --- a/src/views/biz/user/UserManagerForm.jsx +++ b/src/views/biz/user/UserManagerForm.jsx @@ -96,6 +96,7 @@ const UserManagementForm = (props) => {