diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js index 95e67f1..5c11192 100755 --- a/src/routes/MainRoutes.js +++ b/src/routes/MainRoutes.js @@ -11,7 +11,7 @@ const DashboardDefault = Loadable(lazy(() => import('views/dashboard/Default'))) const DashboardAnalytics = Loadable(lazy(() => import('views/dashboard/Analytics'))); // admin page routing -const PublicBoard = Loadable(lazy(() => import('views/biz/board/PublicBoard'))); +const PublicBoard = Loadable(lazy(() => import('views/biz/pboard/PublicBoard'))); const Board = Loadable(lazy(() => import('views/biz/board/Board'))); // parking diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx index ab2d5e8..134020f 100644 --- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx @@ -15,8 +15,8 @@ import ImageFileTextForm from '../../../cmm/file-ctl/ImageFileTextForm'; const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => { const showAlert = useAlert(); - const [selectedContDoc, setSelectedContDoc] = useState(rowData.scContDoc); - const [selectedIngb, setSelectedIngb] = useState(rowData.scIngb); + const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc); + const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb); const onList = () => { setOpen(false); @@ -41,27 +41,27 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav <> - - + + - - + + - - + + - - + + - - + + - - + + - + 진술유형 @@ -82,7 +82,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + 접수방법 @@ -99,7 +99,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + - + - + - + - - + + - - + + - - + + diff --git a/src/views/biz/admin/judge/JudgeDataModifyForm.jsx b/src/views/biz/admin/judge/JudgeDataModifyForm.jsx index 2d445cb..4da54e9 100644 --- a/src/views/biz/admin/judge/JudgeDataModifyForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataModifyForm.jsx @@ -32,17 +32,17 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav const alert = useAlert(); const [isPostOpen, setIsPostOpen] = useState(false); - const [scCarnum, setScCarnum] = useState(rowData.scCarnum); - const [scName, setScName] = useState(rowData.scName); - const [scDong, setScDong] = useState(rowData.scDong); - const [selectedContDoc, setSelectedContDoc] = useState(rowData.scContDoc); - const [selectedIngb, setSelectedIngb] = useState(rowData.scIngb); - const [zipcode1, setZipcode1] = useState((rowData.zipcode1 ?? '') + (rowData.zipcode2 ?? '')); - const [scJuso, setScJuso] = useState(rowData.scJuso); - const [scBunji, setScBunji] = useState(rowData.scBunji); - const [scWdate, setScWdate] = useState(rowData.scWdate); - const [scCdate, setScCdate] = useState(rowData.scCdate); - const [scJbtime, setScJbtime] = useState(rowData.scJbtime); + const [scCarnum, setScCarnum] = useState(rowData?.scCarnum); + const [scName, setScName] = useState(rowData?.scName); + const [scDong, setScDong] = useState(rowData?.scDong); + const [selectedContDoc, setSelectedContDoc] = useState(rowData?.scContDoc); + const [selectedIngb, setSelectedIngb] = useState(rowData?.scIngb); + const [zipcode1, setZipcode1] = useState((rowData?.zipcode1 ?? '') + (rowData?.zipcode2 ?? '')); + const [scJuso, setScJuso] = useState(rowData?.scJuso); + const [scBunji, setScBunji] = useState(rowData?.scBunji); + const [scWdate, setScWdate] = useState(rowData?.scWdate); + const [scCdate, setScCdate] = useState(rowData?.scCdate); + const [scJbtime, setScJbtime] = useState(rowData?.scJbtime); const [scPos, setScPos] = useState(''); const [picads, setPicads] = useState({}); @@ -189,16 +189,16 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav <> - + - + - + - + - + setScName(e?.target?.value)} /> - + setScDong(e?.target?.value)} /> - + 진술유형 setSelectedIngb(e?.target?.value)}> @@ -250,7 +250,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + setScCdate(e?.target?.value)} /> - + setScWdate(e?.target?.value)} /> - + setScJbtime(e?.target?.value)} /> - + - + - + setScJuso(e?.target?.value)} /> - + setScBunji(e?.target?.value)} /> {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 9, 1).map((idx) => ( - + { columns={columns} rowsState={rowsState} totalCount={totalCount} - setrowsState={setRowsState} + setRowsState={setRowsState} handleSelection={handleSelection} selectionModel={selectionModel} /> diff --git a/src/views/biz/admin/judge/JudgeReview.jsx b/src/views/biz/admin/judge/JudgeReview.jsx index 1f5214f..c558399 100644 --- a/src/views/biz/admin/judge/JudgeReview.jsx +++ b/src/views/biz/admin/judge/JudgeReview.jsx @@ -199,6 +199,7 @@ const JudgeReview = ({ msDatagb, menuName }) => { id="reviewYear" name="reviewYear" defaultValue={year} + value={year} onChange={(e) => setSelectedYear(e.target.value)} > {years.map((year, idx) => ( @@ -215,7 +216,6 @@ const JudgeReview = ({ msDatagb, menuName }) => { placeholder="심의차수" onKeyDown={handleSearch} size="small" - autoComplete autoFocus endAdornment={ diff --git a/src/views/biz/admin/judge/ModalJudgeResult.jsx b/src/views/biz/admin/judge/ModalJudgeResult.jsx index 359c1a4..7b3133c 100644 --- a/src/views/biz/admin/judge/ModalJudgeResult.jsx +++ b/src/views/biz/admin/judge/ModalJudgeResult.jsx @@ -14,7 +14,6 @@ import { useState } from 'react'; import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import { findJudgeResults } from 'apis/judge'; -import MuiAlert from 'views/cmm/MuiAlert'; import _ from 'lodash'; import { useAlert } from 'react-alert'; @@ -38,23 +37,20 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({ } })); +const totLabel = ['부과', '서손', '미부과', '계']; + const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUserData, selectedRow, judgeTeam }) => { + const alert = useAlert(); const [judgeResult, setJudgeResult] = useState({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUserData - // judgeData - // simsaUser }); - const [msuTeam, setMsuTeam] = useState(judgeTeam); - const [alertOpen, setAlertOpen] = useState(false); + const [msuTeam, setMsuTeam] = useState(judgeTeam ?? '001'); - const totLabel = ['부과', '서손', '미부과', '계']; - const alert = useAlert(); - console.log(totJudgeUsers, totJudgeUserData, judgeCars, judgeUserData, judgeTeam); const onSearch = async () => { - setAlertOpen(false); + // setAlertOpen(false); if (msuTeam) { const params = { msDatagb: selectedRow.msDatagb ?? '', @@ -80,15 +76,8 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse totJudgeUserData: [], judgeCars: [], judgeUserData: [] - // judgeData: [], - // simsaUser: [] }); alert.show('조회된 데이타가 없습니다.'); - // setAlertState({ - // ...alertState, - // message: '조회된 데이타가 없습니다.' - // }); - // setAlertOpen(true); } } }; @@ -114,7 +103,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse - setMsuTeam(e.target.value)}> {combo.teams.map((team) => ( {team.value} @@ -204,7 +193,6 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse - { const [rcSeq2, setRcSeq2] = useState('2022200899'); const [selectionModel, setSelectionModel] = useState([]); const [totalCount, setTotalCount] = useState(0); - const [rowsStatus, setRowsStatus] = useState({ + const [rowsState, setRowsState] = useState({ page: 0, pageSize: 100, rows: [] @@ -62,7 +62,7 @@ const ParkingRegister = () => { if (response && response.data) { setSelectionModel([]); setTotalCount(response.count); - setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data })); + setRowsState((prevRows) => ({ ...prevRows, rows: response.data })); } }); }; @@ -82,7 +82,7 @@ const ParkingRegister = () => { rcIrTransfer, rcSeq1, rcSeq2, - rcCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].rcCode) + rcCodes: selectionModel.map((d) => rowsState.rows[d - 1].rcCode) }; setOpen(false); // return false; @@ -178,7 +178,7 @@ const ParkingRegister = () => { - + @@ -194,9 +194,9 @@ const ParkingRegister = () => { isCheckbox isHideFooter columns={columns} - rowsState={rowsStatus} + rowsState={rowsState} totalCount={totalCount} - setRowsStatus={setRowsStatus} + setRowsState={setRowsState} handleSelection={handleSelection} selectionModel={selectionModel} /> diff --git a/src/views/biz/admin/parking/ParkingReview.jsx b/src/views/biz/admin/parking/ParkingReview.jsx index dd77928..ef1fa43 100644 --- a/src/views/biz/admin/parking/ParkingReview.jsx +++ b/src/views/biz/admin/parking/ParkingReview.jsx @@ -203,7 +203,6 @@ const ParkingReview = () => { placeholder="심의차수" onKeyDown={handleSearch} size="small" - autoComplete autoFocus endAdornment={ @@ -228,7 +227,7 @@ const ParkingReview = () => { handleCellClick={handleOnCellClick} /> - + {judgeResultData?.selectedRow && } ); diff --git a/src/views/biz/board/PublicBoardForm.jsx b/src/views/biz/board/PublicBoardForm.jsx deleted file mode 100644 index 46ce456..0000000 --- a/src/views/biz/board/PublicBoardForm.jsx +++ /dev/null @@ -1,224 +0,0 @@ -import { useMemo, useRef, useState } from 'react'; - -import { useAlert } from 'react-alert'; -// material-ui -import { Button, Divider, FormControl, Grid, MenuItem, Select, TextField } from '@mui/material'; - -import ReactQuill from 'react-quill'; -import 'react-quill/dist/quill.snow.css'; - -// project imports -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/file-ctl/FileForm'; -import PropTypes from 'prop-types'; - -const PublicBoardForm = (props) => { - // eslint-disable-next-line react/prop-types - const { create, setOpen, handleModalSave, rowData = {}, owner = false } = props; - const alert = useAlert(); - const quillRef = useRef(); - const [dept, setDept] = useState(create ? '주정차위반' : rowData.inDept); - const [subject, setSubject] = useState(create ? '' : rowData.inTitle); - const [contents, setContents] = useState(create ? '' : rowData.inContents); - const [filesInfo, setFilesInfo] = useState(); - const [selectedFile, setSelectedFile] = useState(create ? '' : rowData.inFilename); // 파일 - // const [fileData, setFileData] = useState(); - - const onList = () => { - setOpen(false); - }; - const onSave = () => { - // TODO : validation check 추가 - const formData = new FormData(); - formData.append('inCode', rowData.inCode ?? ''); - formData.append('inTitle', subject); - formData.append('inDept', dept); - formData.append('inContents', contents); - formData.append('inFilename', selectedFile ?? ''); - - if (filesInfo && filesInfo.length > 0) { - // eslint-disable-next-line no-plusplus - for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]); - } - handleModalSave('SAVE', formData); - }; - - const onRemove = () => { - handleModalSave('DELETE', rowData.inCode); - }; - - const modules = useMemo( - () => ({ - toolbar: { - container: [ - [{ header: [1, 2, false] }], - ['bold', 'italic', 'underline', 'strike', 'blockquote'], - [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }], - ['link'], - [{ align: [] }, { color: [] }, { background: [] }], // dropdown with defaults from theme - ['clean'] - // ['image', 'video'] - ] - } - }), - [] - ); - - const formats = useMemo( - () => [ - // 'font', - 'header', - 'bold', - 'italic', - 'underline', - 'strike', - 'blockquote', - 'list', - 'bullet', - 'indent', - 'link', - 'align', - 'color', - 'background' - ], - [] - ); - - const onChangeFile = (file) => { - setSelectedFile(file.name); - setFilesInfo([file]); - }; - - // const onChangeFile = (e) => { - // setSelectedFile(e.target.files[0].name); - // setFilesInfo(e.target.files); - // }; - - const handleFileDownload = () => { - if (!rowData.inFilename) { - alert.show('등록된 파일이 없습니다.'); - return; - } - fileDownload(rowData.inCode, rowData.inFilename, alert).then(() => {}); - }; - - return ( - <> - - - - setSubject(e.target.value)} - fullWidth - /> - - - - 업무구분 - - - - - - - - - - - - - - - - - - - - - { - if (element !== null) { - quillRef.current = element; - } - }} - readOnly={!create} - value={contents} - onChange={setContents} - modules={modules} - formats={formats} - theme="snow" - placeholder="내용을 입력해주세요." - /> - - - - - - - - - - - - - - - - - - - - - {!create && ( - - - - )} - - - ); -}; - -PublicBoardForm.propTypes = { - rowData: PropTypes.object.isRequired, - handleModalSave: PropTypes.func.isRequired, - setOpen: PropTypes.func.isRequired, - owner: PropTypes.bool.isRequired -}; - -export default PublicBoardForm; diff --git a/src/views/biz/judge/JudgeReview.jsx b/src/views/biz/judge/JudgeReview.jsx index 8185ff6..837f313 100644 --- a/src/views/biz/judge/JudgeReview.jsx +++ b/src/views/biz/judge/JudgeReview.jsx @@ -16,7 +16,7 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import InputLabel from 'ui-component/extended/Form/InputLabel'; -import { findByUserJudges, findJudges, removeJudge } from 'apis/judge'; +import { findByUserJudges } from 'apis/judge'; import CmmModal from 'views/cmm/CmmModal'; const JudgeReview = ({ msDatagb, menuName }) => { @@ -235,7 +235,6 @@ const JudgeReview = ({ msDatagb, menuName }) => { placeholder="심의차수" onKeyDown={handleSearch} size="small" - autoComplete autoFocus endAdornment={ diff --git a/src/views/biz/pboard/ModifyPublicBoardForm.jsx b/src/views/biz/pboard/ModifyPublicBoardForm.jsx new file mode 100644 index 0000000..72afe10 --- /dev/null +++ b/src/views/biz/pboard/ModifyPublicBoardForm.jsx @@ -0,0 +1,215 @@ +import { useMemo, useRef, useState } from 'react'; + +import { useAlert } from 'react-alert'; +// material-ui +import { Button, Divider, FormControl, Grid, MenuItem, Select, TextField } from '@mui/material'; + +import ReactQuill from 'react-quill'; +import 'react-quill/dist/quill.snow.css'; + +// project imports +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/file-ctl/FileForm'; +import PropTypes from 'prop-types'; + +const ModifyPublicBoardForm = (props) => { + // eslint-disable-next-line react/prop-types + const { setOpen, handleModalSave, rowData = {}, owner } = props; + const alert = useAlert(); + const quillRef = useRef(); + const [dept, setDept] = useState(rowData?.inDept); + const [subject, setSubject] = useState(rowData?.inTitle); + const [contents, setContents] = useState(rowData?.inContents); + const [filesInfo, setFilesInfo] = useState(); + const [selectedFile, setSelectedFile] = useState(rowData?.inFilename); // 파일 + // const [fileData, setFileData] = useState(); + + const onList = () => { + setOpen(false); + }; + const onSave = () => { + // TODO : validation check 추가 + const formData = new FormData(); + formData.append('inCode', rowData.inCode ?? ''); + formData.append('inTitle', subject); + formData.append('inDept', dept); + formData.append('inContents', contents); + formData.append('inFilename', selectedFile ?? ''); + + if (filesInfo && filesInfo.length > 0) { + // eslint-disable-next-line no-plusplus + for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]); + } + handleModalSave('SAVE', formData); + }; + + const onRemove = () => { + handleModalSave('DELETE', rowData.inCode); + }; + + const modules = useMemo( + () => ({ + toolbar: { + container: [ + [{ header: [1, 2, false] }], + ['bold', 'italic', 'underline', 'strike', 'blockquote'], + [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }], + ['link'], + [{ align: [] }, { color: [] }, { background: [] }], // dropdown with defaults from theme + ['clean'] + // ['image', 'video'] + ] + } + }), + [] + ); + + const formats = useMemo( + () => [ + // 'font', + 'header', + 'bold', + 'italic', + 'underline', + 'strike', + 'blockquote', + 'list', + 'bullet', + 'indent', + 'link', + 'align', + 'color', + 'background' + ], + [] + ); + + const onChangeFile = (file) => { + setSelectedFile(file.name); + setFilesInfo([file]); + }; + + const handleFileDownload = () => { + if (!rowData.inFilename) { + alert.show('등록된 파일이 없습니다.'); + return; + } + fileDownload(rowData.inCode, rowData.inFilename, alert).then(() => {}); + }; + + return ( + <> + + + setSubject(e.target.value)} + fullWidth + /> + + + + 업무구분 + + + + + + + + + + + + + + + + + + + + + { + if (element !== null) { + quillRef.current = element; + } + }} + readOnly={!owner} + value={contents} + onChange={setContents} + modules={modules} + formats={formats} + theme="snow" + placeholder="내용을 입력해주세요." + /> + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +ModifyPublicBoardForm.propTypes = { + rowData: PropTypes.object.isRequired, + handleModalSave: PropTypes.func.isRequired, + setOpen: PropTypes.func.isRequired, + owner: PropTypes.bool.isRequired +}; + +export default ModifyPublicBoardForm; diff --git a/src/views/biz/pboard/NewPublicBoardForm.jsx b/src/views/biz/pboard/NewPublicBoardForm.jsx new file mode 100644 index 0000000..962d657 --- /dev/null +++ b/src/views/biz/pboard/NewPublicBoardForm.jsx @@ -0,0 +1,167 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; + +import { useAlert } from 'react-alert'; +// material-ui +import { Button, Divider, FormControl, Grid, MenuItem, Select, TextField } from '@mui/material'; + +import ReactQuill from 'react-quill'; +import 'react-quill/dist/quill.snow.css'; + +// project imports +import InputLabel from 'ui-component/extended/Form/InputLabel'; + +import { List, Save } from '@mui/icons-material'; +import FileForm from 'views/cmm/file-ctl/FileForm'; +import PropTypes from 'prop-types'; + +const NewPublicBoardForm = (props) => { + // eslint-disable-next-line react/prop-types + const { setOpen, handleModalSave, rowData = {} } = props; + const alert = useAlert(); + const quillRef = useRef(); + const [dept, setDept] = useState(''); + const [subject, setSubject] = useState(''); + const [contents, setContents] = useState(''); + const [filesInfo, setFilesInfo] = useState(); + const [selectedFile, setSelectedFile] = useState(''); // 파일 + // const [fileData, setFileData] = useState(); + + const onList = () => { + setOpen(false); + }; + const onSave = () => { + // TODO : validation check 추가 + const formData = new FormData(); + formData.append('inTitle', subject); + formData.append('inDept', dept); + formData.append('inContents', contents); + formData.append('inFilename', selectedFile ?? ''); + + if (filesInfo && filesInfo.length > 0) { + // eslint-disable-next-line no-plusplus + for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]); + } + handleModalSave('SAVE', formData); + }; + + const modules = useMemo( + () => ({ + toolbar: { + container: [ + [{ header: [1, 2, false] }], + ['bold', 'italic', 'underline', 'strike', 'blockquote'], + [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }], + ['link'], + [{ align: [] }, { color: [] }, { background: [] }], // dropdown with defaults from theme + ['clean'] + // ['image', 'video'] + ] + } + }), + [] + ); + + const formats = useMemo( + () => [ + // 'font', + 'header', + 'bold', + 'italic', + 'underline', + 'strike', + 'blockquote', + 'list', + 'bullet', + 'indent', + 'link', + 'align', + 'color', + 'background' + ], + [] + ); + + const onChangeFile = (file) => { + setSelectedFile(file.name); + setFilesInfo([file]); + }; + + useEffect(() => { + setDept('주정차위반'); + }, []); + + return ( + <> + + + setSubject(e.target.value)} fullWidth /> + + + + 업무구분 + + + + + + + { + if (element !== null) { + quillRef.current = element; + } + }} + value={contents} + onChange={setContents} + modules={modules} + formats={formats} + theme="snow" + placeholder="내용을 입력해주세요." + /> + + + + + + + + + + + + + + + + + + + + + + ); +}; + +NewPublicBoardForm.propTypes = { + rowData: PropTypes.object.isRequired, + handleModalSave: PropTypes.func.isRequired, + setOpen: PropTypes.func.isRequired +}; + +export default NewPublicBoardForm; diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/pboard/PublicBoard.jsx similarity index 89% rename from src/views/biz/board/PublicBoard.jsx rename to src/views/biz/pboard/PublicBoard.jsx index 9555de9..65453e9 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/pboard/PublicBoard.jsx @@ -12,11 +12,12 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid'; import CmmModal from 'views/cmm/CmmModal'; -import PublicBoardForm from './PublicBoardForm'; +import NewPublicBoardForm from './NewPublicBoardForm'; import { removePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public'; import { useAlert } from 'react-alert'; import useAuth from 'hooks/useAuth'; +import ModifyPublicBoardForm from './ModifyPublicBoardForm'; const PublicBoard = () => { const { user } = useAuth(); @@ -93,8 +94,6 @@ const PublicBoard = () => { setCreate(false); setTitle('공지사항 변경'); setSelectedRow(e?.row); - console.log(user.name === e?.row.inName); - console.log(user.name, e?.row.inName); setOwner(user.name === e?.row.inName); modifyPublicBoardHitCount(e?.row?.inCode); setOpen(true); @@ -139,10 +138,6 @@ const PublicBoard = () => { - {/* - - */} - { handleCellClick={handleOnCellClick} /> - + {create && } + {!create && ( + + )} ); diff --git a/src/views/cmm/file-ctl/FileForm.jsx b/src/views/cmm/file-ctl/FileForm.jsx index 70d26ce..33fd2cc 100644 --- a/src/views/cmm/file-ctl/FileForm.jsx +++ b/src/views/cmm/file-ctl/FileForm.jsx @@ -2,7 +2,15 @@ import { Button, Grid, InputAdornment, TextField } from '@mui/material'; import { FileDownload, FileUpload } from '@mui/icons-material'; import PropTypes from 'prop-types'; -const FileForm = ({ isDownload = false, isDisabled = false, labelName, selectedFile, handleChangeFile, handleFileDownload, alert }) => { +const FileForm = ({ + isDownload = false, + isDisabled = false, + labelName, + selectedFile, + handleChangeFile, + handleFileDownload = () => {}, + alert +}) => { const onChangeFile = (e) => { const file = e.target.files[0]; if (file.type.includes('image')) { @@ -12,10 +20,11 @@ const FileForm = ({ isDownload = false, isDisabled = false, labelName, selectedF }; return ( - - + + {isDownload ? ( ) : ( - + )} - +