From 5f42b45a85916305cb4599aa6df05aec1a9ce851 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Tue, 22 Mar 2022 19:11:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8B=AC=EC=9D=98=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/OpstBizService.js | 17 +- src/commons/ApiUrl.js | 1 + src/views/biz/board/Board.jsx | 4 +- src/views/biz/board/PublicBoard.jsx | 4 +- src/views/biz/parking/Regist.jsx | 150 ++++++++++++------ src/views/biz/parking/Review.jsx | 9 +- ...{MuiGridList.jsx => MuiGridPagination.jsx} | 20 ++- 7 files changed, 139 insertions(+), 66 deletions(-) rename src/views/form/{MuiGridList.jsx => MuiGridPagination.jsx} (82%) diff --git a/src/apis/OpstBizService.js b/src/apis/OpstBizService.js index 57279a1..ffae03e 100644 --- a/src/apis/OpstBizService.js +++ b/src/apis/OpstBizService.js @@ -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(); diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 0a4f242..105a375 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -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'; diff --git a/src/views/biz/board/Board.jsx b/src/views/biz/board/Board.jsx index 116e7a7..50b6b0a 100644 --- a/src/views/biz/board/Board.jsx +++ b/src/views/biz/board/Board.jsx @@ -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 = () => { - + ); }; diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index d6aec5c..386ebcf 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -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 = () => { - + ); }; diff --git a/src/views/biz/parking/Regist.jsx b/src/views/biz/parking/Regist.jsx index 0d0995a..fa7f14d 100644 --- a/src/views/biz/parking/Regist.jsx +++ b/src/views/biz/parking/Regist.jsx @@ -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} - - - ) - } + { 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 ( - + @@ -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)} > - } label="미등록" /> - } label="등록" /> + } label="미등록" /> + } label="등록" /> - + setRcSeq1(e.target.value)} + placeholder="접수번호(10자리)-strat" + onKeyDown={handleOnKeyDown} + size="small" + autoFocus + inputProps={{ maxLength: 10 }} + />  -  - + setRcSeq2(e.target.value)} + placeholder="접수번호(10자리)-end" + onKeyDown={handleOnKeyDown} + size="small" + inputProps={{ maxLength: 10 }} + /> {/* */} - - - + + + + @@ -124,7 +164,15 @@ const ParkingRegister = () => { - + ); }; diff --git a/src/views/biz/parking/Review.jsx b/src/views/biz/parking/Review.jsx index 169b680..ccad96b 100644 --- a/src/views/biz/parking/Review.jsx +++ b/src/views/biz/parking/Review.jsx @@ -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 = () => ; + /* ms_maincode : '민원코드' ms_seq : '접수번호' @@ -106,7 +108,8 @@ const ParkingReview = () => { // 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 = () => { - + ); }; diff --git a/src/views/form/MuiGridList.jsx b/src/views/form/MuiGridPagination.jsx similarity index 82% rename from src/views/form/MuiGridList.jsx rename to src/views/form/MuiGridPagination.jsx index dcc9454..bfbd003 100644 --- a/src/views/form/MuiGridList.jsx +++ b/src/views/form/MuiGridPagination.jsx @@ -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 = ({ }} > 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} /> ); }; -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;