diff --git a/package-lock.json b/package-lock.json index 675b769..7d15bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,6 +76,7 @@ "react-quill": "^2.0.0-beta.4", "react-redux": "^7.2.6", "react-resizable": "^3.0.4", + "react-responsive": "^9.0.2", "react-router-dom": "^6.2.1", "react-scripts": "^4.0.3", "react-slick": "^0.28.1", @@ -8116,6 +8117,11 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/css-mediaquery": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz", + "integrity": "sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==" + }, "node_modules/css-prefers-color-scheme": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz", @@ -16327,6 +16333,14 @@ "remove-accents": "0.4.2" } }, + "node_modules/matchmediaquery": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/matchmediaquery/-/matchmediaquery-0.3.1.tgz", + "integrity": "sha512-Hlk20WQHRIm9EE9luN1kjRjYXAQToHOIAHPJn9buxBwuhfTHoKUcX+lXBbxc85DVQfXYbEQ4HcwQdd128E3qHQ==", + "dependencies": { + "css-mediaquery": "^0.1.2" + } + }, "node_modules/material-ui-popup-state": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/material-ui-popup-state/-/material-ui-popup-state-2.0.1.tgz", @@ -21248,6 +21262,23 @@ "react": ">= 16.3" } }, + "node_modules/react-responsive": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-9.0.2.tgz", + "integrity": "sha512-+4CCab7z8G8glgJoRjAwocsgsv6VA2w7JPxFWHRc7kvz8mec1/K5LutNC2MG28Mn8mu6+bu04XZxHv5gyfT7xQ==", + "dependencies": { + "hyphenate-style-name": "^1.0.0", + "matchmediaquery": "^0.3.0", + "prop-types": "^15.6.1", + "shallow-equal": "^1.2.1" + }, + "engines": { + "node": ">=0.10" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/react-router": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.8.1.tgz", @@ -23071,6 +23102,11 @@ "sha.js": "bin.js" } }, + "node_modules/shallow-equal": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.1.tgz", + "integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -34029,6 +34065,11 @@ } } }, + "css-mediaquery": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz", + "integrity": "sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==" + }, "css-prefers-color-scheme": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz", @@ -40369,6 +40410,14 @@ "remove-accents": "0.4.2" } }, + "matchmediaquery": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/matchmediaquery/-/matchmediaquery-0.3.1.tgz", + "integrity": "sha512-Hlk20WQHRIm9EE9luN1kjRjYXAQToHOIAHPJn9buxBwuhfTHoKUcX+lXBbxc85DVQfXYbEQ4HcwQdd128E3qHQ==", + "requires": { + "css-mediaquery": "^0.1.2" + } + }, "material-ui-popup-state": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/material-ui-popup-state/-/material-ui-popup-state-2.0.1.tgz", @@ -44099,6 +44148,17 @@ "react-draggable": "^4.0.3" } }, + "react-responsive": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-9.0.2.tgz", + "integrity": "sha512-+4CCab7z8G8glgJoRjAwocsgsv6VA2w7JPxFWHRc7kvz8mec1/K5LutNC2MG28Mn8mu6+bu04XZxHv5gyfT7xQ==", + "requires": { + "hyphenate-style-name": "^1.0.0", + "matchmediaquery": "^0.3.0", + "prop-types": "^15.6.1", + "shallow-equal": "^1.2.1" + } + }, "react-router": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.8.1.tgz", @@ -45497,6 +45557,11 @@ "safe-buffer": "^5.0.1" } }, + "shallow-equal": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.1.tgz", + "integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==" + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index c0cde6b..be770a9 100755 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "react-quill": "^2.0.0-beta.4", "react-redux": "^7.2.6", "react-resizable": "^3.0.4", + "react-responsive": "^9.0.2", "react-router-dom": "^6.2.1", "react-scripts": "^4.0.3", "react-slick": "^0.28.1", diff --git a/src/apis/judge.js b/src/apis/judge.js index 6ef3151..abb0839 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -32,8 +32,8 @@ import _ from 'lodash'; // 23.04.06 sjh 통신 오래걸리는 작업이 있을 경우 적용 const configCustom = { timeout: 300000 }; -export async function findDashboard() { - const res = await axios.get(GET_DASHBOARD); +export async function findDashboard(params) { + const res = await axios.get(GET_DASHBOARD, { params }); if (res.success) { // res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); return res; diff --git a/src/commons/XitCmm.js b/src/commons/XitCmm.js index a0c8688..e22a828 100644 --- a/src/commons/XitCmm.js +++ b/src/commons/XitCmm.js @@ -173,6 +173,10 @@ export const removeAlert = (confirmProcess, dismissProcess) => { confirmAlert('삭제 하시겠습니까?', confirmProcess, dismissProcess); }; +export const updateAlert = (confirmProcess, dismissProcess) => { + confirmAlert('변경 하시겠습니까?', confirmProcess, dismissProcess); +}; + export const Toast = swal.mixin({ toast: true, backdrop: true, diff --git a/src/views/biz/admin/judge/JudgeDateModifyForm.jsx b/src/views/biz/admin/judge/JudgeDateModifyForm.jsx index 8c6ebfa..9f77260 100644 --- a/src/views/biz/admin/judge/JudgeDateModifyForm.jsx +++ b/src/views/biz/admin/judge/JudgeDateModifyForm.jsx @@ -49,6 +49,9 @@ const JudgeDateModifyForm = ({ dateDatas, setDateModify, handleModalSave }) => { alert.show('심사 마감일자는 필수입니다.'); return; } + if (msStartsi.length === 1) { + setMsStartsi(`0${msStartsi}`); + } if (msStartsi.length < 2) { alert.show('심사 시작시간은 필수입니다.'); return; diff --git a/src/views/biz/judge/ProcessJudge.jsx b/src/views/biz/judge/ProcessJudge.jsx index fce81df..769ef9f 100644 --- a/src/views/biz/judge/ProcessJudge.jsx +++ b/src/views/biz/judge/ProcessJudge.jsx @@ -6,6 +6,8 @@ import { findJudgeImages, saveJudgeResult } from 'apis/judge'; import { SkipNext, SkipPrevious, Save } from '@mui/icons-material'; import ImgItem from '../../cmm/ImgItem'; import NumberFormat from 'react-number-format'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { useMediaQuery } from 'react-responsive'; const ProcessJudge = (props) => { const { rowDatas, setOpen, showAlert } = props; @@ -19,6 +21,13 @@ const ProcessJudge = (props) => { const [selectedResult, setSelectedResult] = useState(); const [selectedImg, setSelectedImg] = useState({}); + const isDesktopOrLaptop = useMediaQuery({ + query: '(min-width: 1224px)' + }); + const isTabletOrMobile = useMediaQuery({ query: '(max-width: 1224px)' }); + const size2 = (isDesktopOrLaptop && 2) || (isTabletOrMobile && 12); + const size6 = (isDesktopOrLaptop && 6) || (isTabletOrMobile && 12); + const getImgList = (row) => { findJudgeImages(row).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; @@ -94,7 +103,7 @@ const ProcessJudge = (props) => { return ( <> - + {frecadImgs ?.filter((img) => img.imgName !== '') @@ -117,7 +126,7 @@ const ProcessJudge = (props) => { ))} - + {selectedImg && ( @@ -134,10 +143,10 @@ const ProcessJudge = (props) => { - + - + { value={rowDatas[pageRef.current]?.msWdate || ''} /> - + - + 심의결정 diff --git a/src/views/biz/judge/ProcessParkingJudge.jsx b/src/views/biz/judge/ProcessParkingJudge.jsx index 83ed34c..31efc67 100644 --- a/src/views/biz/judge/ProcessParkingJudge.jsx +++ b/src/views/biz/judge/ProcessParkingJudge.jsx @@ -6,6 +6,8 @@ import { findParkingImages, saveParkingJudgeResult } from 'apis/judge'; import { SkipNext, SkipPrevious, Save } from '@mui/icons-material'; import ImgItem from '../../cmm/ImgItem'; import NumberFormat from 'react-number-format'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { useMediaQuery } from 'react-responsive'; const ProcessParkingJudge = (props) => { const { rowDatas, setOpen, showAlert } = props; @@ -19,6 +21,13 @@ const ProcessParkingJudge = (props) => { const [selectedResult, setSelectedResult] = useState(); const [selectedImg, setSelectedImg] = useState({}); + const isDesktopOrLaptop = useMediaQuery({ + query: '(min-width: 1224px)' + }); + const isTabletOrMobile = useMediaQuery({ query: '(max-width: 1224px)' }); + const size2 = (isDesktopOrLaptop && 2) || (isTabletOrMobile && 12); + const size6 = (isDesktopOrLaptop && 6) || (isTabletOrMobile && 12); + const getImgList = (row) => { findParkingImages(row?.rcMaincode).then((res) => { const { arrFrecadImg, arrContadImg, arrPicadImg } = res; @@ -94,7 +103,7 @@ const ProcessParkingJudge = (props) => { return ( <> - + {frecadImgs ?.filter((img) => img.imgName !== '') @@ -117,7 +126,7 @@ const ProcessParkingJudge = (props) => { ))} - + {selectedImg && ( @@ -134,10 +143,10 @@ const ProcessParkingJudge = (props) => { - + - + { value={rowDatas[pageRef.current]?.msWdate || ''} /> - + - + 심의결정 diff --git a/src/views/biz/user/UserManagerForm.jsx b/src/views/biz/user/UserManagerForm.jsx index 1fe0ffd..68df881 100644 --- a/src/views/biz/user/UserManagerForm.jsx +++ b/src/views/biz/user/UserManagerForm.jsx @@ -7,9 +7,9 @@ import { Button, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextF import 'react-quill/dist/quill.snow.css'; // project imports -import { Delete, List, Save } from '@mui/icons-material'; +import { Delete, List, Save, Update } from '@mui/icons-material'; import PropTypes from 'prop-types'; -import { removeAlert, saveAlert } from '../../../commons/XitCmm'; +import { removeAlert, saveAlert, updateAlert } from '../../../commons/XitCmm'; import { useAlert } from 'react-alert'; const UserManagementForm = (props) => { @@ -72,10 +72,16 @@ const UserManagementForm = (props) => { isenable }; setOpen(false); - removeAlert( - () => handleModalSave('DELETE', saveParam), - () => setOpen(true) - ); + if (isenable === '1') + removeAlert( + () => handleModalSave('DELETE', saveParam), + () => setOpen(true) + ); + if (isenable === '0') + updateAlert( + () => handleModalSave('DELETE', saveParam), + () => setOpen(true) + ); }; return ( @@ -96,7 +102,7 @@ const UserManagementForm = (props) => { { } }} > - )} diff --git a/src/views/dashboard/index.js b/src/views/dashboard/index.js index 9323da5..47c97d3 100644 --- a/src/views/dashboard/index.js +++ b/src/views/dashboard/index.js @@ -12,10 +12,12 @@ import { IconFileText } from '@tabler/icons'; import { useTheme } from '@mui/material/styles'; import Box from '@mui/material/Box'; import { useAlert } from 'react-alert'; +import useAuth from 'hooks/useAuth'; // ==============================|| DEFAULT DASHBOARD ||============================== // const Dashboard = () => { + const { accesstype } = useAuth(); const theme = useTheme(); const showAlert = useAlert(); const [totalCount, setTotalCount] = useState(0); @@ -131,7 +133,7 @@ const Dashboard = () => { // size: rowsState.pageSize // }; - findDashboard().then((res) => { + findDashboard({ accesstype }).then((res) => { // console.log(res); if (res && res?.success) { const rows = res.data?.pBoardList.content.map((d, idx) => ({ ...d, rowId: idx + 1 }));