diff --git a/package.json b/package.json index 91c9c22..649685b 100755 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "react-beautiful-dnd": "^13.1.0", "react-copy-to-clipboard": "^5.0.4", "react-currency-format": "^1.1.0", + "react-daum-postcode": "^3.0.1", "react-dom": "^17.0.2", "react-draft-wysiwyg": "^1.14.7", "react-draggable": "^4.4.4", diff --git a/src/views/biz/board/Board.jsx b/src/views/biz/board/Board.jsx index 8fd1b8f..4e8e17e 100644 --- a/src/views/biz/board/Board.jsx +++ b/src/views/biz/board/Board.jsx @@ -10,7 +10,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import { findBoards, modifyBoardHitCount, removeBoard, saveBoard } from 'apis/board'; import { useAlert } from 'react-alert'; import CmmModal from 'views/cmm/CmmModal'; diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index 9f360a3..afb00d6 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -10,7 +10,7 @@ import { IconFileText } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import CmmModal from 'views/cmm/CmmModal'; import PublicBoardForm from './PublicBoardForm'; import { removePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public'; diff --git a/src/views/biz/board/PublicBoardForm.jsx b/src/views/biz/board/PublicBoardForm.jsx index 4a0e8ab..a05f00c 100644 --- a/src/views/biz/board/PublicBoardForm.jsx +++ b/src/views/biz/board/PublicBoardForm.jsx @@ -15,7 +15,7 @@ import InputLabel from 'ui-component/extended/Form/InputLabel'; import { Delete, List, Save } from '@mui/icons-material'; import { fileDownload } from 'apis/common'; -import FileForm from 'views/cmm/FileForm'; +import FileForm from 'views/cmm/file-ctl/FileForm'; const PublicBoardForm = (props) => { // eslint-disable-next-line react/prop-types diff --git a/src/views/biz/judge/JudgeDataDetailForm.jsx b/src/views/biz/judge/JudgeDataDetailForm.jsx index 6cd9dc0..4b04bc0 100644 --- a/src/views/biz/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/judge/JudgeDataDetailForm.jsx @@ -4,13 +4,12 @@ import PropTypes from 'prop-types'; import NumberFormat from 'react-number-format'; import { useAlert } from 'react-alert'; -import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment, Divider } from '@mui/material'; +import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } from '@mui/material'; import Button from '@mui/material/Button'; -import { IconSearch } from '@tabler/icons'; import { Delete, List } from '@mui/icons-material'; import { judgeFileDownload } from 'apis/judge'; -import ImageFileTextForm from '../../cmm/ImageFileTextForm'; +import ImageFileTextForm from '../../cmm/file-ctl/ImageFileTextForm'; const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => { const showAlert = useAlert(); @@ -39,11 +38,22 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav return ( <> - + + + + + + + + + + + + @@ -71,20 +81,6 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - - - - - @@ -100,7 +96,21 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav + + + + + - + - - - - - - - - - + - - - - ) - }} - /> + diff --git a/src/views/biz/judge/JudgeDataModifyForm.jsx b/src/views/biz/judge/JudgeDataModifyForm.jsx index d30845a..5583656 100644 --- a/src/views/biz/judge/JudgeDataModifyForm.jsx +++ b/src/views/biz/judge/JudgeDataModifyForm.jsx @@ -8,12 +8,14 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; -import FileInputForms from 'views/cmm/FileInputForms'; +import FileInputForms from 'views/cmm/file-ctl/FileInputForms'; +import DaumPost from '../../cmm/DaumPost'; // const toDate = new Date(); const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => { const alert = useAlert(); + const [isPostOpen, setIsPostOpen] = useState(false); const [scCarnum, setScCarnum] = useState(rowData.scCarnum); const [scName, setScName] = useState(rowData.scName); @@ -59,8 +61,8 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav Object.values(contads).forEach((v) => { formData.append('contadFiles', v); }); - - handleModalSave(formData); + console.log(picads, frecads, contads); + // handleModalSave(formData); }; const handleChangeFile = (e) => { @@ -88,10 +90,37 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav } }; + const onCancel = () => { + setOpen(false); + }; + + const openPostCode = (e) => { + e.preventDefault(); + setIsPostOpen(true); + }; + + const handlePostAddr = (data) => { + if (data) { + setZipcode1(data.zipCode); + setScJuso(data.addr); + setScBunji(data.dtlAddr); + } + setIsPostOpen(false); + }; + return ( <> + + + + + + + + + + + setScName(e?.target?.value)} /> @@ -127,20 +158,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - - - - setScCdate(e?.target?.value)} - /> - 접수방법 @@ -154,7 +171,21 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav + + + setScCdate(e?.target?.value)} + /> + + setScWdate(e?.target?.value)} /> - + setScJbtime(e?.target?.value)} /> - - setScPos(e?.target?.value)} /> - - - - - - @@ -206,6 +229,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav label="우편번호" value={zipcode1 ?? ''} onChange={(e) => setZipcode1(e?.target?.value)} + onClick={openPostCode} InputProps={{ display: 'none', readOnly: true, @@ -438,13 +462,18 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav + + + - {/* + ); }; diff --git a/src/views/biz/judge/JudgeDataNewForm.jsx b/src/views/biz/judge/JudgeDataNewForm.jsx index 617d1a6..ef5fd63 100644 --- a/src/views/biz/judge/JudgeDataNewForm.jsx +++ b/src/views/biz/judge/JudgeDataNewForm.jsx @@ -9,7 +9,8 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; -import FileInputForms from 'views/cmm/FileInputForms'; +import FileInputForms from 'views/cmm/file-ctl/FileInputForms'; +import DaumPost from '../../cmm/DaumPost'; const toDate = new Date(); @@ -33,6 +34,8 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { const [frecads, setFrecads] = useState({}); const [contads, setContads] = useState({}); + const [isPostOpen, setIsPostOpen] = useState(false); + const onSave = () => { // TODO : validation check 추가 const formData = new FormData(); @@ -61,7 +64,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { Object.values(contads).forEach((v) => { formData.append('contadFiles', v); }); - + console.log(picads, frecads, contads); handleModalSave('SAVE', formData); }; @@ -90,6 +93,20 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { } }; + const openPostCode = (e) => { + e.preventDefault(); + setIsPostOpen(true); + }; + + const handlePostAddr = (data) => { + if (data) { + setZipcode1(data.zipCode); + setScJuso(data.addr); + setScBunji(data.dtlAddr); + } + setIsPostOpen(false); + }; + return ( <> @@ -111,6 +128,20 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { setScDong(e?.target?.value)} /> + + setScCdate(e?.target?.value)} + /> + + + 진술유형 @@ -129,20 +160,6 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { - - - - setScCdate(e?.target?.value)} - /> - 접수방법 @@ -195,6 +212,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { label="우편번호" value={zipcode1} onChange={(e) => setZipcode1(e?.target?.value)} + onClick={openPostCode} InputProps={{ display: 'none', readOnly: true, @@ -206,18 +224,10 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { }} /> - - setScJuso(e?.target?.value)} - InputProps={{ readOnly: true }} - /> + + setScJuso(e?.target?.value)} /> - + setScBunji(e?.target?.value)} /> @@ -426,6 +436,8 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { + + ); }; diff --git a/src/views/biz/judge/JudgeDataReview.jsx b/src/views/biz/judge/JudgeDataReview.jsx index 3b0cdab..eda3b6c 100644 --- a/src/views/biz/judge/JudgeDataReview.jsx +++ b/src/views/biz/judge/JudgeDataReview.jsx @@ -7,7 +7,7 @@ import { Button, Divider, Grid, Link } from '@mui/material'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import CmmModal from 'views/cmm/CmmModal'; import { findJudge, findJudgeDatas, removeJudgeData, saveJudgeData } from 'apis/judge'; import JudgeDataNewForm from 'views/biz/judge/JudgeDataNewForm'; @@ -103,6 +103,8 @@ const JudgeDataReview = ({ scDatagb, menuName }) => { }, []); const handleCreate = () => { + // setIsPostOpen(true); + setModify(false); setDetail(false); setCreate(true); diff --git a/src/views/biz/judge/JudgeRegistReview.jsx b/src/views/biz/judge/JudgeRegistReview.jsx index a119a63..ceed405 100644 --- a/src/views/biz/judge/JudgeRegistReview.jsx +++ b/src/views/biz/judge/JudgeRegistReview.jsx @@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import CmmModal from 'views/cmm/CmmModal'; import JudgeTargetSaveForm from 'views/biz/judge/JudgeTargetSaveForm'; import NumberFormat from 'react-number-format'; -import ExcelDownload from 'views/cmm/ExcelDownload'; +import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; import PropTypes from 'prop-types'; diff --git a/src/views/biz/judge/JudgeReview.jsx b/src/views/biz/judge/JudgeReview.jsx index 4832c0b..bc71011 100644 --- a/src/views/biz/judge/JudgeReview.jsx +++ b/src/views/biz/judge/JudgeReview.jsx @@ -14,7 +14,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import InputLabel from 'ui-component/extended/Form/InputLabel'; import { findJudgeResults, findJudges, removeJudge } from 'apis/judge'; import CmmModal from 'views/cmm/CmmModal'; diff --git a/src/views/biz/parking/ParkingRegister.jsx b/src/views/biz/parking/ParkingRegister.jsx index 7ee71c7..7bd5f90 100644 --- a/src/views/biz/parking/ParkingRegister.jsx +++ b/src/views/biz/parking/ParkingRegister.jsx @@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import CmmModal from 'views/cmm/CmmModal'; import SaveParkingTargetForm from './SaveParkingTargetForm'; import NumberFormat from 'react-number-format'; -import ExcelDownload from 'views/cmm/ExcelDownload'; +import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload'; import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking'; const ParkingRegister = () => { diff --git a/src/views/biz/parking/ParkingReview.jsx b/src/views/biz/parking/ParkingReview.jsx index ff2c897..841ca91 100644 --- a/src/views/biz/parking/ParkingReview.jsx +++ b/src/views/biz/parking/ParkingReview.jsx @@ -15,7 +15,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import { findParkings, removeParkingJudge } from 'apis/parking'; import { findJudgeResults } from 'apis/judge'; import InputLabel from '../../../ui-component/extended/Form/InputLabel'; diff --git a/src/views/biz/user/UserManager.jsx b/src/views/biz/user/UserManager.jsx index 114a74a..738c73e 100644 --- a/src/views/biz/user/UserManager.jsx +++ b/src/views/biz/user/UserManager.jsx @@ -10,7 +10,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import CmmModal from '../../cmm/CmmModal'; import UserManagerForm from './UserManagerForm'; import { findUsers, removeUser, saveUser } from 'apis/user'; diff --git a/src/views/cmm/DaumPost.jsx b/src/views/cmm/DaumPost.jsx new file mode 100644 index 0000000..2585734 --- /dev/null +++ b/src/views/cmm/DaumPost.jsx @@ -0,0 +1,62 @@ +import DaumPostcode from 'react-daum-postcode'; +import PropTypes from 'prop-types'; + +/* + 호출하는 곳에서 사용 + + const [isPostOpen, setIsPostOpen] = useState(false); + + const openPostCode = () => { + setIsPostOpen(true); + }; + + const handlePostAddr = (data) => { + console.log(data); + }; + */ + +const DaumPost = ({ isOpen, handlePostAddress }) => { + const onCompletePost = (data) => { + let fullAddr = data.address; + let extraAddr = ''; + + if (data.addressType === 'R') { + if (data.bname !== '') { + extraAddr += data.bname; + } + if (data.buildingName !== '') { + extraAddr += extraAddr !== '' ? `, ${data.buildingName}` : data.buildingName; + } + fullAddr += extraAddr !== '' ? ` (${extraAddr})` : ''; + } + + handlePostAddress({ + zipCode: data.zonecode, + addr: data.address, + dtlAddr: extraAddr, + fullAddr + }); + }; + + const postCodeStyle = { + display: 'block', + position: 'absolute', + top: '10%', + left: '15%', + zIndex: '999999999', + border: '1px solid #000000', + width: '600px', + height: '500px', + // padding: '7px' + overflow: 'hidden' + }; + + // autoClose={false} -> default : true 인 경우 검색 종료후 dom 제거 -> 재검색 불가 + return <>{isOpen ? : null}; +}; + +DaumPost.propTypes = { + isOpen: PropTypes.bool.isRequired, + handlePostAddress: PropTypes.func.isRequired +}; +export default DaumPost; diff --git a/src/views/cmm/ExcelDownload.jsx b/src/views/cmm/file-ctl/ExcelDownload.jsx similarity index 100% rename from src/views/cmm/ExcelDownload.jsx rename to src/views/cmm/file-ctl/ExcelDownload.jsx diff --git a/src/views/cmm/FileForm.jsx b/src/views/cmm/file-ctl/FileForm.jsx similarity index 100% rename from src/views/cmm/FileForm.jsx rename to src/views/cmm/file-ctl/FileForm.jsx diff --git a/src/views/cmm/FileInputForm.jsx b/src/views/cmm/file-ctl/FileInputForm.jsx similarity index 100% rename from src/views/cmm/FileInputForm.jsx rename to src/views/cmm/file-ctl/FileInputForm.jsx diff --git a/src/views/cmm/FileInputForms.jsx b/src/views/cmm/file-ctl/FileInputForms.jsx similarity index 85% rename from src/views/cmm/FileInputForms.jsx rename to src/views/cmm/file-ctl/FileInputForms.jsx index ea84269..349a82c 100644 --- a/src/views/cmm/FileInputForms.jsx +++ b/src/views/cmm/file-ctl/FileInputForms.jsx @@ -14,7 +14,14 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h return ( - } onClick={() => {}} /> + } + onClick={() => {}} + />