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;

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

Loading…
Cancel
Save