|
|
@ -1,10 +1,15 @@
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
import { CardMedia, Grid } from '@mui/material';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { findImages } from '../../../apis/judge';
|
|
|
|
|
|
|
|
import _ from 'lodash';
|
|
|
|
import { Button, CardMedia, Divider, Grid } from '@mui/material';
|
|
|
|
|
|
|
|
import { findImages } from 'apis/judge';
|
|
|
|
|
|
|
|
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
|
|
|
|
|
|
|
|
|
|
|
|
const ProcessJudge = (props) => {
|
|
|
|
const ProcessJudge = (props) => {
|
|
|
|
const { rowDatas, showAlert } = props;
|
|
|
|
const { setTitle, rowDatas, showAlert } = props;
|
|
|
|
|
|
|
|
const title = rowDatas[0].msDatagb === '1' ? '거주자 심의' : '장애인 심의';
|
|
|
|
|
|
|
|
const pageRef = useRef(0);
|
|
|
|
|
|
|
|
const totalPageRef = useRef(0);
|
|
|
|
const [picadImgs, setPicadImgs] = useState([]);
|
|
|
|
const [picadImgs, setPicadImgs] = useState([]);
|
|
|
|
const [frecadImgs, setFrecadImgs] = useState([]);
|
|
|
|
const [frecadImgs, setFrecadImgs] = useState([]);
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
@ -13,20 +18,36 @@ const ProcessJudge = (props) => {
|
|
|
|
findImages(row, showAlert).then((res) => {
|
|
|
|
findImages(row, showAlert).then((res) => {
|
|
|
|
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
|
|
|
|
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
// console.log(arrPicadImg, arrFrecadImg, arrContadImg);
|
|
|
|
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
setFrecadImgs(arrFrecadImg);
|
|
|
|
setFrecadImgs(arrFrecadImg);
|
|
|
|
setContadImgs(arrContadImg);
|
|
|
|
setContadImgs(arrContadImg);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onPrev = () => {
|
|
|
|
|
|
|
|
pageRef.current -= 1;
|
|
|
|
|
|
|
|
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
|
|
|
|
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
|
|
|
|
console.log(pageRef.current, rowDatas[pageRef.current]);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const onNext = () => {
|
|
|
|
|
|
|
|
pageRef.current += 1;
|
|
|
|
|
|
|
|
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
|
|
|
|
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
|
|
|
|
console.log(pageRef.current, rowDatas[pageRef.current]);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const onSave = () => {};
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
getImgList(rowDatas[0]);
|
|
|
|
pageRef.current = 0;
|
|
|
|
|
|
|
|
totalPageRef.current = rowDatas.length - 1;
|
|
|
|
|
|
|
|
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
|
|
|
|
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
<Grid container columnSpacing={{ xs: 1 }}>
|
|
|
|
{picadImgs?.map((img, idx) => (
|
|
|
|
{picadImgs?.map((img, idx) => (
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
|
<CardMedia
|
|
|
|
<CardMedia
|
|
|
@ -42,6 +63,7 @@ const ProcessJudge = (props) => {
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid container item xs={12} m={1} />
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
{frecadImgs?.map((img, idx) => (
|
|
|
|
{frecadImgs?.map((img, idx) => (
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
@ -58,6 +80,7 @@ const ProcessJudge = (props) => {
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid container item xs={12} m={1} />
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
{contadImgs?.map((img, idx) => (
|
|
|
|
{contadImgs?.map((img, idx) => (
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
|
<Grid item xs={3} key={idx} columnSpacing={1}>
|
|
|
@ -74,13 +97,42 @@ const ProcessJudge = (props) => {
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid container item xs={12} m={1}>
|
|
|
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid item container spacing={0.5} xs={12} mt={1}>
|
|
|
|
|
|
|
|
<Grid item>
|
|
|
|
|
|
|
|
<Button disabled={pageRef.current === 0} variant="contained" size="small" startIcon={<SkipPrevious />} onClick={onPrev}>
|
|
|
|
|
|
|
|
이전
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid item>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
disabled={pageRef.current === totalPageRef.current}
|
|
|
|
|
|
|
|
variant="contained"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
endIcon={<SkipNext />}
|
|
|
|
|
|
|
|
onClick={onNext}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
다음
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid item style={{ marginLeft: 'auto' }}>
|
|
|
|
|
|
|
|
<Button variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
|
|
|
|
|
|
|
|
저장
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// ProcessJudge.propTypes = {
|
|
|
|
ProcessJudge.propTypes = {
|
|
|
|
// rowDatas: PropTypes.object.isRequired,
|
|
|
|
rowDatas: PropTypes.object.isRequired,
|
|
|
|
// showAlert: PropTypes.object
|
|
|
|
showAlert: PropTypes.object,
|
|
|
|
// };
|
|
|
|
setTitle: PropTypes.func.isRequired
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default ProcessJudge;
|
|
|
|
export default ProcessJudge;
|
|
|
|