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';
class OpstBizService {
@ -52,5 +58,14 @@ class OpstBizService {
}
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();

@ -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_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';
// project imports
import MuiGridList from 'views/form/MuiGridList';
import MuiGridPagination from 'views/form/MuiGridPagination';
import opstBizService from 'apis/OpstBizService';
const Board = () => {
@ -126,7 +126,7 @@ const Board = () => {
<Grid item xs={12}>
<Divider />
</Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
<MuiGridPagination columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
</MainCard>
);
};

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

@ -21,69 +21,89 @@ import MuiTooltip from '@mui/material/Tooltip';
// assets
import { IconSearch } from '@tabler/icons';
import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiGridList from 'views/form/MuiGridList';
import MuiGridPagination from 'views/form/MuiGridPagination';
import { useTheme } from '@mui/material/styles';
import AnimateButton from '../../../ui-component/extended/AnimateButton';
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
import opstBizService from '../../../apis/OpstBizService';
import xitCmm from '../../../commons/XitCmm';
const ParkingRegister = () => {
const theme = useTheme();
const [category, setCategory] = useState('N');
const [searchTxt, setSearchTxt] = useState('');
const [rcIrTransfer, setRcIrTransfer] = useState('1');
const [rcSeq1, setRcSeq1] = useState('2022200801');
const [rcSeq2, setRcSeq2] = useState('2022200899');
const [selection, setSelection] = useState([]);
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
const [rowsStatus, setRowsStatus] = useState({
page: 0,
pageSize: 10,
pageSize: 100,
rows: []
// loading: false
});
const [spacing, setSpacing] = useState(2);
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>
</>
)
}
{ headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{ headerName: '접수번호', headerAlign: 'center', field: 'rcSeq', align: 'center' },
{ headerName: '최초차량번호', headerAlign: 'center', field: 'mmOcarno', align: 'center', minWidth: 110 },
{ headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 },
{ headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 },
{ headerName: '진술유형', headerAlign: 'center', field: 'rcContDocStr', minWidth: 130 },
{ headerName: '접수일자', headerAlign: 'center', field: 'rcDate', align: 'center' },
{ headerName: '접수방법', headerAlign: 'center', field: 'rcIngbStr', align: 'center' }
];
const handleSearch = async (event) => {};
useEffect(() => {
const search = () => {
const params = {
page: rowsState.page,
size: rowsState.pageSize
rcIrTransfer,
rcSeq1,
rcSeq2
};
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
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);
};
return (
<MainCard>
<Grid container spacing={2} alignItems="center">
<Grid item xs={12} lg={6}>
<Grid item xs={12}>
<Grid container spacing={1}>
<Grid item>
<FormControl component="fieldset">
@ -94,26 +114,46 @@ const ParkingRegister = () => {
row
aria-label="category"
name="row-radio-buttons-group"
value={category}
onChange={(e) => setCategory(e.target.value)}
value={rcIrTransfer}
onChange={(e) => setRcIrTransfer(e.target.value)}
>
<FormControlLabel value="N" control={<Radio />} label="미등록" />
<FormControlLabel value="Y" control={<Radio />} label="등록" />
<FormControlLabel value="1" control={<Radio />} label="미등록" />
<FormControlLabel value="2" control={<Radio />} label="등록" />
</RadioGroup>
</FormControl>
</Grid>
<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;
<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" /> */}
</Grid>
<Grid item>
<AnimateButton>
<Button variant="contained" color="primary" size="small" onClick={handleSearch}>
검색
</Button>
</AnimateButton>
<Button variant="contained" color="primary" size="small" startIcon={<IconSearch />} onClick={handleSearch}>
검색
</Button>
</Grid>
<Grid item>
<Button variant="contained" color="primary" size="small" startIcon={<PersonAddTwoToneIcon />} onClick={handleSave}>
저장
</Button>
</Grid>
</Grid>
</Grid>
@ -124,7 +164,15 @@ const ParkingRegister = () => {
<Grid item xs={12}>
<Divider />
</Grid>
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
<MuiGridPagination
isCheckbox
isHidePagination
columns={columns}
rowsState={rowsStatus}
totalCount={totalCount}
setRowsStatus={setRowsStatus}
handleSelection={handleSelection}
/>
</MainCard>
);
};

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

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