feat: 거주자 의견진술 반영
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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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…
Reference in New Issue