feat: 심의등록 반영

main
minuk926 3 years ago
parent 65aef196ea
commit 5f42b45a85

@ -1,4 +1,10 @@
import { BOARD_LIST_URL, PUBLIC_BOARD_LIST_URL, PARKING_SIMSA_DETAILS_LIST_URL, PARKING_SIMSA_LIST_URL } from 'commons/ApiUrl'; import {
BOARD_LIST_URL,
PUBLIC_BOARD_LIST_URL,
PARKING_SIMSA_DETAILS_LIST_URL,
PARKING_SIMSA_LIST_URL,
PARKING_SIMSA_TARGET_LIST_URL
} from 'commons/ApiUrl';
import axios from 'utils/axios'; import axios from 'utils/axios';
class OpstBizService { class OpstBizService {
@ -52,5 +58,14 @@ class OpstBizService {
} }
return res; return res;
}; };
getSimsaTargetList = async (params) => {
const res = await axios.get(PARKING_SIMSA_TARGET_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
} }
export default new OpstBizService(); export default new OpstBizService();

@ -12,3 +12,4 @@ export const BOARD_LIST_URL = '/api/v1/ctgy/board';
// 주정차 의견 진술 // 주정차 의견 진술
export const PARKING_SIMSA_LIST_URL = '/api/v1/ctgy/parking'; export const PARKING_SIMSA_LIST_URL = '/api/v1/ctgy/parking';
export const PARKING_SIMSA_DETAILS_LIST_URL = '/api/v1/ctgy/parking/details'; export const PARKING_SIMSA_DETAILS_LIST_URL = '/api/v1/ctgy/parking/details';
export const PARKING_SIMSA_TARGET_LIST_URL = '/api/v1/ctgy/parking/target';

@ -23,7 +23,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiGridList from 'views/form/MuiGridList'; import MuiGridPagination from 'views/form/MuiGridPagination';
import opstBizService from 'apis/OpstBizService'; import opstBizService from 'apis/OpstBizService';
const Board = () => { const Board = () => {
@ -126,7 +126,7 @@ const Board = () => {
<Grid item xs={12}> <Grid item xs={12}>
<Divider /> <Divider />
</Grid> </Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} /> <MuiGridPagination columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
</MainCard> </MainCard>
); );
}; };

@ -10,7 +10,7 @@ import { IconFile, IconFileCheck, IconFileText } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiGridList from 'views/form/MuiGridList'; import MuiGridPagination from 'views/form/MuiGridPagination';
import InputLabel from 'ui-component/extended/Form/InputLabel'; import InputLabel from 'ui-component/extended/Form/InputLabel';
import opstBizService from '../../../apis/OpstBizService'; import opstBizService from '../../../apis/OpstBizService';
import * as React from 'react'; import * as React from 'react';
@ -71,7 +71,7 @@ const PublicBoard = () => {
<Divider /> <Divider />
</Grid> </Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} /> <MuiGridPagination columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
</MainCard> </MainCard>
); );
}; };

