fix: alert -> sweetalert2 로 변경 적용

main
minuk926 2 years ago
parent 5211512632
commit 876385577e

@ -1,5 +1,4 @@
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
// material-ui // material-ui
import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/material/styles';
@ -35,7 +34,6 @@ import useConfig from 'hooks/useConfig';
const ProfileSection = () => { const ProfileSection = () => {
const theme = useTheme(); const theme = useTheme();
const { borderRadius } = useConfig(); const { borderRadius } = useConfig();
const navigate = useNavigate();
const [selectedIndex, setSelectedIndex] = useState(-1); const [selectedIndex, setSelectedIndex] = useState(-1);
const { logout, user } = useAuth(); const { logout, user } = useAuth();

@ -1,4 +1,4 @@
import { memo, useState } from 'react'; import { memo } from 'react';
// material-ui // material-ui
import { Box, Divider, Stack, Typography } from '@mui/material'; import { Box, Divider, Stack, Typography } from '@mui/material';

@ -1,10 +1,6 @@
// third-party // third-party
import { createSlice } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit';
// project imports
import axios from 'utils/axios';
import { dispatch } from '../index';
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
const initialState = { const initialState = {
@ -19,26 +15,6 @@ const slice = createSlice({
hasError(state, action) { hasError(state, action) {
state.error = action.payload; 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 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));
// }
// };
// }

@ -3,20 +3,17 @@ import _ from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import { useAlert } from 'react-alert';
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } from '@mui/material'; import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } from '@mui/material';
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import { Delete, List } from '@mui/icons-material'; import { Delete, List } from '@mui/icons-material';
import { judgeFileDownload, judgeImgDownload } from 'apis/judge'; import { judgeImgDownload } from 'apis/judge';
import ImageFileViewForm from '../../../cmm/file-ctl/ImageFileViewForm'; import ImageFileViewForm from 'views/cmm/file-ctl/ImageFileViewForm';
import CmmImgViewModal from '../../../cmm/CmmImgViewModal'; import CmmImgViewModal from 'views/cmm/CmmImgViewModal';
import { removeAlert } from '../../../../commons/XitCmm'; import { removeAlert } from 'commons/XitCmm';
const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify, setDetail }) => { const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify, setDetail }) => {
const showAlert = useAlert();
const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc); const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc);
const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb); const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb);
const [childOpen, setChildOpen] = useState(false); const [childOpen, setChildOpen] = useState(false);
@ -253,6 +250,7 @@ ModifyJudgeDataForm.propTypes = {
ingbs: PropTypes.array.isRequired, ingbs: PropTypes.array.isRequired,
handleModalSave: PropTypes.func.isRequired, handleModalSave: PropTypes.func.isRequired,
setOpen: PropTypes.func.isRequired, setOpen: PropTypes.func.isRequired,
onModify: PropTypes.func.isRequired onModify: PropTypes.func.isRequired,
setDetail: PropTypes.func
}; };
export default ModifyJudgeDataForm; export default ModifyJudgeDataForm;

