diff --git a/src/apis/CmmService.js b/src/apis/CmmService.js index 2c3d0b3..1b79e38 100644 --- a/src/apis/CmmService.js +++ b/src/apis/CmmService.js @@ -1,9 +1,9 @@ -import { CMM_CODE_LIST_URL } from 'commons/ApiUrl'; +import { GET_CMM_CODE_LIST } from 'commons/ApiUrl'; import axios from 'utils/axios'; class CmmService { // eslint-disable-next-line no-return-await - getComboCodeList = async (params) => await axios.get(CMM_CODE_LIST_URL, { params }); + getComboCodeList = async (params) => await axios.get(GET_CMM_CODE_LIST, { params }); // getComboCodeList(params) { // return reqApi.get(CMM_CODE_LIST_URL, { params }); diff --git a/src/apis/OpstBizService.js b/src/apis/OpstBizService.js index ffae03e..70ef059 100644 --- a/src/apis/OpstBizService.js +++ b/src/apis/OpstBizService.js @@ -1,9 +1,10 @@ import { - BOARD_LIST_URL, - PUBLIC_BOARD_LIST_URL, - PARKING_SIMSA_DETAILS_LIST_URL, - PARKING_SIMSA_LIST_URL, - PARKING_SIMSA_TARGET_LIST_URL + 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 } from 'commons/ApiUrl'; import axios from 'utils/axios'; @@ -15,7 +16,7 @@ class OpstBizService { // eslint-disable-next-line no-return-await getPublicBoardList = async (params) => { - const res = await axios.get(PUBLIC_BOARD_LIST_URL, { 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; @@ -25,7 +26,7 @@ class OpstBizService { // eslint-disable-next-line no-return-await getBoardList = async (params) => { - const res = await axios.get(BOARD_LIST_URL, { 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; @@ -42,7 +43,7 @@ class OpstBizService { // eslint-disable-next-line no-return-await getSimsa680GroupList = async (params) => { - const res = await axios.get(PARKING_SIMSA_LIST_URL, { 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; @@ -51,7 +52,7 @@ class OpstBizService { }; getSimsa680DetailList = async (params) => { - const res = await axios.get(PARKING_SIMSA_DETAILS_LIST_URL, { 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; @@ -60,12 +61,23 @@ class OpstBizService { }; getSimsaTargetList = async (params) => { - const res = await axios.get(PARKING_SIMSA_TARGET_LIST_URL, { 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; + }; + + SAVE_PARKING_SIMSA_TARGET; } export default new OpstBizService(); diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 105a375..d320281 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -1,15 +1,16 @@ // const URL = process.env.NODE_ENV !== 'development' ? process.env.REACT_APP_API_URL : '' // 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 GET_CMM_CODE_LIST = '/api/v1/biz/cmm/combo'; // 공지사항 -export const PUBLIC_BOARD_LIST_URL = '/api/v1/ctgy/pboard'; +export const GET_PUBLIC_BOARD_LIST = '/api/v1/ctgy/pboard'; // 게시판 -export const BOARD_LIST_URL = '/api/v1/ctgy/board'; +export const GET_BOARD_LIST = '/api/v1/ctgy/board'; // 주정차 의견 진술 -export const PARKING_SIMSA_LIST_URL = '/api/v1/ctgy/parking'; -export const PARKING_SIMSA_DETAILS_LIST_URL = '/api/v1/ctgy/parking/details'; -export const PARKING_SIMSA_TARGET_LIST_URL = '/api/v1/ctgy/parking/target'; +export const GET_PARKING_SIMSA_LIST = '/api/v1/ctgy/parking'; +export const GET_PARKING_SIMSA_DETAILS_LIST = '/api/v1/ctgy/parking/details'; +export const GET_PARKING_SIMSA_TARGET_LIST = '/api/v1/ctgy/parking/target'; +export const SAVE_PARKING_SIMSA_TARGET = '/api/v1/ctgy/parking/target'; diff --git a/src/commons/constants.js b/src/commons/constants.js index acc5a31..999a7b7 100644 --- a/src/commons/constants.js +++ b/src/commons/constants.js @@ -1,3 +1,3 @@ export const ACCESS_TOKEN_NAME = 'accessToken'; -export const REFRESH_TOKEN_NAME = 'accessToken'; +export const REFRESH_TOKEN_NAME = 'refreshToken'; export const AUTH_HEADER_NAME = 'Authorization'; diff --git a/src/menu-items/other.js b/src/menu-items/other.js index 1dbbdde..818ffc6 100755 --- a/src/menu-items/other.js +++ b/src/menu-items/other.js @@ -19,7 +19,7 @@ const other = { children: [ { id: 'modalForm', - title: , + title: , type: 'item', url: '/modalForm', icon: icons.IconHelp diff --git a/src/utils/axios.js b/src/utils/axios.js index 5488322..62548db 100755 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -8,11 +8,11 @@ import Swal from 'sweetalert2'; const axiosService = axios.create({ baseURL: process.env.NODE_ENV === 'development' ? process.env.REACT_APP_API_URL : '', withCredentials: process.env.NODE_ENV === 'development', // 개발시만 사용 : crossdomain - timeout: Number(process.env.REACT_APP_SERVER_TIMEOUT) - // headers: { - // 'Content-Type': 'application/json' - // // AUTH_HEADER_NAME: accessToken - // } + timeout: Number(process.env.REACT_APP_SERVER_TIMEOUT), + headers: { + 'Content-Type': 'application/json' + // // AUTH_HEADER_NAME: accessToken + } // params: {key: key} }); diff --git a/src/utils/locales/en.json b/src/utils/locales/en.json index 51dc90d..54316b0 100755 --- a/src/utils/locales/en.json +++ b/src/utils/locales/en.json @@ -15,6 +15,7 @@ "dashboard": "Dashboard", "default": "Default", "analytics": "Analytics", + "modalForm": "Modal Form", "widget": "Widget", "statistics": "Statistics", diff --git a/src/utils/locales/ko.json b/src/utils/locales/ko.json index b632e20..9a7be89 100755 --- a/src/utils/locales/ko.json +++ b/src/utils/locales/ko.json @@ -15,6 +15,7 @@ "dashboard": "Dashboard", "default": "Default", "analytics": "Analytics", + "modalForm": "Modal Form", "widget": "Widget", "statistics": "Statistics", diff --git a/src/views/biz/board/Board.jsx b/src/views/biz/board/Board.jsx index 50b6b0a..ee7bc49 100644 --- a/src/views/biz/board/Board.jsx +++ b/src/views/biz/board/Board.jsx @@ -23,7 +23,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiGridPagination from 'views/form/MuiGridPagination'; +import MuiDataGrid from 'views/form/MuiDataGrid'; import opstBizService from 'apis/OpstBizService'; const Board = () => { @@ -126,7 +126,7 @@ const Board = () => { - + ); }; diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index 386ebcf..d93da21 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -10,7 +10,7 @@ import { IconFile, IconFileCheck, IconFileText } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiGridPagination from 'views/form/MuiGridPagination'; +import MuiDataGrid from 'views/form/MuiDataGrid'; import InputLabel from 'ui-component/extended/Form/InputLabel'; import opstBizService from '../../../apis/OpstBizService'; import * as React from 'react'; @@ -71,7 +71,7 @@ const PublicBoard = () => { - + ); }; diff --git a/src/views/biz/parking/Regist.jsx b/src/views/biz/parking/Regist.jsx index 62e3501..7a98bbd 100644 --- a/src/views/biz/parking/Regist.jsx +++ b/src/views/biz/parking/Regist.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; -import _ from 'lodash'; +import dateformat from 'date-fns/format'; // material-ui import { @@ -11,11 +11,13 @@ import { FormLabel, Grid, InputAdornment, + InputLabel, MenuItem, OutlinedInput, Radio, RadioGroup, - Select + Select, + TextField } from '@mui/material'; import MuiTooltip from '@mui/material/Tooltip'; @@ -27,7 +29,7 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiGridPagination from 'views/form/MuiGridPagination'; +import MuiDataGrid from 'views/form/MuiDataGrid'; import { useTheme } from '@mui/material/styles'; import opstBizService from '../../../apis/OpstBizService'; @@ -35,6 +37,8 @@ import xitCmm from '../../../commons/XitCmm'; import CmmModal from '../../form/Modal/CmmModal'; import * as React from 'react'; import SaveParkingSimsaForm from './SaveParkingSimsaForm'; +import NumberFormat from 'react-number-format'; +import { MuiDatePicker } from '../../form/MuiDatePicker'; const ParkingRegister = () => { const theme = useTheme(); @@ -81,13 +85,31 @@ const ParkingRegister = () => { if (selection.length === 0) { xitCmm.alertParam(`처리할 데이타가 없습니다`); } else { - const selectRows = selection.map((d) => rowsStatus.rows[d - 1].rcSeq); - setOpen(true); // alert(`저장할 데이타 => ${selectRows}`); } }; + const submitParkingSimsa = (params) => { + const rcCodes = []; + selection.map((d) => rcCodes.push(rowsStatus.rows[d - 1].rcCode)); + + const param = { + ...params, + rcCodes // selection.map((d) => rowsStatus.rows[d - 1].rcCode) + }; + alert(JSON.stringify(param)); + setOpen(false); + + opstBizService.saveSimsaTargetList(param).then((response) => { + console.log(response); + // if (response && response.data) { + // setTotalCount(response.count); + // setRowsState((prevState) => ({ ...prevState, rows: response.data })); + // } + }); + }; + const handleSearch = (event) => { if (rcSeq1 && rcSeq2) { search(); @@ -111,7 +133,7 @@ const ParkingRegister = () => { - + 자료등록여부 @@ -128,26 +150,33 @@ const ParkingRegister = () => { - setRcSeq1(e.target.value)} - placeholder="접수번호(10자리)-strat" + onChange={(e) => setRcSeq1(e.target.value.replace(/-/g, ''))} + placeholder="yyyy-MM-9999" onKeyDown={handleOnKeyDown} - size="small" - autoFocus - inputProps={{ maxLength: 10 }} + label="접수번호(시작)" + format="####-######" />  -  - setRcSeq2(e.target.value)} - placeholder="접수번호(10자리)-end" + onChange={(e) => setRcSeq2(e.target.value.replace(/-/g, ''))} + placeholder="yyyy-MM-9999" onKeyDown={handleOnKeyDown} - size="small" - inputProps={{ required: true, maxLength: 10 }} + label="접수번호(종료)" + format="####-######" /> - {/* */} ); diff --git a/src/views/form/Modal/CmmModal.jsx b/src/views/form/Modal/CmmModal.jsx index aaa003a..c52dde0 100644 --- a/src/views/form/Modal/CmmModal.jsx +++ b/src/views/form/Modal/CmmModal.jsx @@ -5,7 +5,11 @@ import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import Modal from '@mui/material/Modal'; -import { Divider, Grid } from '@mui/material'; +import { Divider, Grid, IconButton } from '@mui/material'; +import CloseIcon from '@mui/icons-material/Close'; +import MainCard from 'ui-component/cards/MainCard'; +import { styled } from '@mui/material/styles'; +import { useRef } from 'react'; const style = { position: 'absolute', @@ -19,7 +23,9 @@ const style = { p: 4 }; -export default function CmmModal({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) { +const CmmModal = ({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) => { + const rootRef = useRef(null); + const handleClose = () => { if (callback) callback(); setOpen(false); @@ -28,26 +34,23 @@ export default function CmmModal({ isBackdrop = false, open, setOpen, title, chi return (
{/* */} - - - - {title} - + + + + + } + > {children} - - - - +
); -} +}; CmmModal.propTypes = { isBackdrop: PropTypes.bool, @@ -57,3 +60,5 @@ CmmModal.propTypes = { setOpen: PropTypes.func, callback: PropTypes.func }; + +export default CmmModal; diff --git a/src/views/form/Modal/index.js b/src/views/form/Modal/index.js index 7fc9504..e4766c5 100644 --- a/src/views/form/Modal/index.js +++ b/src/views/form/Modal/index.js @@ -11,7 +11,7 @@ import CmmModal from './CmmModal'; const Modal = () => ( }> - {/* */} + {/* */} diff --git a/src/views/form/MuiGridPagination.jsx b/src/views/form/MuiDataGrid.jsx similarity index 96% rename from src/views/form/MuiGridPagination.jsx rename to src/views/form/MuiDataGrid.jsx index bfbd003..a45f040 100644 --- a/src/views/form/MuiGridPagination.jsx +++ b/src/views/form/MuiDataGrid.jsx @@ -8,7 +8,7 @@ import { useTheme } from '@mui/material/styles'; import dataGridKoKR from './defaultDataGridLocale'; // project imports -const MuiGridPagination = ({ +const MuiDataGrid = ({ isCheckbox = false, isHidePagination = false, columns, @@ -66,7 +66,7 @@ const MuiGridPagination = ({ ); }; -MuiGridPagination.propTypes = { +MuiDataGrid.propTypes = { isCheckbox: PropTypes.bool, isHidePagination: PropTypes.bool, columns: PropTypes.array, @@ -77,4 +77,4 @@ MuiGridPagination.propTypes = { handleSelection: PropTypes.func }; -export default MuiGridPagination; +export default MuiDataGrid; diff --git a/src/views/form/MuiDatePicker.jsx b/src/views/form/MuiDatePicker.jsx new file mode 100644 index 0000000..d292f4c --- /dev/null +++ b/src/views/form/MuiDatePicker.jsx @@ -0,0 +1,65 @@ +// import React from 'react'; + +import format from 'date-fns/format'; +import koLocale from 'date-fns/locale/ko'; + +import TextField from '@mui/material/TextField'; +import DateAdapter from '@mui/lab/AdapterDateFns'; +// import DateAdapter from '@mui/lab/AdapterDayjs'; +// import DateAdapter from '@mui/lab/AdapterLuxon'; +// import DateAdapter from '@mui/lab/AdapterMoment'; +import LocalizationProvider from '@mui/lab/LocalizationProvider'; +import { DatePicker, TimePicker, DateTimePicker } from '@mui/lab'; +import NumberFormat from 'react-number-format'; + +const MuiDateTimePicker = ({ label, date, setDate }) => ( + // + } + label={label} + value={date} + inputFormat="yyyy-MM-dd HH:mm:ss" + mask="____-__-__ __:__:__" + onChange={(newValue) => { + setDate(newValue); + }} + /> + // +); + +const MuiDatePicker = ({ label, date, setDate }) => ( + + } + label={label} + value={date} + inputFormat="yyyy-MM-dd" + mask="____-__-__" + onChange={(newValue) => { + setDate(newValue); + }} + /> + +); + +const MuiTimePicker = ({ label, date, setDate }) => ( + + } + // renderInput={(props) => } + label={label} + value={date} + inputFormat="HH" + mask="__" + onChange={(newValue) => { + setDate(newValue); + }} + /> + +); + +export { MuiDateTimePicker, MuiDatePicker, MuiTimePicker };