fix: 거주지/장애인 상세 목록 반영

main
minuk926 3 years ago
parent 2d5c549f59
commit e21993241c

@ -16,9 +16,10 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import xitCmm from 'commons/XitCmm'; import xitCmm from 'commons/XitCmm';
import InputLabel from 'ui-component/extended/Form/InputLabel'; import InputLabel from 'ui-component/extended/Form/InputLabel';
import { findJudge, findJudgeDetails, findJudges } from 'apis/judge'; import { findJudgeDetails, findJudges } from 'apis/judge';
import CmmModal from 'views/form/Modal/CmmModal'; import CmmModal from 'views/form/Modal/CmmModal';
import ModalJudgeDetail from './ModalJudgeDetail'; import ModalJudgeDetail from './ModalJudgeDetail';
import PropTypes from 'prop-types';
const JudgeReview = ({ msDatagb, menuName }) => { const JudgeReview = ({ msDatagb, menuName }) => {
const isInit = useRef(true); const isInit = useRef(true);
@ -41,9 +42,9 @@ const JudgeReview = ({ msDatagb, menuName }) => {
// loading: false // loading: false
}); });
const [judgeDetailData, setJudgeDetailData] = useState({ const [judgeDetailData, setJudgeDetailData] = useState({
totData: [], totJudgeUserData: [],
judgeData: [], judgeData: [],
colNames: [] simsaUser: []
}); });
const removeJudge = useCallback( const removeJudge = useCallback(
@ -140,9 +141,6 @@ const JudgeReview = ({ msDatagb, menuName }) => {
const handleOnCellClick = async (e) => { const handleOnCellClick = async (e) => {
if (e?.field === 'msDate') { if (e?.field === 'msDate') {
// findJudge(e.row?.msDate).then((res) => {
// setRowData(res.data);
// setCreate(false);
const params = { const params = {
msDatagb: e.row.msDatagb, msDatagb: e.row.msDatagb,
msSdate: e.row.msSdate, msSdate: e.row.msSdate,
@ -154,6 +152,16 @@ const JudgeReview = ({ msDatagb, menuName }) => {
await findJudgeDetails(params).then((response) => { await findJudgeDetails(params).then((response) => {
if (response && response.data) { if (response && response.data) {
const totData = response.data?.totData; const totData = response.data?.totData;
// tot
const totUserData = [[], [], [], []];
totData.forEach((data) => {
totUserData[0].push(data.BU);
totUserData[1].push(data.SEO);
totUserData[2].push(data.MIBU);
totUserData[3].push(data.TOT);
});
const judgeDataList = response.data?.judgeData; const judgeDataList = response.data?.judgeData;
const rows = judgeDataList.map((m) => { const rows = judgeDataList.map((m) => {
let result = { ...m }; let result = { ...m };
@ -174,9 +182,9 @@ const JudgeReview = ({ msDatagb, menuName }) => {
setJudgeDetailData({ setJudgeDetailData({
...judgeDetailData, ...judgeDetailData,
totData, totUserData,
judgeData: response.data?.judgeData, judgeData: response.data?.judgeData,
colNames: cols simsaUser: judgeDataList[0].simsa
}); });
setTitle(`${menuName} 의견진술 심의 상세 목록`); setTitle(`${menuName} 의견진술 심의 상세 목록`);
@ -246,4 +254,9 @@ const JudgeReview = ({ msDatagb, menuName }) => {
</MainCard> </MainCard>
); );
}; };
JudgeReview.propTypes = {
msDatagb: PropTypes.string.isRequired,
menuName: PropTypes.string.isRequired
};
export default JudgeReview; export default JudgeReview;

@ -1,132 +1,117 @@
import Board from '../board/Board'; import Paper from '@mui/material/Paper';
import { useCallback, useEffect, useMemo, useState } from 'react'; import Table from '@mui/material/Table';
import { findJudge, findJudgeDetails } from 'apis/judge'; import TableBody from '@mui/material/TableBody';
import { import TableCell, { tableCellClasses } from '@mui/material/TableCell';
Box, import TableContainer from '@mui/material/TableContainer';
Checkbox, import TableHead from '@mui/material/TableHead';
IconButton, import TableRow from '@mui/material/TableRow';
Table, import { styled } from '@mui/material/styles';
TableBody, import { Divider, Grid } from '@mui/material';
TableCell, import PropTypes from 'prop-types';
TableContainer,
TableHead,
TablePagination,
TableSortLabel,
TableRow,
Toolbar,
Tooltip,
Typography
} from '@mui/material';
import { visuallyHidden } from '@mui/utils';
// project imports const StyledTableCell = styled(TableCell)(({ theme }) => ({
import MainCard from 'ui-component/cards/MainCard'; [`&.${tableCellClasses.head}`]: {
backgroundColor: theme.palette.common.black,
color: theme.palette.common.white
},
[`&.${tableCellClasses.body}`]: {
// fontSize: 14
}
}));
const ModalJudgeDetail = ({ totData, judgeData, colNames }) => { const StyledTableRow = styled(TableRow)(({ theme }) => ({
// const [rowData, setRowData] = useState({}); '&:nth-of-type(odd)': {
// backgroundColor: theme.palette.action.hover
// const [totalCount, setTotalCount] = useState(0); },
// const [rowsState, setRowsState] = useState({ // hide last border
// page: 0, '&:last-child td, &:last-child th': {
// pageSize: 20, border: 0
// rows: [] }
// // loading: false }));
// });
// const [rows, setRows] = useState([]);
//
// const columns = [];
//
// const tableHeader = null;
/* const ModalJudgeDetail = ({ totJudgeUserData, judgeData, simsaUser }) => {
const search = useCallback(() => { const totLabel = ['부과', '서손', '미부과', '계'];
const params = {
msDatagb,
msSdate,
msEdate,
msChasu,
msuTeam
};
findJudgeDetails(params).then((response) => {
if (response && response.data) {
console.log(response.data);
const totUserList = response.data?.totUserList;
const resultList = response.data?.resultList;
setRows(() => {
resultList.map((m) => {
let result = { ...m };
const users = [...m.simsa];
delete result.simsa;
users.map((u) => {
result = { ...result, [u.NAME]: u.msResult };
return result;
});
return result;
// return users.map((u) => ({ ...result, [u.NAME]: u.msResult }));
});
Object.keys(rows[0]).forEach((k) => {
columns.push(k);
});
});
// Object.keys(gridRows[0]).forEach((k) => {
// // console.log(k, v);
// columns.push({ headerName: k, headerAlign: 'center', field: k, align: 'center' });
// });
// setColdef(columns);
// for (const k in gridRows[0]) {
// columns.push({ headerName: k, headerAlign: 'center', field: k, align: 'center' });
// }
setTotalCount(rows.length);
setRowsState((prevState) => ({ ...prevState, rows }));
// apiRef.current.forceUpdate(); // .updateRowData([]);
// apiRef.current.updateRowData([]);
}
});
}, [msDatagb, msSdate, msEdate, msChasu, msuTeam]);
*/
const init = useMemo(() => {
console.log(totData, judgeData, colNames);
}, []);
// useEffect(() => {
// // if (isInit.current) {
// // isInit.current = false;
// // return;
// // }
// init();
// // }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
// }, []);
return ( return (
<MainCard content={false}> <Paper sx={{ width: '100%', overflow: 'hidden' }}>
<TableContainer> <TableContainer sx={{ maxHeight: 440 }}>
<Table sx={{ minWidth: 650 }} size="small" aria-label="a dense table"> <Table stickyHeader aria-label="sticky table">
<TableHead> <TableHead>
<TableRow> <TableRow>
{colNames.map((name, idx) => ( {/* <StyledTableCell align="center" style={{ minWidth: 80 }} hidden> */}
<TableCell sx={{ pl: 3 }}>{name}</TableCell> {/* 민원코드 */}
{/* </StyledTableCell> */}
<StyledTableCell align="center" style={{ width: 180 }}>
접수번호
</StyledTableCell>
<StyledTableCell align="center" style={{ width: 180 }}>
차량번호
</StyledTableCell>
{simsaUser.map((u) => (
<StyledTableCell align="center" style={{ width: 180 }}>
{u.NAME}
</StyledTableCell>
))} ))}
<StyledTableCell align="center" style={{ width: 180 }}>
결과
</StyledTableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
{/* 심사 통계 */}
{totJudgeUserData.map((totData, idx) => (
<StyledTableRow hover key={idx}>
<StyledTableCell align="center" style={{ width: 180 }}>
{totLabel[idx]}
</StyledTableCell>
<StyledTableCell align="center" style={{ width: 180 }} />
{totData.map((data) => (
<StyledTableCell align="center" style={{ width: 180 }}>
{data}
</StyledTableCell>
))}
</StyledTableRow>
))}
</TableBody>
<TableBody sx={{ mt: 3 }}>
<Grid item xs={12}>
<Divider />
<Divider />
</Grid>
{/* 접수번호별 심사 결과 */}
{judgeData.map((row) => ( {judgeData.map((row) => (
<TableRow hover key={row.scSeq}> <StyledTableRow hover key={row.msSeq}>
<TableCell sx={{ pl: 3 }} component="th" scope="row"> {/* <StyledTableCell>{row.msMaincode}</StyledTableCell> */}
{row.scSeq} <StyledTableCell align="center" style={{ width: 180 }}>
</TableCell> {row.msSeq}
<TableCell align="right">{row.scCarnum}</TableCell> </StyledTableCell>
</TableRow> <StyledTableCell align="center" style={{ width: 180 }}>
{row.msCarnum}
</StyledTableCell>
{/* 심사위원별 심사결과 */}
{row.simsa.map((r) => (
<StyledTableCell align="center" style={{ width: 180 }}>
{r.msuResult}
</StyledTableCell>
))}
{/* 최종심사결과 */}
<StyledTableCell align="center" style={{ width: 180 }}>
{row.simsa[0].msResult}
</StyledTableCell>
</StyledTableRow>
))} ))}
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>
</MainCard> </Paper>
); );
}; };
ModalJudgeDetail.propTypes = {
totJudgeUserData: PropTypes.array.isRequired,
judgeData: PropTypes.array.isRequired,
simsaUser: PropTypes.array.isRequired
};
export default ModalJudgeDetail; export default ModalJudgeDetail;

@ -0,0 +1,139 @@
import Board from '../board/Board';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { findJudge, findJudgeDetails } from 'apis/judge';
import {
Box,
Checkbox,
IconButton,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TablePagination,
TableSortLabel,
TableRow,
Toolbar,
Tooltip,
Typography
} from '@mui/material';
import { visuallyHidden } from '@mui/utils';
// project imports
import MainCard from 'ui-component/cards/MainCard';
const ModalJudgeDetail = ({ totData, judgeData, simsaUser, colNames }) => {
// const [rowData, setRowData] = useState({});
//
// const [totalCount, setTotalCount] = useState(0);
// const [rowsState, setRowsState] = useState({
// page: 0,
// pageSize: 20,
// rows: []
// // loading: false
// });
// const [rows, setRows] = useState([]);
//
// const columns = [];
//
// const tableHeader = null;
/*
const search = useCallback(() => {
const params = {
msDatagb,
msSdate,
msEdate,
msChasu,
msuTeam
};
findJudgeDetails(params).then((response) => {
if (response && response.data) {
console.log(response.data);
const totUserList = response.data?.totUserList;
const resultList = response.data?.resultList;
setRows(() => {
resultList.map((m) => {
let result = { ...m };
const users = [...m.simsa];
delete result.simsa;
users.map((u) => {
result = { ...result, [u.NAME]: u.msResult };
return result;
});
return result;
// return users.map((u) => ({ ...result, [u.NAME]: u.msResult }));
});
Object.keys(rows[0]).forEach((k) => {
columns.push(k);
});
});
// Object.keys(gridRows[0]).forEach((k) => {
// // console.log(k, v);
// columns.push({ headerName: k, headerAlign: 'center', field: k, align: 'center' });
// });
// setColdef(columns);
// for (const k in gridRows[0]) {
// columns.push({ headerName: k, headerAlign: 'center', field: k, align: 'center' });
// }
setTotalCount(rows.length);
setRowsState((prevState) => ({ ...prevState, rows }));
// apiRef.current.forceUpdate(); // .updateRowData([]);
// apiRef.current.updateRowData([]);
}
});
}, [msDatagb, msSdate, msEdate, msChasu, msuTeam]);
*/
const init = useMemo(() => {
console.log(totData, judgeData, simsaUser, colNames);
}, []);
// useEffect(() => {
// // if (isInit.current) {
// // isInit.current = false;
// // return;
// // }
// init();
// // }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
// }, []);
return (
<MainCard content={false}>
<TableContainer>
<Table sx={{ minWidth: 850, width: 1000 }} size="small" aria-label="a dense table">
<TableHead>
<TableRow key="-1">
<TableCell sx={{ pl: 3, visibility: false }}>민원코드</TableCell>
<TableCell sx={{ pl: 3 }}>접수번호</TableCell>
<TableCell sx={{ pl: 3 }}>차량번호</TableCell>
{simsaUser.map((u, idx) => (
<TableCell sx={{ pl: 3 }}>{u.NAME}</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{judgeData.map((row) => (
<TableRow hover key={row.msSeq}>
<TableCell sx={{ pl: 3 }} component="th" scope="row">
{row.msMaincode}
</TableCell>
<TableCell>{row.msSeq}</TableCell>
<TableCell>{row.msCarnum}</TableCell>
{row.simsa.map((r) => (
<TableCell>{r.msuResult}</TableCell>
))}
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</MainCard>
);
};
export default ModalJudgeDetail;

@ -11,6 +11,7 @@ import CmmModal from 'views/form/Modal/CmmModal';
import { findJudge, findJudgeDatas, saveJudgeData } from 'apis/judge'; import { findJudge, findJudgeDatas, saveJudgeData } from 'apis/judge';
import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm'; import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm';
import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm'; import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm';
import PropTypes from 'prop-types';
const ResidentDataReview = ({ scDatagb, menuName }) => { const ResidentDataReview = ({ scDatagb, menuName }) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -126,4 +127,9 @@ const ResidentDataReview = ({ scDatagb, menuName }) => {
</MainCard> </MainCard>
); );
}; };
ResidentDataReview.propTypes = {
scDatagb: PropTypes.string.isRequired,
menuName: PropTypes.string.isRequired
};
export default ResidentDataReview; export default ResidentDataReview;

@ -4,14 +4,13 @@ import { useEffect, useState } from 'react';
import { Button, Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select, Link } from '@mui/material'; import { Button, Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select, Link } from '@mui/material';
// assets // assets
import { IconSearch, IconFileText } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
// berry ui // berry ui
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import { getBoardList } from '../../../apis/user';
import CmmModal from '../../form/Modal/CmmModal'; import CmmModal from '../../form/Modal/CmmModal';
import UserManagerForm from './UserManagerForm'; import UserManagerForm from './UserManagerForm';
import { deletePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public'; import { deletePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public';

@ -1,136 +1,43 @@
import { useMemo, useRef, useState } from 'react'; import { useState } from 'react';
import { useAlert } from 'react-alert';
// material-ui // material-ui
import { Button, FormControl, Grid, MenuItem, Select, TextField } from '@mui/material'; import { Button, Grid, TextField } from '@mui/material';
// assets
// berry ui // berry ui
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css'; import 'react-quill/dist/quill.snow.css';
// project imports // project imports
import InputLabel from 'ui-component/extended/Form/InputLabel';
import { Delete, List, Save } from '@mui/icons-material'; import { Delete, List, Save } from '@mui/icons-material';
import { fileDownload } from '../../../apis/common';
import FileForm from 'views/form/FileForm';
const PublicBoardForm = (props) => { const PublicBoardForm = (props) => {
// eslint-disable-next-line react/prop-types // eslint-disable-next-line react/prop-types
const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props; const { create, inCode, inHit, inName, inNalja, setOpen, handleModalSave } = props;
const alert = useAlert(); const [subject, setSubject] = useState();
const quillRef = useRef();
const [dept, setDept] = useState(inDept || '주정차위반');
const [subject, setSubject] = useState(inTitle || '');
const [contents, setContents] = useState(inContents || '');
const [filesInfo, setFilesInfo] = useState();
const [selectedFile, setSelectedFile] = useState(inFilename || ''); //
// const [fileData, setFileData] = useState(); // const [fileData, setFileData] = useState();
const onList = () => { const onList = () => {
setOpen(false); setOpen(false);
}; };
const onSave = () => { const onSave = () => {
// TODO : validation check // // TODO : validation check
const formData = new FormData(); // const formData = new FormData();
formData.append('inCode', inCode ?? ''); // formData.append('inCode', inCode ?? '');
formData.append('inTitle', subject); // formData.append('inTitle', subject);
formData.append('inDept', dept); // formData.append('inDept', dept);
formData.append('inContents', contents); // formData.append('inContents', contents);
formData.append('inFilename', selectedFile ?? ''); // formData.append('inFilename', selectedFile ?? '');
//
if (filesInfo && filesInfo.length > 0) { // if (filesInfo && filesInfo.length > 0) {
// eslint-disable-next-line no-plusplus // // eslint-disable-next-line no-plusplus
for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]); // for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]);
} // }
handleModalSave('SAVE', formData); // handleModalSave('SAVE', formData);
}; };
const onDelete = () => { const onDelete = () => {
handleModalSave('DELETE', inCode); handleModalSave('DELETE', inCode);
}; };
const imageHandler = () => {
const input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/*');
input.click();
input.onchange = async () => {
if (input.files) {
const file = input.files[0];
const formData = new FormData();
formData.append('image', file);
console.log(formData);
// input
input.onchange = async () => {
const file = input.files;
if (file !== null) {
formData.append('image', file[0]);
try {
//
// const res = await axios.get('/');
//
const url = '/Users/minuk/Pictures/test.png';
//
const range = quillRef.current?.getEditor().getSelection()?.index;
if (range !== null && range !== undefined) {
const quill = quillRef.current?.getEditor();
quill?.setSelection(range, 1);
quill?.clipboard.dangerouslyPasteHTML(range, `<img src=${url} alt="이미지 태그가 삽입됩니다." />`);
}
} catch (error) {
console.log(error);
}
}
};
}
};
};
const modules = useMemo(
() => ({
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike', 'blockquote'],
[{ size: ['small', false, 'large', 'huge'] }, { color: [] }],
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }, { align: [] }]
// ['image', 'video']
],
handlers: {
image: imageHandler
}
}
}),
[]
);
const onChangeFile = (file) => {
setSelectedFile(file.name);
setFilesInfo([file]);
};
// const onChangeFile = (e) => {
// setSelectedFile(e.target.files[0].name);
// setFilesInfo(e.target.files);
// };
const handleFileDownload = () => {
if (!inFilename) {
alert.show('등록된 파일이 없습니다.');
return;
}
fileDownload(inCode, inFilename, alert).then(() => {});
};
return ( return (
<> <>
<Grid mt={2}> <Grid mt={2}>

@ -6,15 +6,15 @@ import CloseOutlined from '@mui/icons-material/CloseOutlined';
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
const style = { const style = {
position: 'absolute', position: 'relative',
top: '50%', top: '50%',
left: '50%', left: '50%',
transform: 'translate(-50%, -50%)', transform: 'translate(-50%, -50%)',
width: 900, width: 1000,
bgcolor: 'background.paper', bgcolor: 'background.paper',
border: '2px solid #000', border: '2px solid #000',
boxShadow: 24, boxShadow: 24,
p: 4 p: 3
}; };
const CmmModal = ({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) => { const CmmModal = ({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) => {

@ -9,8 +9,7 @@ import Box from '@mui/material/Box';
import { useTheme } from '@mui/styles'; import { useTheme } from '@mui/styles';
import dataGridKoKR from './defaultDataGridLocale'; import dataGridKoKR from './defaultDataGridLocale';
import CustomPagination from './CustomPagination'; import CustomPagination from './CustomPagination';
import { IconButton, Toolbar, Tooltip, Typography } from '@mui/material'; import { Toolbar } from '@mui/material';
import DeleteIcon from '@mui/icons-material/Delete';
// TODO : grid style // TODO : grid style
/* /*

Loading…
Cancel
Save