commit
456f48edd6
@ -1,3 +1,3 @@
|
||||
REACT_APP_VERSION = v0.0.1
|
||||
REACT_APP_API_URL=http://localhost:8090
|
||||
REACT_APP_SERVER_TIMEOUT=60000
|
||||
REACT_APP_SERVER_TIMEOUT=6000
|
@ -1,133 +0,0 @@
|
||||
import axios, { AxiosInstance, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import Swal from 'sweetalert2';
|
||||
|
||||
type CustomResponseFormat<T = any> = {
|
||||
response: T, // e<T>;
|
||||
refreshedToken?: string
|
||||
};
|
||||
|
||||
export interface CustomInstance extends AxiosInstance {
|
||||
interceptors: {
|
||||
request: AxiosInterceptorManager<AxiosRequestConfig>,
|
||||
response: AxiosInterceptorManager<AxiosResponse<CustomResponseFormat>>
|
||||
};
|
||||
|
||||
getUri(config?: AxiosRequestConfig): string;
|
||||
|
||||
request<T>(config: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
get<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
head<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
options<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
put<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
|
||||
patch<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
}
|
||||
|
||||
const reqApi: CustomInstance = axios.create({
|
||||
baseURL: process.env.NODE_ENV === 'development' ? process.env.REACT_APP_API_URL : '',
|
||||
withCredentials: process.env.NODE_ENV === 'development', // 개발시만 사용 : crossdomain
|
||||
timeout: 1000
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json'
|
||||
// // AUTH_HEADER_NAME: accessToken
|
||||
// }
|
||||
// params: {key: key}
|
||||
});
|
||||
|
||||
/**
|
||||
* before axios request
|
||||
*/
|
||||
reqApi.interceptors.request.use(
|
||||
(config) => {
|
||||
Swal.fire({
|
||||
title: 'Please Wait ...',
|
||||
// html: '',
|
||||
// imageUrl:
|
||||
// timer: 10000,
|
||||
didOpen: () => Swal.showLoading()
|
||||
}).then((r) => {});
|
||||
return config;
|
||||
},
|
||||
({ config, request, response, ...error }) => {
|
||||
console.error('========== ApiService.request error Data ==========');
|
||||
return alertError(config, request, response, error);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* after axios response
|
||||
*/
|
||||
reqApi.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
Swal.close();
|
||||
if (!response.data.success) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Api Error',
|
||||
html: `${response.data.message}`,
|
||||
// imageUrl:
|
||||
timer: 5000
|
||||
}).then((r) => {});
|
||||
console.log(response);
|
||||
}
|
||||
return Promise.resolve(response.data);
|
||||
},
|
||||
({ config, request, response, ...error }) => {
|
||||
console.error('========== ApiService.response Error Data ==========');
|
||||
alertError(config, request, response, error);
|
||||
// error 데이타 return
|
||||
// return response.data;
|
||||
return error;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 에러 처리
|
||||
* TODO :: 토큰 에러인 경우 업무 정의에 따라 alert 처리 여부등 결정하여 내용 추가
|
||||
* @param config
|
||||
* @param request
|
||||
* @param response
|
||||
* @param error
|
||||
*/
|
||||
const alertError = (config: AxiosRequestConfig, request: any, response: AxiosResponse, error: Error) => {
|
||||
if (!response) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Api Error',
|
||||
html: `시스템 에러~~~~~~~~~~~~`,
|
||||
// imageUrl:
|
||||
timer: 5000
|
||||
}).then((r) => {});
|
||||
return;
|
||||
}
|
||||
|
||||
const errCode = response.data.code;
|
||||
const errMsg = response.data.error;
|
||||
console.error(`${errCode}: ${errMsg}`);
|
||||
console.error('=================================');
|
||||
|
||||
// Alert.error(`${errCode}: ${errMsg}`);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Api Error',
|
||||
html: `${errCode}: ${errMsg}`,
|
||||
// imageUrl:
|
||||
timer: 5000
|
||||
}).then((r) => {});
|
||||
|
||||
// return Promise.reject({
|
||||
// config,
|
||||
// //message: errMsg,
|
||||
// response,
|
||||
// ...error
|
||||
// })
|
||||
};
|
||||
export default reqApi;
|
@ -1,14 +0,0 @@
|
||||
import { BOARD_LIST_URL } from 'commons/ApiUrl';
|
||||
import axios from 'utils/axios';
|
||||
|
||||
class BoardService {
|
||||
// eslint-disable-next-line no-return-await
|
||||
getBoardList = async (params) => await axios.get(BOARD_LIST_URL, { params });
|
||||
// const res = await axios.get(BOARD_LIST_URL, { params });
|
||||
// return res;
|
||||
// axios.get(BOARD_LIST_URL, { params }).then((r) => {
|
||||
// console.log(r);
|
||||
// return r;
|
||||
// });
|
||||
}
|
||||
export default new BoardService();
|
@ -1,17 +1,17 @@
|
||||
import reqApi from './ApiService';
|
||||
import { CMM_CODE_LIST_URL } from 'commons/ApiUrl';
|
||||
import { IApiResponse } from 'types/api';
|
||||
import { IComboCode, IParam } from 'types/Data';
|
||||
import axios from 'utils/axios';
|
||||
|
||||
class CmmService {
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
getComboCodeList(params) {
|
||||
return reqApi.get(CMM_CODE_LIST_URL, { params });
|
||||
// .then(r => console.log(r))
|
||||
// .catch(e => {
|
||||
// console.log(e)
|
||||
// });
|
||||
}
|
||||
// eslint-disable-next-line no-return-await
|
||||
getComboCodeList = async (params) => await axios.get(CMM_CODE_LIST_URL, { params });
|
||||
|
||||
// getComboCodeList(params) {
|
||||
// return reqApi.get(CMM_CODE_LIST_URL, { params });
|
||||
// .then(r => console.log(r))
|
||||
// .catch(e => {
|
||||
// console.log(e)
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
export default CmmService;
|
||||
|
@ -0,0 +1,32 @@
|
||||
import { BOARD_LIST_URL, SIMSA_LIST_URL } from 'commons/ApiUrl';
|
||||
import axios from 'utils/axios';
|
||||
|
||||
class OpstBizService {
|
||||
// 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 }));
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
// const res = await axios.get(BOARD_LIST_URL, { params });
|
||||
// return res;
|
||||
// axios.get(BOARD_LIST_URL, { params }).then((r) => {
|
||||
// console.log(r);
|
||||
// return r;
|
||||
// });
|
||||
|
||||
// eslint-disable-next-line no-return-await
|
||||
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 }));
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
export default new OpstBizService();
|
@ -1,121 +0,0 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
// material-ui
|
||||
import { DataGrid } from '@mui/x-data-grid';
|
||||
import { Box, Button } from '@mui/material';
|
||||
import ListItemText from '@mui/material/ListItemText';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
|
||||
// project imports
|
||||
import CmmService from 'apis/CmmService';
|
||||
import boardService from '../../../apis/BoardService';
|
||||
|
||||
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',
|
||||
renderCell: (params) => (
|
||||
<strong>
|
||||
{params.value}
|
||||
<Button variant="contained" color="primary" size="small">
|
||||
Open
|
||||
</Button>
|
||||
</strong>
|
||||
)
|
||||
},
|
||||
{ headerName: '내용', field: 'ciContents' },
|
||||
{
|
||||
headerName: 'IP',
|
||||
field: `ciIp`
|
||||
}
|
||||
];
|
||||
|
||||
const cmmService = new CmmService();
|
||||
|
||||
const BoardList = () => {
|
||||
const theme = useTheme();
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 5,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
const [ciDiv, setCiDiv] = useState();
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
page: rowsState.page + 1,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
boardService.getBoardList(params).then((response) => {
|
||||
console.log(response);
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
}
|
||||
});
|
||||
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
||||
|
||||
return (
|
||||
// <CardContent>
|
||||
// <div style={{ height: 700, width: '100%' }}>
|
||||
<Box
|
||||
sx={{
|
||||
height: 700,
|
||||
width: '100%',
|
||||
'& .MuiDataGrid-root': {
|
||||
border: 'none',
|
||||
'& .MuiDataGrid-cell': {
|
||||
borderColor: theme.palette.mode === 'dark' ? theme.palette.text.primary + 15 : 'grey.200'
|
||||
},
|
||||
'& .MuiDataGrid-columnsContainer': {
|
||||
color: theme.palette.mode === 'dark' ? 'grey.600' : 'grey.900',
|
||||
borderColor: theme.palette.mode === 'dark' ? theme.palette.text.primary + 15 : 'grey.200'
|
||||
},
|
||||
'& .MuiDataGrid-columnSeparator': {
|
||||
color: theme.palette.mode === 'dark' ? theme.palette.text.primary + 15 : 'grey.200'
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
paginationMode="server"
|
||||
getRowId={(row) => row.ciContentno}
|
||||
rowCount={totalCount}
|
||||
checkboxSelection
|
||||
disableSelectionOnClick
|
||||
// isRowSelectable={(params: any) => params.row.id > 0}
|
||||
// rows={tableData}
|
||||
columns={columns}
|
||||
// pageSize={pageSize}
|
||||
{...rowsState}
|
||||
onPageChange={(page) => setRowsState((prev) => ({ ...prev, page }))}
|
||||
onPageSizeChange={(pageSize) => setRowsState((prev) => ({ ...prev, pageSize }))}
|
||||
rowsPerPageOptions={[5, 10, 50, 100]}
|
||||
pagination
|
||||
/>
|
||||
<NavLink to="/writeBoard">
|
||||
<ListItemText>글쓰기</ListItemText>
|
||||
</NavLink>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default BoardList;
|
@ -0,0 +1,74 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
// material-ui
|
||||
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';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiGridList from 'ui-component/MuiGridList';
|
||||
import InputLabel from 'ui-component/extended/Form/InputLabel';
|
||||
import opstBizService from '../../../apis/OpstBizService';
|
||||
|
||||
const PublicBoard = () => {
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
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` }
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
opstBizService.getBoardList(params).then((response) => {
|
||||
console.log(response);
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
}
|
||||
});
|
||||
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
|
||||
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default PublicBoard;
|
@ -1,211 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
// material-ui
|
||||
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';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiGridList from 'ui-component/MuiGridList';
|
||||
import InputLabel from 'ui-component/extended/Form/InputLabel';
|
||||
import boardService from '../../../apis/BoardService';
|
||||
|
||||
const Index = () => {
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 5,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
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',
|
||||
renderCell: (params) => (
|
||||
<strong>
|
||||
{params.value}
|
||||
<Button variant="contained" color="primary" size="small">
|
||||
Open
|
||||
</Button>
|
||||
</strong>
|
||||
)
|
||||
},
|
||||
{ headerName: '내용', field: 'ciContents' },
|
||||
{
|
||||
headerName: 'IP',
|
||||
field: `ciIp`
|
||||
}
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
page: rowsState.page + 1,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
boardService.getBoardList(params).then((response) => {
|
||||
console.log(response);
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
}
|
||||
});
|
||||
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Name :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField fullWidth placeholder="Enter full name" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Email :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField fullWidth placeholder="Enter email" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Password :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField
|
||||
type="password"
|
||||
fullWidth
|
||||
placeholder="Enter Password"
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<LockTwoToneIcon />
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Contact :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField fullWidth placeholder="Enter contact number" />
|
||||
{/* <FormHelperText>Please enter your contact</FormHelperText> */}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Profile URL :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField
|
||||
fullWidth
|
||||
placeholder="Please enter your Profile URL"
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<LinkTwoToneIcon />
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Pincode :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField fullWidth placeholder="Enter your postcode" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
Address :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<TextField fullWidth placeholder="Enter your address" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={4}>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
||||
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
||||
User Type :
|
||||
</InputLabel>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={9} lg={8}>
|
||||
<RadioGroup aria-label="gender" name="controlled-radio-buttons-group">
|
||||
<FormControlLabel value="female" control={<Radio />} label="Administrator" />
|
||||
<FormControlLabel value="male" control={<Radio />} label="Author" />
|
||||
</RadioGroup>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
|
||||
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default Index;
|
@ -0,0 +1,131 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import _ from 'lodash';
|
||||
|
||||
// material-ui
|
||||
import {
|
||||
Button,
|
||||
Divider,
|
||||
FormControl,
|
||||
FormControlLabel,
|
||||
FormLabel,
|
||||
Grid,
|
||||
InputAdornment,
|
||||
MenuItem,
|
||||
OutlinedInput,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
Select
|
||||
} from '@mui/material';
|
||||
import MuiTooltip from '@mui/material/Tooltip';
|
||||
|
||||
// assets
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiGridList from 'ui-component/MuiGridList';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import AnimateButton from '../../../ui-component/extended/AnimateButton';
|
||||
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
|
||||
|
||||
const ParkingRegister = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
const [category, setCategory] = useState('N');
|
||||
const [searchTxt, setSearchTxt] = useState('');
|
||||
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
const [spacing, setSpacing] = useState(2);
|
||||
|
||||
const columns = [
|
||||
{ headerName: '심의차수', field: 'ciCode' },
|
||||
{ headerName: '심사건수', field: 'ciContentno' },
|
||||
{ headerName: '심사기간', field: 'ciTitle', editable: true },
|
||||
{ headerName: '심사마감일시', field: 'ciId' },
|
||||
{ headerName: '상태', field: 'ciPwd' },
|
||||
{
|
||||
headerName: '삭제하기',
|
||||
field: 'ciEmail',
|
||||
renderCell: (params) => (
|
||||
<>
|
||||
{params.value}
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
size="small"
|
||||
sx={{ background: theme.palette.error.main, '&:hover': { background: theme.palette.error.dark } }}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
];
|
||||
const handleSearch = async (event) => {};
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
}, [rowsState.page, rowsState.pageSize]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} lg={6}>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item>
|
||||
<FormControl component="fieldset">
|
||||
<FormLabel component="legend" required>
|
||||
자료등록여부
|
||||
</FormLabel>
|
||||
<RadioGroup
|
||||
row
|
||||
aria-label="category"
|
||||
name="row-radio-buttons-group"
|
||||
value={category}
|
||||
onChange={(e) => setCategory(e.target.value)}
|
||||
>
|
||||
<FormControlLabel value="N" control={<Radio />} label="미등록" />
|
||||
<FormControlLabel value="Y" control={<Radio />} label="등록" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" autoFocus />
|
||||
-
|
||||
<OutlinedInput placeholder="접수번호" onKeyDown={handleSearch} size="small" />
|
||||
{/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */}
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<AnimateButton>
|
||||
<Button variant="contained" color="primary" size="small" onClick={handleSearch}>
|
||||
검색
|
||||
</Button>
|
||||
</AnimateButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default ParkingRegister;
|
@ -0,0 +1,180 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import _ from 'lodash';
|
||||
import format from 'date-fns/format';
|
||||
import getYear from 'date-fns/getYear';
|
||||
|
||||
// material-ui
|
||||
import { GridActionsCellItem } from '@mui/x-data-grid';
|
||||
import { Divider, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material';
|
||||
import DeleteIcon from '@mui/icons-material/Delete';
|
||||
import MuiTooltip from '@mui/material/Tooltip';
|
||||
|
||||
// assets
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiGridList from 'ui-component/MuiGridList';
|
||||
import opstBizService from 'apis/OpstBizService';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import xitCmm from 'commons/XitCmm';
|
||||
|
||||
const ParkingReview = () => {
|
||||
const isInit = useRef(true);
|
||||
|
||||
const theme = useTheme();
|
||||
const year = getYear(new Date());
|
||||
console.log(typeof year);
|
||||
const years = _.range(year, year - 14, -1);
|
||||
|
||||
const [selectedYear, setSelectedYear] = useState(year);
|
||||
const [searchTxt, setSearchTxt] = useState('');
|
||||
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
const [rows, setRows] = useState();
|
||||
|
||||
const removeSimsa = useCallback(
|
||||
(row) => () => {
|
||||
// setTimeout(() => {
|
||||
// setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId));
|
||||
// });
|
||||
xitCmm.alertParam(`삭제대상<br>${JSON.stringify(row)}`);
|
||||
console.log(row);
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
/*
|
||||
ms_maincode : '민원코드'
|
||||
ms_seq : '접수번호'
|
||||
ms_carnum : '차량번호'
|
||||
ms_year : '년도'
|
||||
ms_chasu : '차수'
|
||||
ms_sdate : '심사시작일시'
|
||||
ms_startsi : '심사시작시간'
|
||||
ms_edate : '심사종료일시'
|
||||
ms_cdate : '심사마감일시'
|
||||
ms_closesi : '심사마감시간'
|
||||
ms_wdate : '단속일자'
|
||||
ms_pos : '단속장소'
|
||||
ms_result : '결과코드'
|
||||
ms_jbtime : '단속시간'
|
||||
*/
|
||||
const columns = [
|
||||
// { headerName: 'rowId', field: 'rowId' },
|
||||
{ headerName: '심의차수', field: 'msChasu' },
|
||||
{ headerName: '심사건수', field: 'cnt' },
|
||||
{
|
||||
headerName: '심사기간',
|
||||
field: 'msDate',
|
||||
minWidth: 180,
|
||||
description: 'dddddd',
|
||||
valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`,
|
||||
renderCell: (params) => (
|
||||
<Link underline="hover" href="/board" target="_blank">
|
||||
{params.value}
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
headerName: '심사마감일시',
|
||||
field: 'msCdate',
|
||||
type: 'dateTime',
|
||||
minWidth: 125,
|
||||
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`
|
||||
},
|
||||
{ headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.value === '1' ? '진행중' : '심사완료'}</> },
|
||||
{
|
||||
headerName: '삭제',
|
||||
field: 'actions',
|
||||
type: 'actions',
|
||||
width: 80,
|
||||
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeSimsa(params.row)} />]
|
||||
}
|
||||
];
|
||||
|
||||
const search = () => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
opstBizService.getSimsa680GroupList({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
|
||||
console.log(response);
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleSearch = async (event) => {
|
||||
if (!selectedYear) return;
|
||||
|
||||
if (event.type === 'keydown' && event.key === 'Enter') {
|
||||
const newString = event?.target.value;
|
||||
setSearchTxt(newString);
|
||||
search();
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (isInit.current) {
|
||||
isInit.current = false;
|
||||
return;
|
||||
}
|
||||
search();
|
||||
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} lg={6}>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item>
|
||||
<MuiTooltip title="의견진술 심의 년도">
|
||||
<Select id="reviewYear" name="reviewYear" defaultValue={year} onChange={(e) => setSelectedYear(e.target.value)}>
|
||||
{years.map((year, idx) => (
|
||||
<MenuItem key={idx} value={year}>
|
||||
{year}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</MuiTooltip>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<OutlinedInput
|
||||
placeholder="심의차수"
|
||||
onKeyDown={handleSearch}
|
||||
size="small"
|
||||
autoFocus
|
||||
endAdornment={
|
||||
<InputAdornment position="end">
|
||||
<IconSearch stroke={1.5} size="1rem" />
|
||||
</InputAdornment>
|
||||
}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default ParkingReview;
|
Loading…
Reference in New Issue