From fd94b75dc126607b729cca2a5373bb5c5a70e0bd Mon Sep 17 00:00:00 2001 From: minuk926 Date: Wed, 13 Apr 2022 18:45:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B1=B0=EC=A3=BC=EC=A7=80/=EC=9E=A5?= =?UTF-8?q?=EC=95=A0=EC=9D=B8=20=EC=83=81=EC=84=B8=20=EB=AA=A9=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/routes/MainRoutes.js | 19 +++----- src/utils/locales/ko.json | 4 +- .../JudgeDataReview.jsx} | 10 ++--- .../JudgeRegistReview.jsx} | 44 +++++++++++++------ 4 files changed, 43 insertions(+), 34 deletions(-) rename src/views/biz/{resident/ResidentDataReview.jsx => judge/JudgeDataReview.jsx} (94%) rename src/views/biz/{resident/ResidentRegist.jsx => judge/JudgeRegistReview.jsx} (83%) diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js index bf8754d..347d186 100755 --- a/src/routes/MainRoutes.js +++ b/src/routes/MainRoutes.js @@ -19,17 +19,10 @@ const ParkingReview = Loadable(lazy(() => import('views/biz/parking/ParkingRevie const ParkingDetails = Loadable(lazy(() => import('views/biz/parking/ModalDetails'))); const ParkingRegister = Loadable(lazy(() => import('views/biz/parking/ParkingRegister'))); -// resident -const ResidentDataReview = Loadable(lazy(() => import('views/biz/resident/ResidentDataReview'))); -const ResidentRegister = Loadable(lazy(() => import('views/biz/resident/ResidentRegist'))); - // Resident /Disabled +const JudgeDataReview = Loadable(lazy(() => import('views/biz/judge/JudgeDataReview'))); const JudgeReview = Loadable(lazy(() => import('views/biz/judge/JudgeReview'))); - -// disabled -// const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview'))); -// const DisabledRegister = Loadable(lazy(() => import('views/biz/disabled/DisabledRegist'))); -// const DisabledReview = Loadable(lazy(() => import('views/biz/disabled/DisabledReview'))); +const JudgeRegistReview = Loadable(lazy(() => import('views/biz/judge/JudgeRegistReview'))); // user const UserManager = Loadable(lazy(() => import('views/biz/user/UserManager'))); @@ -74,7 +67,7 @@ const MainRoutes = { /* 거주자 */ { path: '/resident/data', - element: + element: }, { path: '/resident/review', @@ -82,12 +75,12 @@ const MainRoutes = { }, { path: '/resident/register', - element: + element: }, /* 장애인 */ { path: '/disabled/data', - element: + element: }, { path: '/disabled/review', @@ -95,7 +88,7 @@ const MainRoutes = { }, { path: '/disabled/register', - element: <> // + element: }, /* 사용자 */ { diff --git a/src/utils/locales/ko.json b/src/utils/locales/ko.json index 9a7be89..75b5566 100755 --- a/src/utils/locales/ko.json +++ b/src/utils/locales/ko.json @@ -1,8 +1,8 @@ { "opst": "의견 진술 관리", "opst-1": "공지 사항", - "opst-2": "주정차 의견 진술", - "opst-2-1": "심의 목록", + "opst-2": "주정차 의견진술", + "opst-2-1": "심의목록", "opst-2-2": "심의 등록", "opst-3": "거주자 의견 진술", "opst-3-1": "자료 관리", diff --git a/src/views/biz/resident/ResidentDataReview.jsx b/src/views/biz/judge/JudgeDataReview.jsx similarity index 94% rename from src/views/biz/resident/ResidentDataReview.jsx rename to src/views/biz/judge/JudgeDataReview.jsx index ec3ac20..020b36b 100644 --- a/src/views/biz/resident/ResidentDataReview.jsx +++ b/src/views/biz/judge/JudgeDataReview.jsx @@ -13,7 +13,7 @@ import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm'; import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm'; import PropTypes from 'prop-types'; -const ResidentDataReview = ({ scDatagb, menuName }) => { +const JudgeDataReview = ({ scDatagb, menuName }) => { const [open, setOpen] = useState(false); const [create, setCreate] = useState(false); // const [selectedRow, setSelectedRow] = useState({}); @@ -75,7 +75,7 @@ const ResidentDataReview = ({ scDatagb, menuName }) => { useEffect(() => { search(); - }, [search]); // search, rowsState.page, rowsState.pageSize]); + }, [search]); const handleCreate = () => { setTitle(`${menuName} 의견진술 자료 신규 등록`); @@ -106,7 +106,7 @@ const ResidentDataReview = ({ scDatagb, menuName }) => { @@ -127,9 +127,9 @@ const ResidentDataReview = ({ scDatagb, menuName }) => { ); }; -ResidentDataReview.propTypes = { +JudgeDataReview.propTypes = { scDatagb: PropTypes.string.isRequired, menuName: PropTypes.string.isRequired }; -export default ResidentDataReview; +export default JudgeDataReview; diff --git a/src/views/biz/resident/ResidentRegist.jsx b/src/views/biz/judge/JudgeRegistReview.jsx similarity index 83% rename from src/views/biz/resident/ResidentRegist.jsx rename to src/views/biz/judge/JudgeRegistReview.jsx index 2f2f8c5..fe7bfb6 100644 --- a/src/views/biz/resident/ResidentRegist.jsx +++ b/src/views/biz/judge/JudgeRegistReview.jsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; // material-ui import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material'; @@ -19,19 +19,21 @@ import SaveJudgeTargetForm from 'views/biz/judge/SaveJudgeTargetForm'; import NumberFormat from 'react-number-format'; import ExcelDownload from 'views/form/ExcelDownload'; import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; +import PropTypes from 'prop-types'; -const ResidentRegister = () => { +const JudgeRegistReview = ({ scDatagb, menuName }) => { const [scTransfer, setScTransfer] = useState('1'); const [scSeq1, setScSeq1] = useState(2022000001); const [scSeq2, setScSeq2] = useState(2022000899); const [selectionModel, setSelectionModel] = useState([]); const [totalCount, setTotalCount] = useState(0); - const [rowsStatus, setRowsStatus] = useState({ + const [rowsState, setRowsState] = useState({ page: 0, pageSize: 100, rows: [] }); const [open, setOpen] = useState(false); + const [title, setTitle] = useState(); const columns = [ { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 }, @@ -50,9 +52,9 @@ const ResidentRegister = () => { { headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm', align: 'center' } ]; - const search = () => { + const search = useCallback(() => { const params = { - scDatagb: '1', // 거주자 + scDatagb, // 거주자 scTransfer, scSeq1, scSeq2 @@ -62,15 +64,16 @@ const ResidentRegister = () => { if (response && response.data) { setSelectionModel([]); setTotalCount(response.count); - setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data })); + setRowsState((prevRows) => ({ ...prevRows, rows: response.data })); } }); - }; + }, [rowsState.page, rowsState.pageSize, scDatagb]); const handleSave = () => { if (selectionModel.length === 0) { xitCmm.alertParam(`처리할 데이타가 없습니다`); } else { + setTitle(`${menuName} 의견진술 심의목록 저장`); setOpen(true); // alert(`저장할 데이타 => ${selectRows}`); } @@ -79,11 +82,11 @@ const ResidentRegister = () => { const submitResidentTargets = (params) => { const param = { ...params, - scDatagb: '1', // 거주자 + scDatagb, // 거주자 scTransfer, scSeq1, scSeq2, - scCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].scCode) + scCodes: selectionModel.map((d) => rowsState.rows[d - 1].scCode) }; setOpen(false); console.log(param); @@ -100,6 +103,10 @@ const ResidentRegister = () => { } }; + useEffect(() => { + search(); + }, [search]); + const handleOnKeyDown = (event) => { if (event.type === 'keydown' && event.key === 'Enter' && scSeq1 && scSeq2) { search(); @@ -179,7 +186,12 @@ const ResidentRegister = () => { - + @@ -195,16 +207,20 @@ const ResidentRegister = () => { isCheckbox isHideFooter columns={columns} - rowsState={rowsStatus} + rowsState={rowsState} totalCount={totalCount} - setRowsStatus={setRowsStatus} + setrowsState={setRowsState} handleSelection={handleSelection} selectionModel={selectionModel} /> - + ); }; -export default ResidentRegister; +JudgeRegistReview.propTypes = { + scDatagb: PropTypes.string.isRequired, + menuName: PropTypes.string.isRequired +}; +export default JudgeRegistReview;