@ -1,4 +1,4 @@
import { useEffect, useState } from 'react'; import { useState } from 'react';
import _ from 'lodash'; import _ from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
@ -10,8 +10,8 @@ import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms';
import DaumPost from '../../../cmm/DaumPost'; import DaumPost from 'views/cmm/DaumPost';
import { removeAlert, saveAlert } from '../../../../commons/XitCmm'; import { saveAlert } from 'commons/XitCmm';
const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, setModify }) => { const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, setModify }) => {
const alert = useAlert(); const alert = useAlert();
@ -206,17 +206,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
return isDisabled; 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 ( return (
<> <>
<Grid mt={2}> <Grid mt={2}>
@ -448,6 +437,7 @@ JudgeDataModifyForm.propTypes = {
contDocs: PropTypes.array.isRequired, contDocs: PropTypes.array.isRequired,
ingbs: PropTypes.array.isRequired, ingbs: PropTypes.array.isRequired,
handleModalSave: PropTypes.func.isRequired, handleModalSave: PropTypes.func.isRequired,
setOpen: PropTypes.func.isRequired setOpen: PropTypes.func.isRequired,
setModify: PropTypes.func
}; };
export default JudgeDataModifyForm; export default JudgeDataModifyForm;

@ -11,8 +11,8 @@ import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons'; import { IconSearch } from '@tabler/icons';
import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms'; import ImageFileInputForms from 'views/cmm/file-ctl/ImageFileInputForms';
import DaumPost from '../../../cmm/DaumPost'; import DaumPost from 'views/cmm/DaumPost';
import { saveAlert, Toast } from '../../../../commons/XitCmm'; import { saveAlert } from 'commons/XitCmm';
const toDate = new Date(); const toDate = new Date();

@ -8,8 +8,7 @@ import { IconSearch } from '@tabler/icons';
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import combo from 'commons/combo_data'; import combo from 'commons/combo_data';
import { useState } from 'react'; import { useState } from 'react';
import { saveJudgeStds, saveJudgeTargets } from '../../../../apis/judge'; import { saveJudgeStds } from 'apis/judge';
import { confirmAlert, saveAlert } from '../../../../commons/XitCmm';
const style = { const style = {
position: 'relative', position: 'relative',

@ -13,17 +13,15 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports // project imports
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; 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 CmmModal from 'views/cmm/CmmModal';
import JudgeTargetSaveForm from 'views/biz/admin/judge/JudgeTargetSaveForm'; import JudgeTargetSaveForm from 'views/biz/admin/judge/JudgeTargetSaveForm';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload';
import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; import { findJudgeTargets, saveJudgeTargets } from 'apis/judge';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { useAlert } from 'react-alert';
const JudgeRegistReview = ({ scDatagb, menuName }) => { const JudgeRegistReview = ({ scDatagb, menuName }) => {
const showAlert = useAlert();
const [scTransfer, setScTransfer] = useState('1'); const [scTransfer, setScTransfer] = useState('1');
const [scSeq1, setScSeq1] = useState(2022000001); const [scSeq1, setScSeq1] = useState(2022000001);
const [scSeq2, setScSeq2] = useState(2022000899); const [scSeq2, setScSeq2] = useState(2022000899);

@ -74,7 +74,7 @@ const JudgeReview = ({ msDatagb, menuName }) => {
} }
}, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]); }, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]);
const removeJudge = useCallback( const deleteJudge = useCallback(
(row) => () => { (row) => () => {
let res = {}; let res = {};
@ -95,26 +95,6 @@ const JudgeReview = ({ msDatagb, menuName }) => {
showAlert.show(res.message); 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', field: 'actions',
type: 'actions', type: 'actions',
width: 80, width: 80,
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeJudge(params.row)} />], getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={deleteJudge(params.row)} />],
align: 'center' align: 'center'
} }
]; ];

@ -19,7 +19,6 @@ import SaveParkingTargetForm from './SaveParkingTargetForm';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload';
import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking'; import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking';
import { useAlert } from 'react-alert';
const ParkingRegister = () => { const ParkingRegister = () => {
const [rcIrTransfer, setRcIrTransfer] = useState('1'); const [rcIrTransfer, setRcIrTransfer] = useState('1');
@ -33,7 +32,6 @@ const ParkingRegister = () => {
rows: [] rows: []
}); });
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const showAlert = useAlert();
const columns = [ const columns = [
{ headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 80 }, { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 80 },

@ -15,8 +15,7 @@ import CmmModalB from '../../cmm/CmmModalB';
import UserManagerForm from './UserManagerForm'; import UserManagerForm from './UserManagerForm';
import { findUsers, removeUser, saveUser } from 'apis/user'; import { findUsers, removeUser, saveUser } from 'apis/user';
import { getComboCodeList } from 'apis/common'; import { getComboCodeList } from 'apis/common';
import { useAlert } from 'react-alert'; import { Toast } from 'commons/XitCmm';
import { Toast } from '../../../commons/XitCmm';
const UserManager = () => { const UserManager = () => {
const [accesstypes, setAccesstypes] = useState(); const [accesstypes, setAccesstypes] = useState();

@ -10,8 +10,11 @@ import 'react-quill/dist/quill.snow.css';
import { Delete, List, Save } from '@mui/icons-material'; import { Delete, List, Save } from '@mui/icons-material';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { removeAlert, saveAlert } from '../../../commons/XitCmm'; import { removeAlert, saveAlert } from '../../../commons/XitCmm';
import { useAlert } from 'react-alert';
const UserManagementForm = (props) => { const UserManagementForm = (props) => {
const showAlert = useAlert();
// eslint-disable-next-line react/prop-types // eslint-disable-next-line react/prop-types
const { create, setOpen, handleModalSave, teams = [], accesstypes = [], rowData = {} } = props; const { create, setOpen, handleModalSave, teams = [], accesstypes = [], rowData = {} } = props;
const [userid, setUserid] = useState(rowData?.userid || ''); const [userid, setUserid] = useState(rowData?.userid || '');
@ -39,11 +42,15 @@ const UserManagementForm = (props) => {
newYn: create ? 'Y' : 'N' newYn: create ? 'Y' : 'N'
}; };
if (userid.length < 1) { if (userid.length < 1) {
alert('사용자 ID는 필수입니다.'); showAlert.show('사용자 ID는 필수입니다.');
return; return;
} }
if (passwd.length < 1) { if (passwd.length < 1) {
alert('비밀번호는 필수입니다.'); showAlert.show('비밀번호는 필수입니다.');
return;
}
if (name.length < 1) {
showAlert.show('이름은 필수입니다.');
return; return;
} }
setOpen(false); setOpen(false);

Loading…
Cancel
Save