feat: 주정차 의견 진술 화면 반영

main
Lim Jonguk 3 years ago
parent dac5dc0cbe
commit 4182b06cb7

@ -1,5 +1,124 @@
import React from 'react'; import { useEffect, useState } from 'react';
const ParkingRegister = () => <div>주정차 의견진술 심의 등록</div>; import _ from 'lodash';
// material-ui
import {
Button,
Divider,
FormControl,
FormControlLabel,
Grid,
InputAdornment,
MenuItem,
OutlinedInput,
Radio,
RadioGroup,
Select
} from '@mui/material';
import MuiTooltip from '@mui/material/Tooltip';
// assets
import { IconSearch } from '@tabler/icons';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiGridList from 'ui-component/MuiGridList';
import { useTheme } from '@mui/material/styles';
import AnimateButton from '../../../ui-component/extended/AnimateButton';
const ParkingRegister = () => {
const theme = useTheme();
const [category, setCategory] = useState('N');
const [searchTxt, setSearchTxt] = useState('');
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 10,
rows: []
// loading: false
});
const columns = [
{ headerName: '심의차수', field: 'ciCode' },
{ headerName: '심사건수', field: 'ciContentno' },
{ headerName: '심사기간', field: 'ciTitle', editable: true },
{ headerName: '심사마감일시', field: 'ciId' },
{ headerName: '상태', field: 'ciPwd' },
{
headerName: '삭제하기',
field: 'ciEmail',
renderCell: (params) => (
<>
{params.value}
<Button
variant="contained"
color="primary"
size="small"
sx={{ background: theme.palette.error.main, '&:hover': { background: theme.palette.error.dark } }}
>
삭제
</Button>
</>
)
}
];
const handleSearch = async (event) => {};
useEffect(() => {
const params = {
page: rowsState.page + 1,
size: rowsState.pageSize
};
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
return (
<MainCard>
<Grid container spacing={2} alignItems="center">
<Grid item xs={12} lg={6}>
<Grid container spacing={1}>
<Grid item>
<FormControl>
<RadioGroup
row
aria-label="category"
name="row-radio-buttons-group"
value={category}
onChange={(e) => setCategory(e.target.value)}
>
<FormControlLabel value="N" control={<Radio />} label="미등록" />
<FormControlLabel value="Y" control={<Radio />} label="등록" />
</RadioGroup>
</FormControl>
</Grid>
<Grid item>
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" autoFocus />
&nbsp;-&nbsp;
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" autoFocus />
{/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */}
</Grid>
<Grid item>
<AnimateButton>
<Button variant="contained" color="primary" size="small" onClick={handleSearch}>
검색
</Button>
</AnimateButton>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid item xs={12}>
<Divider />
</Grid>
<Grid item xs={12}>
<Divider />
</Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
</MainCard>
);
};
export default ParkingRegister; export default ParkingRegister;

@ -16,8 +16,10 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiGridList from 'ui-component/MuiGridList'; import MuiGridList from 'ui-component/MuiGridList';
import boardService from 'apis/BoardService'; import boardService from 'apis/BoardService';
import moment from 'moment'; import moment from 'moment';
import { useTheme } from '@mui/material/styles';
const ParkingReview = () => { const ParkingReview = () => {
const theme = useTheme();
const toYear = Number(moment().format('YYYY')); const toYear = Number(moment().format('YYYY'));
const years = _.range(toYear, toYear - 14, -1); const years = _.range(toYear, toYear - 14, -1);
@ -33,35 +35,27 @@ const ParkingReview = () => {
}); });
const columns = [ const columns = [
{ headerName: '게시판코드', field: 'ciCode' }, { headerName: '심의차수', field: 'ciCode' },
{ headerName: '글번호', field: 'ciContentno' }, { headerName: '심사건수', field: 'ciContentno' },
{ headerName: '제목', field: 'ciTitle', editable: true }, { headerName: '심사기간', field: 'ciTitle', editable: true },
{ headerName: '사용자ID', field: 'ciId' }, { headerName: '심사마감일시', field: 'ciId' },
{ headerName: '사용자 비번', field: 'ciPwd' }, { headerName: '상태', field: 'ciPwd' },
{ headerName: '사용자 이름', field: 'ciName' },
{ headerName: '등록일', field: 'ciNalja' },
{ headerName: '등록시간', field: 'ciTime' },
{ headerName: '조회수', field: 'ciHit' },
{ headerName: 'ref', field: 'ciRef' },
{ headerName: 'step', field: 'ciStep' },
{ headerName: 'level', field: 'ciRevel' },
{ headerName: '비번', field: 'ciPass' },
{ {
headerName: 'email', headerName: '삭제하기',
field: 'ciEmail', field: 'ciEmail',
renderCell: (params) => ( renderCell: (params) => (
<strong> <strong>
{params.value} {params.value}
<Button variant="contained" color="primary" size="small"> <Button
Open variant="contained"
color="primary"
size="small"
sx={{ background: theme.palette.error.main, '&:hover': { background: theme.palette.error.dark } }}
>
삭제
</Button> </Button>
</strong> </strong>
) )
},
{ headerName: '내용', field: 'ciContents' },
{
headerName: 'IP',
field: `ciIp`
} }
]; ];
const handleSearch = async (event) => { const handleSearch = async (event) => {
@ -76,7 +70,6 @@ const ParkingReview = () => {
page: rowsState.page + 1, page: rowsState.page + 1,
size: rowsState.pageSize size: rowsState.pageSize
}; };
console.log(selectedYear);
if (searchTxt) { if (searchTxt) {
params = { params = {
...params, ...params,
@ -84,13 +77,13 @@ const ParkingReview = () => {
}; };
} }
// boardService.getBoardList(params).then((response) => { boardService.getBoardList(params).then((response) => {
// console.log(response); console.log(response);
// if (response && response.data) { if (response && response.data) {
// setTotalCount(response.count); setTotalCount(response.count);
// setRowsState((prevState) => ({ ...prevState, rows: response.data })); setRowsState((prevState) => ({ ...prevState, rows: response.data }));
// } }
// }); });
}, [rowsState.page, rowsState.pageSize, searchTxt]); // rowsState.page, rowsState.pageSize, rowsState.rows]); }, [rowsState.page, rowsState.pageSize, searchTxt]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
return ( return (

Loading…
Cancel
Save