diff --git a/src/layout/MainLayout/Header/ProfileSection/index.js b/src/layout/MainLayout/Header/ProfileSection/index.js index 5fe6270..9e25061 100755 --- a/src/layout/MainLayout/Header/ProfileSection/index.js +++ b/src/layout/MainLayout/Header/ProfileSection/index.js @@ -1,5 +1,4 @@ import { useEffect, useRef, useState } from 'react'; -import { useNavigate } from 'react-router-dom'; // material-ui import { useTheme } from '@mui/material/styles'; @@ -35,7 +34,6 @@ import useConfig from 'hooks/useConfig'; const ProfileSection = () => { const theme = useTheme(); const { borderRadius } = useConfig(); - const navigate = useNavigate(); const [selectedIndex, setSelectedIndex] = useState(-1); const { logout, user } = useAuth(); diff --git a/src/layout/MainLayout/Sidebar/MenuList/index.js b/src/layout/MainLayout/Sidebar/MenuList/index.js index 101c2ea..d09573a 100755 --- a/src/layout/MainLayout/Sidebar/MenuList/index.js +++ b/src/layout/MainLayout/Sidebar/MenuList/index.js @@ -1,4 +1,4 @@ -import { memo, useState } from 'react'; +import { memo } from 'react'; // material-ui import { Box, Divider, Stack, Typography } from '@mui/material'; diff --git a/src/store/slices/pboard.js b/src/store/slices/pboard.js index bc357e1..fca4125 100644 --- a/src/store/slices/pboard.js +++ b/src/store/slices/pboard.js @@ -1,10 +1,6 @@ // third-party import { createSlice } from '@reduxjs/toolkit'; -// project imports -import axios from 'utils/axios'; -import { dispatch } from '../index'; - // ---------------------------------------------------------------------- const initialState = { @@ -19,26 +15,6 @@ const slice = createSlice({ hasError(state, action) { state.error = action.payload; } - - // // GET CUSTOMERS - // getCustomersSuccess(state, action) { - // state.customers = action.payload; - // }, - // - // // GET ORDERS - // getOrdersSuccess(state, action) { - // state.orders = action.payload; - // }, - // - // // GET PRODUCTS - // getProductsSuccess(state, action) { - // state.products = action.payload; - // }, - // - // // GET PRODUCT REVIEWS - // getProductReviewsSuccess(state, action) { - // state.productreviews = action.payload; - // } } }); @@ -46,47 +22,3 @@ const slice = createSlice({ export default slice.reducer; // ---------------------------------------------------------------------- - -// export function getCustomers() { -// return async () => { -// try { -// const response = await axios.get('/api/customer/list'); -// dispatch(slice.actions.getCustomersSuccess(response.data.customers)); -// } catch (error) { -// dispatch(slice.actions.hasError(error)); -// } -// }; -// } -// -// export function getOrders() { -// return async () => { -// try { -// const response = await axios.get('/api/customer/order/list'); -// dispatch(slice.actions.getOrdersSuccess(response.data.orders)); -// } catch (error) { -// dispatch(slice.actions.hasError(error)); -// } -// }; -// } -// -// export function getProducts() { -// return async () => { -// try { -// const response = await axios.get('/api/customer/product/list'); -// dispatch(slice.actions.getProductsSuccess(response.data.products)); -// } catch (error) { -// dispatch(slice.actions.hasError(error)); -// } -// }; -// } -// -// export function getProductReviews() { -// return async () => { -// try { -// const response = await axios.get('/api/customer/product/reviews'); -// dispatch(slice.actions.getProductReviewsSuccess(response.data.productreviews)); -// } catch (error) { -// dispatch(slice.actions.hasError(error)); -// } -// }; -// } diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx index a34b54b..5711a4e 100644 --- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx @@ -3,20 +3,17 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; import NumberFormat from 'react-number-format'; -import { useAlert } from 'react-alert'; import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } from '@mui/material'; import Button from '@mui/material/Button'; import { Delete, List } from '@mui/icons-material'; -import { judgeFileDownload, judgeImgDownload } from 'apis/judge'; -import ImageFileViewForm from '../../../cmm/file-ctl/ImageFileViewForm'; -import CmmImgViewModal from '../../../cmm/CmmImgViewModal'; -import { removeAlert } from '../../../../commons/XitCmm'; +import { judgeImgDownload } from 'apis/judge'; +import ImageFileViewForm from 'views/cmm/file-ctl/ImageFileViewForm'; +import CmmImgViewModal from 'views/cmm/CmmImgViewModal'; +import { removeAlert } from 'commons/XitCmm'; const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify, setDetail }) => { - const showAlert = useAlert(); - const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc); const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb); const [childOpen, setChildOpen] = useState(false); @@ -253,6 +250,7 @@ ModifyJudgeDataForm.propTypes = { ingbs: PropTypes.array.isRequired, handleModalSave: PropTypes.func.isRequired, setOpen: PropTypes.func.isRequired, - onModify: PropTypes.func.isRequired + onModify: PropTypes.func.isRequired, + setDetail: PropTypes.func }; export default ModifyJudgeDataForm; diff --git a/src/views/biz/admin/judge/JudgeDataModifyForm.jsx b/src/views/biz/admin/judge/JudgeDataModifyForm.jsx index 406bf75..364017e 100644 --- a/src/views/biz/admin/judge/JudgeDataModifyForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataModifyForm.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import _ from 'lodash'; import PropTypes from 'prop-types'; @@ -10,8 +10,8 @@ import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms'; -import DaumPost from '../../../cmm/DaumPost'; -import { removeAlert, saveAlert } from '../../../../commons/XitCmm'; +import DaumPost from 'views/cmm/DaumPost'; +import { saveAlert } from 'commons/XitCmm'; const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, setModify }) => { const alert = useAlert(); @@ -206,17 +206,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav return isDisabled; }; - useEffect(() => { - // eslint-disable-next-line no-plusplus - for (let idx = 1; idx < 5; idx++) { - if (rowData[`scPicad${idx}`]) { - // URL.createObjectURL(rowData[`scPicad${idx}`]); - console.log(rowData[`scPicad${idx}`]); - // const file = new File(); - } - } - }, []); - return ( <> @@ -448,6 +437,7 @@ JudgeDataModifyForm.propTypes = { contDocs: PropTypes.array.isRequired, ingbs: PropTypes.array.isRequired, handleModalSave: PropTypes.func.isRequired, - setOpen: PropTypes.func.isRequired + setOpen: PropTypes.func.isRequired, + setModify: PropTypes.func }; export default JudgeDataModifyForm; diff --git a/src/views/biz/admin/judge/JudgeDataNewForm.jsx b/src/views/biz/admin/judge/JudgeDataNewForm.jsx index 263c6b3..3c88426 100644 --- a/src/views/biz/admin/judge/JudgeDataNewForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataNewForm.jsx @@ -11,8 +11,8 @@ import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms'; -import DaumPost from '../../../cmm/DaumPost'; -import { saveAlert, Toast } from '../../../../commons/XitCmm'; +import DaumPost from 'views/cmm/DaumPost'; +import { saveAlert } from 'commons/XitCmm'; const toDate = new Date(); diff --git a/src/views/biz/admin/judge/JudgeModal.jsx b/src/views/biz/admin/judge/JudgeModal.jsx index ee29056..8014c8b 100644 --- a/src/views/biz/admin/judge/JudgeModal.jsx +++ b/src/views/biz/admin/judge/JudgeModal.jsx @@ -8,8 +8,7 @@ import { IconSearch } from '@tabler/icons'; import Button from '@mui/material/Button'; import combo from 'commons/combo_data'; import { useState } from 'react'; -import { saveJudgeStds, saveJudgeTargets } from '../../../../apis/judge'; -import { confirmAlert, saveAlert } from '../../../../commons/XitCmm'; +import { saveJudgeStds } from 'apis/judge'; const style = { position: 'relative', diff --git a/src/views/biz/admin/judge/JudgeRegistReview.jsx b/src/views/biz/admin/judge/JudgeRegistReview.jsx index 029542b..134909c 100644 --- a/src/views/biz/admin/judge/JudgeRegistReview.jsx +++ b/src/views/biz/admin/judge/JudgeRegistReview.jsx @@ -13,17 +13,15 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; -import xitCmm, { ErrorToast, saveAlert, Toast } from 'commons/XitCmm'; +import xitCmm, { ErrorToast, saveAlert } from 'commons/XitCmm'; import CmmModal from 'views/cmm/CmmModal'; import JudgeTargetSaveForm from 'views/biz/admin/judge/JudgeTargetSaveForm'; import NumberFormat from 'react-number-format'; import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; import PropTypes from 'prop-types'; -import { useAlert } from 'react-alert'; const JudgeRegistReview = ({ scDatagb, menuName }) => { - const showAlert = useAlert(); const [scTransfer, setScTransfer] = useState('1'); const [scSeq1, setScSeq1] = useState(2022000001); const [scSeq2, setScSeq2] = useState(2022000899); diff --git a/src/views/biz/admin/judge/JudgeReview.jsx b/src/views/biz/admin/judge/JudgeReview.jsx index 03d95b8..845d38c 100644 --- a/src/views/biz/admin/judge/JudgeReview.jsx +++ b/src/views/biz/admin/judge/JudgeReview.jsx @@ -74,7 +74,7 @@ const JudgeReview = ({ msDatagb, menuName }) => { } }, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]); - const removeJudge = useCallback( + const deleteJudge = useCallback( (row) => () => { let res = {}; @@ -95,26 +95,6 @@ const JudgeReview = ({ msDatagb, menuName }) => { showAlert.show(res.message); } }); - - // if (window.confirm('삭제 하시겠습니까?')) { - // if (msDatagb) { - // res = await removeJudge(row); - // } else { - // res = await removeParkingJudge(row); - // } - // console.log(res); - // if (res && res.success) { - // setRowsState({ - // ...rowsState, - // page: 0 - // }); - // search(); - // } else { - // showAlert.show(res.message); - // } - // } else { - // window.close(); - // } }, [] ); @@ -158,7 +138,7 @@ const JudgeReview = ({ msDatagb, menuName }) => { field: 'actions', type: 'actions', width: 80, - getActions: (params) => [} label="Delete" onClick={removeJudge(params.row)} />], + getActions: (params) => [} label="Delete" onClick={deleteJudge(params.row)} />], align: 'center' } ]; diff --git a/src/views/biz/admin/parking/ParkingRegister.jsx b/src/views/biz/admin/parking/ParkingRegister.jsx index 29685de..3e7b135 100644 --- a/src/views/biz/admin/parking/ParkingRegister.jsx +++ b/src/views/biz/admin/parking/ParkingRegister.jsx @@ -19,7 +19,6 @@ import SaveParkingTargetForm from './SaveParkingTargetForm'; import NumberFormat from 'react-number-format'; import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking'; -import { useAlert } from 'react-alert'; const ParkingRegister = () => { const [rcIrTransfer, setRcIrTransfer] = useState('1'); @@ -33,7 +32,6 @@ const ParkingRegister = () => { rows: [] }); const [open, setOpen] = useState(false); - const showAlert = useAlert(); const columns = [ { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 80 }, diff --git a/src/views/biz/user/UserManager.jsx b/src/views/biz/user/UserManager.jsx index d9345ef..e0b473a 100644 --- a/src/views/biz/user/UserManager.jsx +++ b/src/views/biz/user/UserManager.jsx @@ -15,8 +15,7 @@ import CmmModalB from '../../cmm/CmmModalB'; import UserManagerForm from './UserManagerForm'; import { findUsers, removeUser, saveUser } from 'apis/user'; import { getComboCodeList } from 'apis/common'; -import { useAlert } from 'react-alert'; -import { Toast } from '../../../commons/XitCmm'; +import { Toast } from 'commons/XitCmm'; const UserManager = () => { const [accesstypes, setAccesstypes] = useState(); diff --git a/src/views/biz/user/UserManagerForm.jsx b/src/views/biz/user/UserManagerForm.jsx index 9e36b8f..3a35aa7 100644 --- a/src/views/biz/user/UserManagerForm.jsx +++ b/src/views/biz/user/UserManagerForm.jsx @@ -10,8 +10,11 @@ import 'react-quill/dist/quill.snow.css'; import { Delete, List, Save } from '@mui/icons-material'; import PropTypes from 'prop-types'; import { removeAlert, saveAlert } from '../../../commons/XitCmm'; +import { useAlert } from 'react-alert'; const UserManagementForm = (props) => { + const showAlert = useAlert(); + // eslint-disable-next-line react/prop-types const { create, setOpen, handleModalSave, teams = [], accesstypes = [], rowData = {} } = props; const [userid, setUserid] = useState(rowData?.userid || ''); @@ -39,11 +42,15 @@ const UserManagementForm = (props) => { newYn: create ? 'Y' : 'N' }; if (userid.length < 1) { - alert('사용자 ID는 필수입니다.'); + showAlert.show('사용자 ID는 필수입니다.'); return; } if (passwd.length < 1) { - alert('비밀번호는 필수입니다.'); + showAlert.show('비밀번호는 필수입니다.'); + return; + } + if (name.length < 1) { + showAlert.show('이름은 필수입니다.'); return; } setOpen(false);