|
|
|
@ -16,14 +16,21 @@ import MainCard from 'ui-component/cards/MainCard';
|
|
|
|
|
import MuiDataGrid from 'views/form/MuiDataGrid';
|
|
|
|
|
import xitCmm from 'commons/XitCmm';
|
|
|
|
|
import InputLabel from 'ui-component/extended/Form/InputLabel';
|
|
|
|
|
import { findJudges } from 'apis/judge';
|
|
|
|
|
import { findJudge, findJudges } from 'apis/judge';
|
|
|
|
|
import CmmModal from 'views/form/Modal/CmmModal';
|
|
|
|
|
import ModalJudgeDetail from './ModalJudgeDetail';
|
|
|
|
|
|
|
|
|
|
const ResidentReview = () => {
|
|
|
|
|
const JudgeReview = ({ msDatagb, menuName }) => {
|
|
|
|
|
const isInit = useRef(true);
|
|
|
|
|
const year = getYear(new Date());
|
|
|
|
|
console.log(typeof year);
|
|
|
|
|
const years = _.range(year, year - 14, -1);
|
|
|
|
|
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
// const [create, setCreate] = useState(false);
|
|
|
|
|
// const [selectedRow, setSelectedRow] = useState({});
|
|
|
|
|
const [title, setTitle] = useState();
|
|
|
|
|
|
|
|
|
|
const [selectedYear, setSelectedYear] = useState(year);
|
|
|
|
|
const [searchTxt, setSearchTxt] = useState('');
|
|
|
|
|
|
|
|
|
@ -34,7 +41,8 @@ const ResidentReview = () => {
|
|
|
|
|
rows: []
|
|
|
|
|
// loading: false
|
|
|
|
|
});
|
|
|
|
|
const removeSimsa = useCallback(
|
|
|
|
|
const [selectedRowData, setSelectedRowData] = useState({});
|
|
|
|
|
const removeJudge = useCallback(
|
|
|
|
|
(row) => () => {
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId));
|
|
|
|
@ -45,24 +53,6 @@ const ResidentReview = () => {
|
|
|
|
|
[]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const openModalDetails = () => {};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ms_maincode : '민원코드'
|
|
|
|
|
ms_seq : '접수번호'
|
|
|
|
|
ms_carnum : '차량번호'
|
|
|
|
|
ms_year : '년도'
|
|
|
|
|
ms_chasu : '차수'
|
|
|
|
|
ms_sdate : '심사시작일시'
|
|
|
|
|
ms_startsi : '심사시작시간'
|
|
|
|
|
ms_edate : '심사종료일시'
|
|
|
|
|
ms_cdate : '심사마감일시'
|
|
|
|
|
ms_closesi : '심사마감시간'
|
|
|
|
|
ms_wdate : '단속일자'
|
|
|
|
|
ms_pos : '단속장소'
|
|
|
|
|
ms_result : '결과코드'
|
|
|
|
|
ms_jbtime : '단속시간'
|
|
|
|
|
*/
|
|
|
|
|
const columns = [
|
|
|
|
|
// { headerName: 'rowId', field: 'rowId' },
|
|
|
|
|
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center' },
|
|
|
|
@ -75,19 +65,9 @@ const ResidentReview = () => {
|
|
|
|
|
description: '심사기간',
|
|
|
|
|
valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`,
|
|
|
|
|
renderCell: (params) => (
|
|
|
|
|
// <Link underline="hover" href="/parking/details" rel="noopener">
|
|
|
|
|
<Link
|
|
|
|
|
underline="hover"
|
|
|
|
|
// onClick={() => navigate(`/parking/details?msChasu=${params.msChasu}&msSdate=${params.msSdate}&msEdate=${params.msEdate}`)}
|
|
|
|
|
onClick={openModalDetails}
|
|
|
|
|
data-target="modalDetails"
|
|
|
|
|
rel="noopener"
|
|
|
|
|
>
|
|
|
|
|
{/* <Link underline="hover" href="#" onClick={() => <ModalDetails />}> */}
|
|
|
|
|
{/* <Link underline="hover" onClick={() => <ModalDetails />}> */}
|
|
|
|
|
<Link underline="hover" href="#">
|
|
|
|
|
{params.value}
|
|
|
|
|
</Link>
|
|
|
|
|
// <ModalDetails />
|
|
|
|
|
),
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
@ -113,14 +93,14 @@ const ResidentReview = () => {
|
|
|
|
|
field: 'actions',
|
|
|
|
|
type: 'actions',
|
|
|
|
|
width: 80,
|
|
|
|
|
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeSimsa(params.row)} />],
|
|
|
|
|
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeJudge(params.row)} />],
|
|
|
|
|
align: 'center'
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const search = useCallback(() => {
|
|
|
|
|
const params = {
|
|
|
|
|
// scDatagb: '1',
|
|
|
|
|
msDatagb,
|
|
|
|
|
page: rowsState.page,
|
|
|
|
|
size: rowsState.pageSize
|
|
|
|
|
};
|
|
|
|
@ -133,7 +113,7 @@ const ResidentReview = () => {
|
|
|
|
|
// apiRef.current.updateRowData([]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
}, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
|
|
|
|
|
const handleSearch = async (event) => {
|
|
|
|
|
if (!selectedYear) return;
|
|
|
|
@ -154,6 +134,25 @@ const ResidentReview = () => {
|
|
|
|
|
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
}, [search]);
|
|
|
|
|
|
|
|
|
|
const handleOnCellClick = (e) => {
|
|
|
|
|
if (e?.field === 'msDate') {
|
|
|
|
|
// findJudge(e.row?.msDate).then((res) => {
|
|
|
|
|
// setRowData(res.data);
|
|
|
|
|
// setCreate(false);
|
|
|
|
|
setSelectedRowData({
|
|
|
|
|
...selectedRowData,
|
|
|
|
|
msDatagb: e.row.msDatagb,
|
|
|
|
|
msSdate: e.row.msSdate,
|
|
|
|
|
msEdate: e.row.msEdate,
|
|
|
|
|
msChasu: e.row.msChasu,
|
|
|
|
|
msuTeam: e.row.msuTeam
|
|
|
|
|
});
|
|
|
|
|
setTitle(`${menuName} 의견진술 심의 상세 목록`);
|
|
|
|
|
setOpen(true);
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MainCard>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
@ -201,8 +200,17 @@ const ResidentReview = () => {
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Divider />
|
|
|
|
|
</Grid>
|
|
|
|
|
<MuiDataGrid columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
|
|
|
|
<MuiDataGrid
|
|
|
|
|
columns={columns}
|
|
|
|
|
rowsState={rowsState}
|
|
|
|
|
totalCount={totalCount}
|
|
|
|
|
setRowsState={setRowsState}
|
|
|
|
|
handleCellClick={handleOnCellClick}
|
|
|
|
|
/>
|
|
|
|
|
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
|
|
|
|
|
<ModalJudgeDetail {...selectedRowData} />
|
|
|
|
|
</CmmModal>
|
|
|
|
|
</MainCard>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
export default ResidentReview;
|
|
|
|
|
export default JudgeReview;
|