공지사항 반영

main
minuk926 3 years ago
parent a66f9f8653
commit 6be8acd070

@ -1,12 +1,27 @@
import { BOARD_LIST_URL, SIMSA_DETAILS_LIST_URL, SIMSA_LIST_URL } from 'commons/ApiUrl';
import { BOARD_LIST_URL, PUBLIC_BOARD_LIST_URL, SIMSA_DETAILS_LIST_URL, SIMSA_LIST_URL } from 'commons/ApiUrl';
import axios from 'utils/axios';
class OpstBizService {
setRowId = (params, idx) => {
if (params && params.page && params.size) return params.page * params.size + idx + 1;
return idx + 1;
};
// eslint-disable-next-line no-return-await
getPublicBoardList = async (params) => {
const res = await axios.get(PUBLIC_BOARD_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
};
// eslint-disable-next-line no-return-await
getBoardList = async (params) => {
const res = await axios.get(BOARD_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: idx }));
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
@ -23,7 +38,7 @@ class OpstBizService {
getSimsa680GroupList = async (params) => {
const res = await axios.get(SIMSA_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: idx }));
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;
@ -32,7 +47,7 @@ class OpstBizService {
getSimsa680DetailList = async (params) => {
const res = await axios.get(SIMSA_DETAILS_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: idx }));
res.data = res.data.map((d, idx) => ({ ...d, rowId: this.setRowId(params, idx) }));
return res;
}
return res;

@ -2,6 +2,13 @@
// console.log(process.env.NODE_ENV)
export const LOGIN_URL = '/api/v1/ctgy/account/login';
export const CMM_CODE_LIST_URL = '/api/v1/biz/cmm/combo';
// 공지사항
export const PUBLIC_BOARD_LIST_URL = '/api/v1/ctgy/pboard';
// 게시판
export const BOARD_LIST_URL = '/api/v1/ctgy/board';
// 주정차 의견 진술
export const SIMSA_LIST_URL = '/api/v1/ctgy/simsa/review';
export const SIMSA_DETAILS_LIST_URL = '/api/v1/ctgy/simsa/details';

@ -4,8 +4,7 @@ import { useEffect, useState } from 'react';
import { Button, Divider, FormControlLabel, Grid, InputAdornment, Radio, RadioGroup, TextField } from '@mui/material';
// assets
import LinkTwoToneIcon from '@mui/icons-material/LinkTwoTone';
import LockTwoToneIcon from '@mui/icons-material/LockTwoTone';
import { IconFile, IconFileCheck, IconFileText } from '@tabler/icons';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
@ -14,6 +13,7 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiGridList from 'views/form/MuiGridList';
import InputLabel from 'ui-component/extended/Form/InputLabel';
import opstBizService from '../../../apis/OpstBizService';
import * as React from 'react';
const PublicBoard = () => {
const [totalCount, setTotalCount] = useState(0);
@ -25,22 +25,26 @@ const PublicBoard = () => {
});
const columns = [
{ headerName: '게시판코드', field: 'ciCode' },
{ headerName: '글번호', field: 'ciContentno' },
{ headerName: '제목', field: 'ciTitle', editable: true },
{ headerName: '사용자ID', field: 'ciId' },
{ headerName: '사용자 비번', field: 'ciPwd' },
{ headerName: '사용자 이름', field: 'ciName' },
{ headerName: '등록일', field: 'ciNalja' },
{ headerName: '등록시간', field: 'ciTime' },
{ headerName: '조회수', field: 'ciHit' },
{ headerName: 'ref', field: 'ciRef' },
{ headerName: 'step', field: 'ciStep' },
{ headerName: 'level', field: 'ciRevel' },
{ headerName: '비번', field: 'ciPass' },
{ headerName: 'email', field: 'ciEmail' },
{ headerName: '내용', field: 'ciContents' },
{ headerName: 'IP', field: `ciIp` }
{ headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{
headerName: '업무구분',
headerAlign: 'center',
field: 'inDept',
align: 'center'
},
{ headerName: '제목', headerAlign: 'center', field: 'inTitle', minWidth: 200 },
{
headerName: '첨부파일',
headerAlign: 'center',
field: 'inFile',
align: 'center',
renderCell: (params) => {
console.log(params.row.inFilename);
return <>{params.row.inFilename ? <IconFileText stroke={1.5} size="1rem" /> : ''}</>;
}
},
{ headerName: '작성일자', headerAlign: 'center', field: 'inNalja', align: 'center' },
{ headerName: '조회수', headerAlign: 'center', field: 'inHit', align: 'right' }
];
useEffect(() => {
@ -49,7 +53,7 @@ const PublicBoard = () => {
size: rowsState.pageSize
};
opstBizService.getBoardList(params).then((response) => {
opstBizService.getPublicBoardList(params).then((response) => {
console.log(response);
if (response && response.data) {
setTotalCount(response.count);

@ -124,7 +124,7 @@ const ParkingReview = () => {
minWidth: 125,
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`
},
{ headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.value === '1' ? '진행중' : '심사완료'}</> },
{ headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</> },
{
headerName: '삭제',
field: 'actions',

@ -9,7 +9,7 @@ import dataGridKoKR from './defaultDataGridLocale';
// project imports
const MuiGridList = ({
setRowId,
isCheckbox = false,
columns,
rowsState = { page: 0, pageSize: 1000, rows: [] },
totalCount = 0,
@ -45,7 +45,7 @@ const MuiGridList = ({
paginationMode="server"
getRowId={(row) => row.rowId}
rowCount={totalCount}
checkboxSelection
checkboxSelection={isCheckbox}
disableSelectionOnClick
// isRowSelectable={(params: any) => params.row.id > 0}
// rows={tableData}
@ -63,7 +63,7 @@ const MuiGridList = ({
};
MuiGridList.propTypes = {
setRowId: PropTypes.func,
isCheckbox: PropTypes.bool,
columns: PropTypes.array,
rowsState: PropTypes.any,
totalCount: PropTypes.number,

Loading…
Cancel
Save