|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material';
|
|
|
|
|
import { Button, CardMedia, Divider, FormControl, Grid, ImageList, InputLabel, MenuItem, Select, TextField } from '@mui/material';
|
|
|
|
|
import { findImages, saveJudgeResult } from 'apis/judge';
|
|
|
|
|
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
|
|
|
|
|
import ImgItem from '../../cmm/ImgItem';
|
|
|
|
|
|
|
|
|
|
const ProcessParkingJudge = (props) => {
|
|
|
|
|
const { rowDatas, setOpen, showAlert } = props;
|
|
|
|
@ -15,13 +16,14 @@ const ProcessParkingJudge = (props) => {
|
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
|
|
const [reason, setReason] = useState();
|
|
|
|
|
const [selectedResult, setSelectedResult] = useState();
|
|
|
|
|
const [selectedImg, setSelectedImg] = useState({});
|
|
|
|
|
|
|
|
|
|
const getImgList = (row) => {
|
|
|
|
|
findImages(row, showAlert).then((res) => {
|
|
|
|
|
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
|
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
|
const { arrFrecadImg, arrContadImg, arrPicadImg } = res;
|
|
|
|
|
setFrecadImgs(arrFrecadImg);
|
|
|
|
|
setContadImgs(arrContadImg);
|
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -55,6 +57,15 @@ const ProcessParkingJudge = (props) => {
|
|
|
|
|
setOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const viewImage = (imgInfo) => () => {
|
|
|
|
|
if (imgInfo.url === '/images/noFile.png') {
|
|
|
|
|
showAlert.show(`업로드 파일[${imgInfo.imgName}]을 찾을수 없습니다`);
|
|
|
|
|
} else {
|
|
|
|
|
setSelectedImg(imgInfo);
|
|
|
|
|
}
|
|
|
|
|
// viewImages(imgName, url);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
pageRef.current = 0;
|
|
|
|
|
totalPageRef.current = rowDatas.length - 1;
|
|
|
|
@ -67,97 +78,89 @@ const ProcessParkingJudge = (props) => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
{picadImgs?.map((img, idx) => (
|
|
|
|
|
<Grid item xs={3} key={idx}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
component="img"
|
|
|
|
|
sx={{
|
|
|
|
|
height: 150
|
|
|
|
|
}}
|
|
|
|
|
src={img}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
))}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container m={1} />
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
{frecadImgs?.map((img, idx) => (
|
|
|
|
|
<Grid item xs={3} key={idx}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
component="img"
|
|
|
|
|
sx={{
|
|
|
|
|
height: 150
|
|
|
|
|
}}
|
|
|
|
|
src={img}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
))}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container m={1} />
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
{contadImgs?.map((img, idx) => (
|
|
|
|
|
<Grid item xs={3} key={idx}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
component="img"
|
|
|
|
|
sx={{
|
|
|
|
|
height: 150
|
|
|
|
|
}}
|
|
|
|
|
src={img}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
))}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container m={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Divider />
|
|
|
|
|
<Grid item xs={6.5}>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{frecadImgs?.map((img, idx) => (
|
|
|
|
|
<ImgItem idx={idx} title={`진술서${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</ImageList>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{contadImgs?.map((img, idx) => (
|
|
|
|
|
<ImgItem idx={idx} title={`첨부파일${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</ImageList>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{picadImgs?.map((img, idx) => (
|
|
|
|
|
<ImgItem idx={idx} title={`단속사진${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</ImageList>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container spacing={1} mt={1}>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<TextField size="small" required disabled label="접수번호" fullWidth value={rowDatas[pageRef.current].msSeq} />
|
|
|
|
|
<Grid item xs={5.5}>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
{selectedImg && (
|
|
|
|
|
<img
|
|
|
|
|
src={selectedImg.url}
|
|
|
|
|
srcSet={`${selectedImg.url}?w=400&h=400&fit=crop&auto=format&dpr=2 2x`}
|
|
|
|
|
alt={selectedImg.imgName}
|
|
|
|
|
loading="lazy"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<TextField size="small" required disabled label="위반일자" fullWidth value={rowDatas[pageRef.current].scWdate} />
|
|
|
|
|
<Grid container m={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Divider />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField size="small" required disabled label="위반장소" fullWidth value={rowDatas[pageRef.current].scPos} />
|
|
|
|
|
<Grid container spacing={1} mt={1}>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<TextField size="small" required disabled label="접수번호" fullWidth value={rowDatas[pageRef.current].msSeq} />
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<TextField size="small" required disabled label="위반일자" fullWidth value={rowDatas[pageRef.current].scWdate} />
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField size="small" required disabled label="위반장소" fullWidth value={rowDatas[pageRef.current].scPos} />
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel disabled required>
|
|
|
|
|
심의결정
|
|
|
|
|
</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
size="small"
|
|
|
|
|
defaultValue={selectedResult || '1'}
|
|
|
|
|
value={selectedResult || '1'}
|
|
|
|
|
onChange={(e) => setSelectedResult(e?.target?.value)}
|
|
|
|
|
>
|
|
|
|
|
<MenuItem key="0" value="0">
|
|
|
|
|
심의전
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem key="1" value="1">
|
|
|
|
|
수용
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem key="2" value="2">
|
|
|
|
|
미수용
|
|
|
|
|
</MenuItem>
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={2}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel disabled required>
|
|
|
|
|
심의결정
|
|
|
|
|
</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
<Grid container spacing={1} mt={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
size="small"
|
|
|
|
|
defaultValue={selectedResult || '1'}
|
|
|
|
|
value={selectedResult || '1'}
|
|
|
|
|
onChange={(e) => setSelectedResult(e?.target?.value)}
|
|
|
|
|
>
|
|
|
|
|
<MenuItem key="0" value="0">
|
|
|
|
|
심의전
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem key="1" value="1">
|
|
|
|
|
수용
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem key="2" value="2">
|
|
|
|
|
미수용
|
|
|
|
|
</MenuItem>
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container spacing={1} mt={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
size="small"
|
|
|
|
|
multiline
|
|
|
|
|
rows={2}
|
|
|
|
|
required
|
|
|
|
|
label="결정사유"
|
|
|
|
|
fullWidth
|
|
|
|
|
value={reason}
|
|
|
|
|
onChange={(e) => setReason(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
multiline
|
|
|
|
|
rows={2}
|
|
|
|
|
required
|
|
|
|
|
label="결정사유"
|
|
|
|
|
fullWidth
|
|
|
|
|
value={reason}
|
|
|
|
|
onChange={(e) => setReason(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container spacing={1} m={0.5}>
|
|
|
|
|