@ -21,69 +21,89 @@ import MuiTooltip from '@mui/material/Tooltip';
// assets // assets
import { IconSearch } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
// berry ui // berry ui
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiGridList from 'views/form/MuiGridList'; import MuiGridPagination from 'views/form/MuiGridPagination';
import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/material/styles';
import AnimateButton from '../../../ui-component/extended/AnimateButton'; import opstBizService from '../../../apis/OpstBizService';
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
import xitCmm from '../../../commons/XitCmm';
const ParkingRegister = () => { const ParkingRegister = () => {
const theme = useTheme(); const theme = useTheme();
const [category, setCategory] = useState('N'); const [rcIrTransfer, setRcIrTransfer] = useState('1');
const [searchTxt, setSearchTxt] = useState(''); const [rcSeq1, setRcSeq1] = useState('2022200801');
const [rcSeq2, setRcSeq2] = useState('2022200899');
const [selection, setSelection] = useState([]);
const [totalCount, setTotalCount] = useState(0); const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({ const [rowsStatus, setRowsStatus] = useState({
page: 0, page: 0,
pageSize: 10, pageSize: 100,
rows: [] rows: []
// loading: false
}); });
const [spacing, setSpacing] = useState(2);
const columns = [ const columns = [
{ headerName: '심의차수', field: 'ciCode' }, { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{ headerName: '심사건수', field: 'ciContentno' }, { headerName: '접수번호', headerAlign: 'center', field: 'rcSeq', align: 'center' },
{ headerName: '심사기간', field: 'ciTitle', editable: true }, { headerName: '최초차량번호', headerAlign: 'center', field: 'mmOcarno', align: 'center', minWidth: 110 },
{ headerName: '심사마감일시', field: 'ciId' }, { headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 },
{ headerName: '상태', field: 'ciPwd' }, { headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 },
{ { headerName: '진술유형', headerAlign: 'center', field: 'rcContDocStr', minWidth: 130 },
headerName: '삭제하기', { headerName: '접수일자', headerAlign: 'center', field: 'rcDate', align: 'center' },
field: 'ciEmail', { headerName: '접수방법', headerAlign: 'center', field: 'rcIngbStr', align: 'center' }
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 search = () => {
const params = { const params = {
page: rowsState.page, rcIrTransfer,
size: rowsState.pageSize rcSeq1,
rcSeq2
};
opstBizService.getSimsaTargetList(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
}
});
};
const handleSave = () => {
if (selection.length === 0) {
xitCmm.alertParam(`처리할 데이타가 없습니다`);
} else {
const selectRows = selection.map((d) => rowsStatus.rows[d - 1].rcSeq);
alert(`저장할 데이타 => ${selectRows}`);
}
};
const handleSearch = (event) => {
if (rcSeq1 && rcSeq2) {
search();
}
};
const handleOnKeyDown = (event) => {
if (event.type === 'keydown' && event.key === 'Enter' && rcSeq1 && rcSeq2) {
search();
}
};
const handleSelection = (newSelection) => {
setSelection(newSelection);
// alert(newSelection.selectionModel);
}; };
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
return ( return (
<MainCard> <MainCard>
<Grid container spacing={2} alignItems="center"> <Grid container spacing={2} alignItems="center">
<Grid item xs={12} lg={6}> <Grid item xs={12}>
<Grid container spacing={1}> <Grid container spacing={1}>
<Grid item> <Grid item>
<FormControl component="fieldset"> <FormControl component="fieldset">
@ -94,26 +114,46 @@ const ParkingRegister = () => {
row row
aria-label="category" aria-label="category"
name="row-radio-buttons-group" name="row-radio-buttons-group"
value={category} value={rcIrTransfer}
onChange={(e) => setCategory(e.target.value)} onChange={(e) => setRcIrTransfer(e.target.value)}
> >
<FormControlLabel value="N" control={<Radio />} label="미등록" /> <FormControlLabel value="1" control={<Radio />} label="미등록" />
<FormControlLabel value="Y" control={<Radio />} label="등록" /> <FormControlLabel value="2" control={<Radio />} label="등록" />
</RadioGroup> </RadioGroup>
</FormControl> </FormControl>
</Grid> </Grid>
<Grid item> <Grid item>
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" autoFocus /> <OutlinedInput
required
value={rcSeq1}
onChange={(e) => setRcSeq1(e.target.value)}
placeholder="접수번호(10자리)-strat"
onKeyDown={handleOnKeyDown}
size="small"
autoFocus
inputProps={{ maxLength: 10 }}
/>
&nbsp;-&nbsp; &nbsp;-&nbsp;
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" /> <OutlinedInput
required
value={rcSeq2}
onChange={(e) => setRcSeq2(e.target.value)}
placeholder="접수번호(10자리)-end"
onKeyDown={handleOnKeyDown}
size="small"
inputProps={{ maxLength: 10 }}
/>
{/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */} {/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */}
</Grid> </Grid>
<Grid item> <Grid item>
<AnimateButton> <Button variant="contained" color="primary" size="small" startIcon={<IconSearch />} onClick={handleSearch}>
<Button variant="contained" color="primary" size="small" onClick={handleSearch}>
검색 검색
</Button> </Button>
</AnimateButton> </Grid>
<Grid item>
<Button variant="contained" color="primary" size="small" startIcon={<PersonAddTwoToneIcon />} onClick={handleSave}>
저장
</Button>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
@ -124,7 +164,15 @@ const ParkingRegister = () => {
<Grid item xs={12}> <Grid item xs={12}>
<Divider /> <Divider />
</Grid> </Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} /> <MuiGridPagination
isCheckbox
isHidePagination
columns={columns}
rowsState={rowsStatus}
totalCount={totalCount}
setRowsStatus={setRowsStatus}
handleSelection={handleSelection}
/>
</MainCard> </MainCard>
); );
}; };

@ -17,7 +17,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard'; import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiGridList from 'views/form/MuiGridList'; import MuiGridPagination from 'views/form/MuiGridPagination';
import opstBizService from 'apis/OpstBizService'; import opstBizService from 'apis/OpstBizService';
import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/material/styles';
import xitCmm from 'commons/XitCmm'; import xitCmm from 'commons/XitCmm';
@ -76,6 +76,8 @@ const ParkingReview = () => {
[] []
); );
const openModalDetails = () => <ModalDetails />;
/* /*
ms_maincode : '민원코드' ms_maincode : '민원코드'
ms_seq : '접수번호' ms_seq : '접수번호'
@ -106,7 +108,8 @@ const ParkingReview = () => {
// <Link underline="hover" href="/parking/details" rel="noopener"> // <Link underline="hover" href="/parking/details" rel="noopener">
<Link <Link
underline="hover" underline="hover"
onClick={() => navigate(`/parking/details?msChasu=${params.msChasu}&msSdate=${params.msSdate}&msEdate=${params.msEdate}`)} // onClick={() => navigate(`/parking/details?msChasu=${params.msChasu}&msSdate=${params.msSdate}&msEdate=${params.msEdate}`)}
onClick={openModalDetails}
data-target="modalDetails" data-target="modalDetails"
rel="noopener" rel="noopener"
> >
@ -223,7 +226,7 @@ const ParkingReview = () => {
<Grid item xs={12}> <Grid item xs={12}>
<Divider /> <Divider />
</Grid> </Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} /> <MuiGridPagination columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
</MainCard> </MainCard>
); );
}; };

@ -8,13 +8,15 @@ import { useTheme } from '@mui/material/styles';
import dataGridKoKR from './defaultDataGridLocale'; import dataGridKoKR from './defaultDataGridLocale';
// project imports // project imports
const MuiGridList = ({ const MuiGridPagination = ({
isCheckbox = false, isCheckbox = false,
isHidePagination = false,
columns, columns,
rowsState = { page: 0, pageSize: 1000, rows: [] }, rowsState = { page: 0, pageSize: 1000, rows: [] },
totalCount = 0, totalCount = 0,
setRowsState = () => {}, setRowsState = () => {},
handleCellClick = () => {} handleCellClick = () => {},
handleSelection = () => {}
}) => { }) => {
// const { columns, rowsState, totalCount, setRowsState } = props; // const { columns, rowsState, totalCount, setRowsState } = props;
const theme = useTheme(); const theme = useTheme();
@ -40,7 +42,9 @@ const MuiGridList = ({
}} }}
> >
<DataGrid <DataGrid
// localeText={koKR.components.MuiDataGrid.defaultProps.localeText} showCellRightBorder
showColumnRightBorder
hideFooterPagination={isHidePagination}
localeText={dataGridKoKR} localeText={dataGridKoKR}
paginationMode="server" paginationMode="server"
getRowId={(row) => row.rowId} getRowId={(row) => row.rowId}
@ -55,20 +59,22 @@ const MuiGridList = ({
onPageChange={(page) => setRowsState((prev) => ({ ...prev, page }))} onPageChange={(page) => setRowsState((prev) => ({ ...prev, page }))}
onPageSizeChange={(pageSize) => setRowsState((prev) => ({ ...prev, page: 0, pageSize }))} onPageSizeChange={(pageSize) => setRowsState((prev) => ({ ...prev, page: 0, pageSize }))}
rowsPerPageOptions={[10, 50, 100]} rowsPerPageOptions={[10, 50, 100]}
pagination
onCellClick={handleCellClick} onCellClick={handleCellClick}
onSelectionModelChange={handleSelection}
/> />
</Box> </Box>
); );
}; };
MuiGridList.propTypes = { MuiGridPagination.propTypes = {
isCheckbox: PropTypes.bool, isCheckbox: PropTypes.bool,
isHidePagination: PropTypes.bool,
columns: PropTypes.array, columns: PropTypes.array,
rowsState: PropTypes.any, rowsState: PropTypes.any,
totalCount: PropTypes.number, totalCount: PropTypes.number,
setRowsState: PropTypes.func, setRowsState: PropTypes.func,
handleCellClick: PropTypes.func handleCellClick: PropTypes.func,
handleSelection: PropTypes.func
}; };
export default MuiGridList; export default MuiGridPagination;
Loading…
Cancel
Save