공지사항 반영

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'; import axios from 'utils/axios';
class OpstBizService { 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 // eslint-disable-next-line no-return-await
getBoardList = async (params) => { getBoardList = async (params) => {
const res = await axios.get(BOARD_LIST_URL, { params }); const res = await axios.get(BOARD_LIST_URL, { params });
if (res.success) { 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;
} }
return res; return res;
@ -23,7 +38,7 @@ class OpstBizService {
getSimsa680GroupList = async (params) => { getSimsa680GroupList = async (params) => {
const res = await axios.get(SIMSA_LIST_URL, { params }); const res = await axios.get(SIMSA_LIST_URL, { params });
if (res.success) { 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;
} }
return res; return res;
@ -32,7 +47,7 @@ class OpstBizService {
getSimsa680DetailList = async (params) => { getSimsa680DetailList = async (params) => {
const res = await axios.get(SIMSA_DETAILS_LIST_URL, { params }); const res = await axios.get(SIMSA_DETAILS_LIST_URL, { params });
if (res.success) { 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;
} }
return res; return res;

@ -2,6 +2,13 @@
// console.log(process.env.NODE_ENV) // console.log(process.env.NODE_ENV)
export const LOGIN_URL = '/api/v1/ctgy/account/login'; export const LOGIN_URL = '/api/v1/ctgy/account/login';
export const CMM_CODE_LIST_URL = '/api/v1/biz/cmm/combo'; 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 BOARD_LIST_URL = '/api/v1/ctgy/board';
// 주정차 의견 진술
export const SIMSA_LIST_URL = '/api/v1/ctgy/simsa/review'; export const SIMSA_LIST_URL = '/api/v1/ctgy/simsa/review';
export const SIMSA_DETAILS_LIST_URL = '/api/v1/ctgy/simsa/details'; 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'; import { Button, Divider, FormControlLabel, Grid, InputAdornment, Radio, RadioGroup, TextField } from '@mui/material';
// assets // assets
import LinkTwoToneIcon from '@mui/icons-material/LinkTwoTone'; import { IconFile, IconFileCheck, IconFileText } from '@tabler/icons';
import LockTwoToneIcon from '@mui/icons-material/LockTwoTone';
// berry ui // berry ui
import MainCard from 'ui-component/cards/MainCard'; 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 MuiGridList from 'views/form/MuiGridList';
import InputLabel from 'ui-component/extended/Form/InputLabel'; import InputLabel from 'ui-component/extended/Form/InputLabel';
import opstBizService from '../../../apis/OpstBizService'; import opstBizService from '../../../apis/OpstBizService';
import * as React from 'react';
const PublicBoard = () => { const PublicBoard = () => {
const [totalCount, setTotalCount] = useState(0); const [totalCount, setTotalCount] = useState(0);
@ -25,22 +25,26 @@ const PublicBoard = () => {
}); });
const columns = [ const columns = [
{ headerName: '게시판코드', field: 'ciCode' }, { headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{ headerName: '글번호', field: 'ciContentno' }, {
{ headerName: '제목', field: 'ciTitle', editable: true }, headerName: '업무구분',
{ headerName: '사용자ID', field: 'ciId' }, headerAlign: 'center',
{ headerName: '사용자 비번', field: 'ciPwd' }, field: 'inDept',
{ headerName: '사용자 이름', field: 'ciName' }, align: 'center'
{ headerName: '등록일', field: 'ciNalja' }, },
{ headerName: '등록시간', field: 'ciTime' }, { headerName: '제목', headerAlign: 'center', field: 'inTitle', minWidth: 200 },
{ headerName: '조회수', field: 'ciHit' }, {
{ headerName: 'ref', field: 'ciRef' }, headerName: '첨부파일',
{ headerName: 'step', field: 'ciStep' }, headerAlign: 'center',
{ headerName: 'level', field: 'ciRevel' }, field: 'inFile',
{ headerName: '비번', field: 'ciPass' }, align: 'center',
{ headerName: 'email', field: 'ciEmail' }, renderCell: (params) => {
{ headerName: '내용', field: 'ciContents' }, console.log(params.row.inFilename);
{ headerName: 'IP', field: `ciIp` } 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(() => { useEffect(() => {
@ -49,7 +53,7 @@ const PublicBoard = () => {
size: rowsState.pageSize size: rowsState.pageSize
}; };
opstBizService.getBoardList(params).then((response) => { opstBizService.getPublicBoardList(params).then((response) => {
console.log(response); console.log(response);
if (response && response.data) { if (response && response.data) {
setTotalCount(response.count); setTotalCount(response.count);

@ -124,7 +124,7 @@ const ParkingReview = () => {
minWidth: 125, minWidth: 125,
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}` 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: '삭제', headerName: '삭제',
field: 'actions', field: 'actions',

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

Loading…
Cancel
Save