|
|
|
@ -1,43 +1,29 @@
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import ReactPDF, { PDFViewer, Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer';
|
|
|
|
|
|
|
|
|
|
import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material';
|
|
|
|
|
import { Button, 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 BasicDocument from './BasicDocument';
|
|
|
|
|
|
|
|
|
|
// Create styles
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
page: {
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
backgroundColor: '#E4E4E4'
|
|
|
|
|
},
|
|
|
|
|
section: {
|
|
|
|
|
margin: 10,
|
|
|
|
|
padding: 10,
|
|
|
|
|
flexGrow: 1
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
import ImgItem from '../../cmm/ImgItem';
|
|
|
|
|
|
|
|
|
|
const ProcessJudge = (props) => {
|
|
|
|
|
const { rowDatas, setOpen, showAlert } = props;
|
|
|
|
|
const pageRef = useRef(0);
|
|
|
|
|
const totalPageRef = useRef(0);
|
|
|
|
|
const curDataRef = useRef({});
|
|
|
|
|
const [picadImgs, setPicadImgs] = useState([]);
|
|
|
|
|
const [frecadImgs, setFrecadImgs] = useState([]);
|
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
|
|
const [picadImgs, setPicadImgs] = 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);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -71,11 +57,13 @@ const ProcessJudge = (props) => {
|
|
|
|
|
setOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const printPdf = () => {
|
|
|
|
|
alert('적용예정');
|
|
|
|
|
// ReactPDF.render(<BasicDocument />, `${__dirname}/example.pdf`);
|
|
|
|
|
// ReactPDF.renderToStream(<BasicDocument />);
|
|
|
|
|
// ReactPDF.PDFViewer(<BasicDocument />);
|
|
|
|
|
const viewImage = (imgInfo) => () => {
|
|
|
|
|
if (imgInfo.url === '/images/noFile.png') {
|
|
|
|
|
showAlert.show(`업로드 파일[${imgInfo.imgName}]을 찾을수 없습니다`);
|
|
|
|
|
} else {
|
|
|
|
|
setSelectedImg(imgInfo);
|
|
|
|
|
}
|
|
|
|
|
// viewImages(imgName, url);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
@ -91,52 +79,33 @@ const ProcessJudge = (props) => {
|
|
|
|
|
<>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item xs={6.5}>
|
|
|
|
|
<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}>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{frecadImgs?.map((img, idx) => (
|
|
|
|
|
<Grid item xs={3} key={idx}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
component="img"
|
|
|
|
|
sx={{
|
|
|
|
|
height: 150
|
|
|
|
|
}}
|
|
|
|
|
src={img}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ImgItem idx={idx} title={`진술서${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container m={1} />
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
</ImageList>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{contadImgs?.map((img, idx) => (
|
|
|
|
|
<Grid item xs={3} key={idx}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
component="img"
|
|
|
|
|
sx={{
|
|
|
|
|
height: 150
|
|
|
|
|
}}
|
|
|
|
|
src={img}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ImgItem idx={idx} title={`첨부파일${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</Grid>
|
|
|
|
|
</ImageList>
|
|
|
|
|
<ImageList cols={4}>
|
|
|
|
|
{picadImgs?.map((img, idx) => (
|
|
|
|
|
<ImgItem idx={idx} title={`단속사진${idx + 1}`} imgInfo={img} onViewImage={viewImage} />
|
|
|
|
|
))}
|
|
|
|
|
</ImageList>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={5.5}>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<BasicDocument />
|
|
|
|
|
{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>
|
|
|
|
@ -221,11 +190,6 @@ const ProcessJudge = (props) => {
|
|
|
|
|
심의처리
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Button variant="contained" color="primary" size="small" onClick={printPdf}>
|
|
|
|
|
PDF
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Button variant="contained" color="primary" size="small" onClick={handleClose}>
|
|
|
|
|
닫기
|
|
|
|
|