diff --git a/src/apis/resident.js b/src/apis/resident.js index 297ece2..ea0d737 100644 --- a/src/apis/resident.js +++ b/src/apis/resident.js @@ -3,11 +3,11 @@ //---------------------------------------------------------------------------- import axios from 'utils/axios'; -import { GET_RESIDENT, GET_RESIDENT_DATA_LIST, SAVE_RESIDENT_DATA } from 'commons/ApiUrl'; +import { GET_RESIDENT, GET_RESIDENT_DATA_LIST, GET_RESIDENT_LIST, SAVE_RESIDENT_DATA } from 'commons/ApiUrl'; import { setRowId } from './common'; // eslint-disable-next-line no-return-await -export async function findResidents(params) { +export async function findResidentDatas(params) { const res = await axios.get(GET_RESIDENT_DATA_LIST, { params }); if (res.success) { res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); @@ -32,3 +32,12 @@ export async function findResident(scCode) { } return res; } + +export async function findResidents(params) { + const res = await axios.get(GET_RESIDENT_LIST, { params }); + if (res.success) { + res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); + return res; + } + return res; +} diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index a43b44b..3f58e2e 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -24,6 +24,7 @@ export const SAVE_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target'; export const GET_RESIDENT_DATA_LIST = '/api/v1/ctgy/resident/data'; export const SAVE_RESIDENT_DATA = '/api/v1/ctgy/resident/data'; export const GET_RESIDENT = '/api/v1/ctgy/resident/'; +export const GET_RESIDENT_LIST = '/api/v1/ctgy/resident'; // 사용자 관리 export const GET_USER_BOARD_LIST = '/api/v1/ctgy/pboard/'; diff --git a/src/views/biz/resident/ResidentDataReview.jsx b/src/views/biz/resident/ResidentDataReview.jsx index 8439ea3..2cacecb 100644 --- a/src/views/biz/resident/ResidentDataReview.jsx +++ b/src/views/biz/resident/ResidentDataReview.jsx @@ -8,7 +8,7 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/form/MuiDataGrid'; import CmmModal from 'views/form/Modal/CmmModal'; -import { findResident, findResidents, saveResidentData } from 'apis/resident'; +import { findResident, findResidentDatas, saveResidentData } from 'apis/resident'; import NewResidentDataForm from './NewResidentDataForm'; import ModifyResidentDataForm from './ModifyResidentDataForm'; @@ -60,7 +60,7 @@ const ResidentDataReview = () => { size: rowsState.pageSize }; - findResidents(params).then((response) => { + findResidentDatas(params).then((response) => { console.log(response); if (response && response.data) { setTotalCount(response.count); diff --git a/src/views/biz/resident/ResidentReview.jsx b/src/views/biz/resident/ResidentReview.jsx index f17fe61..3c129f1 100644 --- a/src/views/biz/resident/ResidentReview.jsx +++ b/src/views/biz/resident/ResidentReview.jsx @@ -7,8 +7,6 @@ import getYear from 'date-fns/getYear'; import { GridActionsCellItem } from '@mui/x-data-grid'; import { Divider, FormControl, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material'; import DeleteIcon from '@mui/icons-material/Delete'; - -// assets import { IconSearch } from '@tabler/icons'; // berry ui @@ -17,8 +15,8 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/form/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; -import { findParkings } from 'apis/parking'; -import InputLabel from '../../../ui-component/extended/Form/InputLabel'; +import InputLabel from 'ui-component/extended/Form/InputLabel'; +import { findResidents } from 'apis/resident'; const ResidentReview = () => { const isInit = useRef(true); @@ -117,7 +115,7 @@ const ResidentReview = () => { size: rowsState.pageSize }; - findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { + findResidents({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { if (response && response.data) { setTotalCount(response.count); setRowsState((prevState) => ({ ...prevState, rows: response.data })); diff --git a/src/views/form/MuiDataGrid.jsx b/src/views/form/MuiDataGrid.jsx index 58a2a41..c15ab13 100644 --- a/src/views/form/MuiDataGrid.jsx +++ b/src/views/form/MuiDataGrid.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; // material-ui import { DataGrid, gridClasses } from '@mui/x-data-grid'; -import { grey } from '@mui/material/colors'; +// import { grey } from '@mui/material/colors'; import Box from '@mui/material/Box'; // import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/styles'; @@ -180,12 +180,12 @@ const MuiDataGrid = ({ }, [`& .${gridClasses.columnHeaderTitle}`]: { // bgcolor: (theme) => (theme.palette.mode === 'light' ? grey[200] : grey[800]), - display: 'flex', - alignItems: 'center' + // display: 'flex', + // alignItems: 'center' // alignSelf: 'stretch' }, [`& .${gridClasses.row}`]: { - bgcolor: (theme) => (theme.palette.mode === 'light' ? grey[200] : grey[800]) + // bgcolor: (theme) => (theme.palette.mode === 'light' ? grey[200] : grey[800]) } }} initialState={{