From 6be8acd0706de2de3123e240e04211af7f3de061 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 18 Mar 2022 20:18:45 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/OpstBizService.js | 23 +++++++++++++--- src/commons/ApiUrl.js | 7 +++++ src/views/biz/board/PublicBoard.jsx | 42 ++++++++++++++++------------- src/views/biz/parking/Review.jsx | 2 +- src/views/form/MuiGridList.jsx | 6 ++--- 5 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/apis/OpstBizService.js b/src/apis/OpstBizService.js index 9f029ea..fffa843 100644 --- a/src/apis/OpstBizService.js +++ b/src/apis/OpstBizService.js @@ -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; diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index e27a60b..224ef47 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -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'; diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index 02c7283..d6aec5c 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -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 ? : ''}; + } + }, + { 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); diff --git a/src/views/biz/parking/Review.jsx b/src/views/biz/parking/Review.jsx index 10c403d..800a468 100644 --- a/src/views/biz/parking/Review.jsx +++ b/src/views/biz/parking/Review.jsx @@ -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', diff --git a/src/views/form/MuiGridList.jsx b/src/views/form/MuiGridList.jsx index ef280ab..dcc9454 100644 --- a/src/views/form/MuiGridList.jsx +++ b/src/views/form/MuiGridList.jsx @@ -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,