feat: 거주자 의견진술 반영

main
Lim Jonguk 3 years ago
parent 32ffe642e9
commit e02e319530

@ -1,137 +0,0 @@
import {
GET_BOARD_LIST,
// GET_PUBLIC_BOARD_LIST,
GET_PARKING_SIMSA_DETAILS_LIST,
GET_PARKING_SIMSA_LIST,
GET_PARKING_SIMSA_TARGET_LIST,
SAVE_PARKING_SIMSA_TARGET
// GET_CMM_CODE_LIST,
// SAVE_PUBLIC_BOARD,
// DELETE_PUBLIC_BOARD,
// GET_FILE_DOWNLOAD,
// SAVE_PUBLIC_BOARD_HIT_CNT
} from 'commons/ApiUrl';
import axios from 'utils/axios';
// import FileSaver from 'file-saver';
class OpstBizService {
//----------------------------------------------------------------------------
// Common : 공통
//----------------------------------------------------------------------------
// eslint-disable-next-line no-return-await
// getComboCodeList = (params) => async () => await axios.get(GET_CMM_CODE_LIST, { params });
// TODO: 헤더에서 파일 정보 읽을 수 있도록 변경 필요
// fileDownload = async (id, filename, alert) => {
// await axios
// .get(GET_FILE_DOWNLOAD + id, {
// responseType: 'blob' // 'arrayBuffer',
// // withCredentials: process.env.NODE_ENV === 'development'
// // headers: { Authorization: window.localStorage.getItem(ACCESS_TOKEN_NAME) }
// })
// // eslint-disable-next-line consistent-return
// .then((res) => {
// if (res.isAxiosError) {
// alert.show('파일을 다운로드 할 수 없습니다[파일정보 오류]');
// return false;
// }
// FileSaver.saveAs(res, filename);
// });
// };
setRowId = (params, idx) => {
if (params && params.page && params.size) return params.page * params.size + idx + 1;
return idx + 1;
};
//----------------------------------------------------------------------------
// PublicBoard : 공지사항 관리
//----------------------------------------------------------------------------
// eslint-disable-next-line no-return-await
// getPublicBoardList = async (params) => {
// const res = await axios.get(GET_PUBLIC_BOARD_LIST, { params });
// if (res.success) {
// res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
// return res;
// }
// return res;
// };
//
// savePublicBoard = async (formData) => {
// const config = {
// method: 'post',
// data: formData,
// headers: { 'Content-Type': 'multipart/form-data' } // , Authorization: localStorage.getItem('access_token') }
// };
// // eslint-disable-next-line no-return-await
// return await axios(SAVE_PUBLIC_BOARD, config);
// };
//
// // eslint-disable-next-line no-return-await
// deletePublicBoard = (inCode) => async () => await axios.post(DELETE_PUBLIC_BOARD + inCode);
//
// // getPublicBoard = async (inCode) => {
// // await axios.get(GET_PUBLIC_BOARD + inCode);
// // };
//
// modifyPublicBoardHitCount = async (inCode) => {
// const res = await axios.put(SAVE_PUBLIC_BOARD_HIT_CNT + inCode);
// if (res.success) {
// return res;
// }
// return res;
// };
//----------------------------------------------------------------------------
// Parking : 주정차 의견 진술
//----------------------------------------------------------------------------
// eslint-disable-next-line no-return-await
getSimsa680GroupList = async (params) => {
const res = await axios.get(GET_PARKING_SIMSA_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
getSimsa680DetailList = async (params) => {
const res = await axios.get(GET_PARKING_SIMSA_DETAILS_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
getSimsaTargetList = async (params) => {
const res = await axios.get(GET_PARKING_SIMSA_TARGET_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
saveSimsaTargetList = async (params) => {
const res = await axios.post(SAVE_PARKING_SIMSA_TARGET, params);
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
//----------------------------------------------------------------------------
// Board : 게시판 관리
//----------------------------------------------------------------------------
getBoardList = async (params) => {
const res = await axios.get(GET_BOARD_LIST, { 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();

@ -0,0 +1,17 @@
//----------------------------------------------------------------------------
// Board : 게시판 관리
//----------------------------------------------------------------------------
import axios from 'utils/axios';
import { GET_BOARD_LIST } from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line import/prefer-default-export
export async function getBoardList(params) {
const res = await axios.get(GET_BOARD_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}

@ -1,6 +1,6 @@
import axios from '../utils/axios'; import axios from 'utils/axios';
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
import { GET_CMM_CODE_LIST, GET_FILE_DOWNLOAD } from '../commons/ApiUrl'; import { GET_CMM_CODE_LIST, GET_FILE_DOWNLOAD } from 'commons/ApiUrl';
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Common : 공통 // Common : 공통

@ -0,0 +1,49 @@
//----------------------------------------------------------------------------
// Parking : 주정차의견진술관리
//----------------------------------------------------------------------------
import axios from 'utils/axios';
import {
GET_PARKING_SIMSA_DETAILS_LIST,
GET_PARKING_SIMSA_LIST,
GET_PARKING_SIMSA_TARGET_LIST,
SAVE_PARKING_SIMSA_TARGET
} from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line no-return-await
export async function getSimsa680GroupList(params) {
const res = await axios.get(GET_PARKING_SIMSA_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function getSimsa680DetailList(params) {
const res = await axios.get(GET_PARKING_SIMSA_DETAILS_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function getSimsaTargetList(params) {
const res = await axios.get(GET_PARKING_SIMSA_TARGET_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function saveSimsaTargetList(params) {
const res = await axios.post(SAVE_PARKING_SIMSA_TARGET, params);
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}

@ -2,8 +2,8 @@
// PublicBoard : 공지사항 관리 // PublicBoard : 공지사항 관리
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
import axios from '../utils/axios'; import axios from 'utils/axios';
import { DELETE_PUBLIC_BOARD, GET_PUBLIC_BOARD_LIST, SAVE_PUBLIC_BOARD, SAVE_PUBLIC_BOARD_HIT_CNT } from '../commons/ApiUrl'; import { DELETE_PUBLIC_BOARD, GET_PUBLIC_BOARD_LIST, SAVE_PUBLIC_BOARD, SAVE_PUBLIC_BOARD_HIT_CNT } from 'commons/ApiUrl';
import { setRowId } from './common'; import { setRowId } from './common';
export async function getPublicBoardList(params) { export async function getPublicBoardList(params) {

@ -0,0 +1,25 @@
//----------------------------------------------------------------------------
// Parking : 주정차의견진술관리
//----------------------------------------------------------------------------
import axios from 'utils/axios';
import { GET_RESIDENT, GET_RESIDENT_DATA_LIST } from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line no-return-await
export async function getResidents(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) }));
return res;
}
return res;
}
export async function getResident(scCode) {
const res = await axios.get(GET_RESIDENT + scCode);
if (res.success) {
return res;
}
return res;
}

@ -19,3 +19,7 @@ export const GET_PARKING_SIMSA_LIST = '/api/v1/ctgy/parking';
export const GET_PARKING_SIMSA_DETAILS_LIST = '/api/v1/ctgy/parking/details'; export const GET_PARKING_SIMSA_DETAILS_LIST = '/api/v1/ctgy/parking/details';
export const GET_PARKING_SIMSA_TARGET_LIST = '/api/v1/ctgy/parking/target'; export const GET_PARKING_SIMSA_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const SAVE_PARKING_SIMSA_TARGET = '/api/v1/ctgy/parking/target'; export const SAVE_PARKING_SIMSA_TARGET = '/api/v1/ctgy/parking/target';
// 거주자 의견 진술
export const GET_RESIDENT_DATA_LIST = '/api/v1/ctgy/resident/data';
export const GET_RESIDENT = '/api/v1/ctgy/resident/';

@ -1,74 +1,8 @@
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
import format from 'date-fns/format';
const XitCmm = { const XitCmm = {
// const request: (options: object) => {
// const headers = new Headers({
// 'Content-Type': 'application/json',
// })
//
// if(localStorage.getItem(ACCESS_TOKEN)) {
// headers.append('Authorization', 'Bearer ' + localStorage.getItem(ACCESS_TOKEN))
// }
//
// const defaults = {headers: headers};
// options = Object.assign({}, defaults, options);
//
// return fetch(options.url, options)
// .then(response =>
// response.json().then(json => {
// if(!response.ok) {
// return Promise.reject(json);
// }
// return json;
// })
// );
// },
// requestApi: async (
// methodType: string,
// url: string,
// params: any,
// headers: any
// ): Promise<AxiosResponse<IApiResponse>> => {
// console.log(`process.env.NODE_ENV`, process.env.NODE_ENV);
// console.table(params);
//
// headers = Object.assign({'Content-Type': 'application/json;charset=UTF-8'}, headers); //, "Authorization": session.get('token')};
// let options: any = {
// url: process.env.NODE_ENV === 'development' ? url : process.env.REACT_APP_API + url,
// method: methodType,
// headers: headers
// };
// // get 요청은 body 없이 call
// if (methodType.toLocaleLowerCase() === 'get') options = {...options, params};
// else options = {...options, data: params};
//
// // 요청 처리
// let res: IApiResponse;
// try {
// res = await axios(options); //{...config, ...options});//.then(res => {
// } catch (e) {
// console.log(`@@@@@@@@@@@ requestApi EXCEPTION @@@@@@@@@@@@@`);
// Alert.error(`<p>${e}</p>`);
// } finally {
// }
// if (res !== undefined && res.success && res.data.success) {
// console.log(JSON.stringify(res.data));
// Alert.success(`처리되었습니다`);
// } else {
// console.log(`@@@@@@@@@@@ requestApi ERROR @@@@@@@@@@@@@`);
// let code = res.data.code != null ? `[${res.data.code}]` : '';
// await SweetAlert.fire({
// title: `Inpix Administrator`,
// html: `<p>${res.data.message} ${code}</p>`,
// //footer: 'Copyright 2018',
// timer: 3000
// });
// }
// return res.data;
// },
/** /**
* validation check error message * validation check error message
* @param message * @param message
@ -120,46 +54,10 @@ const XitCmm = {
return [value, setValue, changer]; return [value, setValue, changer];
}, },
// ag-grid 페이지 변경 formatDate(dateStr, fmt) {
onPageSizeChanged() { return format(dateStr, fmt);
/*
Page Size:
<Select
defaultInputValue={'2'}
defaultvalue={selectedPageSize}
onChange={onPageSizeChanged}
options={options}
/>
*/
// var value = (document.getElementById('page-size') as HTMLInputElement).value;
// gridOptions.api!.paginationSetPageSize(Number(value));
// onPageSizeChnged: useCallback((gridRef: AgGridReact, pageSize: number) => {
// gridRef.current.api.paginationSetPageSize(Number(value));
// }, []),
// MutableRefObject
// onPageSizeChnged: useCallback((gridRef: RefObject<AgGridReact>, pageSizeStr: string) => {
// gridRef.current.api.paginationSetPageSize(Number(pageSizeStr));
// }, []),
}, },
/**
* form 데이타를 JSON 으로 return
* @param frm
* @returns {string}
*/
// getJsonFromForm: (frm: HTMLFormElement): string => {
// let formData = new FormData(frm),
// result = {};
//
// // Iteration protocols : for of을 사용하여야만 한다
// // Iteration 객체의 특징
// for (let entry of formData.entries()) {
// result[entry[0]] = entry[1];
// }
// formData.forEach((v, k) => (result[k] = v));
// return JSON.stringify(result);
// },
/** /**
* 현재 URL에서 파라메터 GET * 현재 URL에서 파라메터 GET
* @param name * @param name

@ -4,6 +4,7 @@ import { lazy } from 'react';
import MainLayout from 'layout/MainLayout'; import MainLayout from 'layout/MainLayout';
import Loadable from 'ui-component/Loadable'; import Loadable from 'ui-component/Loadable';
import AuthGuard from 'utils/route-guard/AuthGuard'; import AuthGuard from 'utils/route-guard/AuthGuard';
import ResidentDataReview from '../views/biz/resident/Review';
// sample page routing // sample page routing
const SamplePage = Loadable(lazy(() => import('views/sample-page'))); const SamplePage = Loadable(lazy(() => import('views/sample-page')));
@ -56,7 +57,7 @@ const MainRoutes = {
/* 거주자 */ /* 거주자 */
{ {
path: '/resident/data', path: '/resident/data',
element: <Board /> element: <ResidentDataReview />
}, },
{ {
path: '/resident/review', path: '/resident/review',

@ -11,7 +11,7 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import opstBizService from 'apis/OpstBizService'; import { getBoardList } from '../../../apis/board';
const Board = () => { const Board = () => {
const [category, setCategory] = useState('ciTitle'); const [category, setCategory] = useState('ciTitle');
@ -63,8 +63,7 @@ const Board = () => {
}; };
} }
opstBizService.getBoardList(params).then((response) => { getBoardList(params).then((response) => {
console.log(response);
if (response && response.data) { if (response && response.data) {
setTotalCount(response.count); setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data })); setRowsState((prevState) => ({ ...prevState, rows: response.data }));

@ -1,13 +1,10 @@
import { useState } from 'react'; import { useState } from 'react';
import * as Excel from 'exceljs';
import saveAs from 'file-saver';
// material-ui // material-ui
import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material'; import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material';
// assets // assets
import { IconSearch, IconFileExport } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
// berry ui // berry ui
@ -15,13 +12,13 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import opstBizService from '../../../apis/OpstBizService';
import xitCmm from '../../../commons/XitCmm'; import xitCmm from 'commons/XitCmm';
import CmmModal from '../../form/Modal/CmmModal'; import CmmModal from 'views/form/Modal/CmmModal';
import SaveParkingSimsaForm from './SaveParkingSimsaForm'; import SaveParkingSimsaForm from './SaveParkingSimsaForm';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import ExcelDownload from '../../form/ExcelDownload'; import ExcelDownload from 'views/form/ExcelDownload';
import { getSimsaTargetList, saveSimsaTargetList } from 'apis/parking';
const ParkingRegister = () => { const ParkingRegister = () => {
const [rcIrTransfer, setRcIrTransfer] = useState('1'); const [rcIrTransfer, setRcIrTransfer] = useState('1');
@ -43,7 +40,14 @@ const ParkingRegister = () => {
{ headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 }, { headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 },
{ headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 }, { headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 },
{ headerName: '진술유형', headerAlign: 'center', field: 'rcContDocNm', minWidth: 130 }, { headerName: '진술유형', headerAlign: 'center', field: 'rcContDocNm', minWidth: 130 },
{ headerName: '접수일자', headerAlign: 'center', field: 'rcDate', align: 'center' }, {
headerName: '접수일자',
headerAlign: 'center',
field: 'rcDate',
align: 'center',
format: '####-##-##'
// valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`
},
{ headerName: '접수방법', headerAlign: 'center', field: 'rcIngbNm', align: 'center' } { headerName: '접수방법', headerAlign: 'center', field: 'rcIngbNm', align: 'center' }
]; ];
@ -54,7 +58,7 @@ const ParkingRegister = () => {
rcSeq2 rcSeq2
}; };
opstBizService.getSimsaTargetList(params).then((response) => { getSimsaTargetList(params).then((response) => {
if (response && response.data) { if (response && response.data) {
setTotalCount(response.count); setTotalCount(response.count);
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data })); setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
@ -82,14 +86,9 @@ const ParkingRegister = () => {
setOpen(false); setOpen(false);
// return false; // return false;
opstBizService.saveSimsaTargetList(param).then(() => { saveSimsaTargetList(param).then(() => {
setSelection([]); setSelection([]);
search(); search();
// console.log(response);
// if (response && response.data) {
// setTotalCount(response.count);
// setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
// }
}); });
}; };

@ -17,9 +17,9 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import opstBizService from 'apis/OpstBizService';
import xitCmm from 'commons/XitCmm'; import xitCmm from 'commons/XitCmm';
import ModalDetails from './ModalDetails'; import ModalDetails from './ModalDetails';
import { getSimsa680GroupList } from 'apis/parking';
const ParkingReview = () => { const ParkingReview = () => {
const isInit = useRef(true); const isInit = useRef(true);
@ -115,8 +115,7 @@ const ParkingReview = () => {
size: rowsState.pageSize size: rowsState.pageSize
}; };
opstBizService.getSimsa680GroupList({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { getSimsa680GroupList({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
console.log(response);
if (response && response.data) { if (response && response.data) {
setTotalCount(response.count); setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data })); setRowsState((prevState) => ({ ...prevState, rows: response.data }));
@ -144,10 +143,6 @@ const ParkingReview = () => {
search(); search();
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
const [open, setOpen] = useState(false);
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
return ( return (
<MainCard> <MainCard>
<Grid container spacing={2} alignItems="center"> <Grid container spacing={2} alignItems="center">

@ -0,0 +1,97 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import { Button, Divider, Grid } from '@mui/material';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/form/MuiDataGrid';
import PublicBoardForm from '../board/PublicBoardForm';
import CmmModal from '../../form/Modal/CmmModal';
import { getResidents } from '../../../apis/resident';
import xitCmm from '../../../commons/XitCmm';
const ResidentDataReview = () => {
const [open, setOpen] = useState(false);
const [create, setCreate] = useState(false);
const [title, setTitle] = useState();
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 10,
rows: []
// loading: false
});
const columns = [
{ headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{ headerName: '심사코드?', field: 'scCode', hide: true },
{ headerName: '접수번호', headerAlign: 'center', field: 'scSeq' },
{ headerName: '동명', headerAlign: 'center', field: 'scDong' },
{ headerName: '차량번호', headerAlign: 'center', field: 'scCarnum' },
{ headerName: '성명', headerAlign: 'center', field: 'scName' },
{ headerName: '진술유형', headerAlign: 'center', field: 'scContDocNm' },
{
headerName: '접수일자',
headerAlign: 'center',
field: 'scCdate'
// type: 'date',
// valueGetter: ({ value }) => value && new Date(value)
},
{ headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm' }
];
const search = () => {
const params = {
page: rowsState.page,
size: rowsState.pageSize
};
getResidents(params).then((response) => {
console.log(response);
if (response && response.data) {
setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
// apiRef.current.forceUpdate(); // .updateRowData([]);
// apiRef.current.updateRowData([]);
}
});
};
useEffect(() => {
search();
}, [rowsState.page, rowsState.pageSize]);
const handleCreate = () => {
setTitle('의견진술 자료 등록');
setCreate(true);
setOpen(true);
};
const handleSaveResident = () => {};
return (
<MainCard>
<Grid container alignItems="right">
<Grid item>
<Button variant="contained" size="small" onClick={handleCreate}>
의견진술 자료 등록
</Button>
</Grid>
</Grid>
<Grid item xs={12}>
<Divider />
</Grid>
<Grid item xs={12}>
<Divider />
</Grid>
<MuiDataGrid columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
<h2>자료등록 modal</h2>
</CmmModal>
</MainCard>
);
};
export default ResidentDataReview;
Loading…
Cancel
Save