From d509a8e47b5392eecf1e95d892441917a60e503f Mon Sep 17 00:00:00 2001 From: minuk926 Date: Wed, 25 May 2022 18:43:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20debug=20console=20=EC=97=90=EB=9F=AC=20f?= =?UTF-8?q?ix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/admin/judge/JudgeDataDetailForm.jsx | 13 ++++---- .../biz/admin/judge/JudgeDataModifyForm.jsx | 19 +++++++----- .../biz/admin/judge/JudgeDataNewForm.jsx | 19 +++++++----- src/views/biz/admin/judge/JudgeReview.jsx | 30 +++++-------------- src/views/cmm/file-ctl/FileInputForms.jsx | 21 ++++++------- src/views/cmm/file-ctl/ImageFileTextForm.jsx | 5 +--- 6 files changed, 48 insertions(+), 59 deletions(-) diff --git a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx index c48315d..95e7c34 100644 --- a/src/views/biz/admin/judge/JudgeDataDetailForm.jsx +++ b/src/views/biz/admin/judge/JudgeDataDetailForm.jsx @@ -165,18 +165,17 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav - + - + {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 9, 1).map((idx) => ( - + - setScJuso(e?.target?.value)} /> + setScJuso(e?.target?.value)} + /> setScBunji(e?.target?.value)} /> @@ -351,9 +359,8 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 5, 1).map((idx) => ( - + {_.range(1, 9, 1).map((idx) => ( - + { /> - setScJuso(e?.target?.value)} /> + setScJuso(e?.target?.value)} + /> setScBunji(e?.target?.value)} /> @@ -275,9 +283,8 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => { {_.range(1, 5, 1).map((idx) => ( - + { {_.range(1, 5, 1).map((idx) => ( - + { {_.range(1, 9, 1).map((idx) => ( - + { const [title, setTitle] = useState(); const [selectedYear, setSelectedYear] = useState(year); - const [searchTxt, setSearchTxt] = useState(''); + const inputRef = useRef(''); const [totalCount, setTotalCount] = useState(0); const [rowsState, setRowsState] = useState({ @@ -56,29 +56,23 @@ const JudgeReview = ({ msDatagb, menuName }) => { const search = useCallback(async () => { const params = { msDatagb, + msYear: selectedYear, + msChasu: inputRef.current, page: rowsState.page, size: rowsState.pageSize }; let res = {}; if (msDatagb) { - res = await findJudges({ ...params, msYear: selectedYear, msChasu: searchTxt }); + res = await findJudges(params); } else { - res = await findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt }); + res = await findParkings(params); } if (res && res.data) { - console.log(res); setTotalCount(res.count); setRowsState((prevState) => ({ ...prevState, rows: res.data })); } - - // findJudges({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { - // if (response && response.data) { - // setTotalCount(response.count); - // setRowsState((prevState) => ({ ...prevState, rows: response.data })); - // } - // }); - }, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); + }, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]); const removeJudge = useCallback( (row) => async () => { @@ -150,21 +144,11 @@ const JudgeReview = ({ msDatagb, menuName }) => { if (!selectedYear) return; if (event.type === 'keydown' && event.key === 'Enter') { - const newString = event?.target.value; - setSearchTxt(newString); + inputRef.current = event.target.value; search(); } }; - useEffect(() => { - if (isInit.current) { - isInit.current = false; - return; - } - search(); - // }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); - }, [search]); - const handleOnCellClick = async (e) => { if (e?.field === 'msDate') { const params = { diff --git a/src/views/cmm/file-ctl/FileInputForms.jsx b/src/views/cmm/file-ctl/FileInputForms.jsx index 0fcb939..df58d78 100644 --- a/src/views/cmm/file-ctl/FileInputForms.jsx +++ b/src/views/cmm/file-ctl/FileInputForms.jsx @@ -1,3 +1,4 @@ +import React from 'react'; import { Button, Grid, TextField } from '@mui/material'; import { FileUpload } from '@mui/icons-material'; import PropTypes from 'prop-types'; @@ -14,19 +15,19 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h return ( - } - onClick={() => {}} - /> + {}} /> - diff --git a/src/views/cmm/file-ctl/ImageFileTextForm.jsx b/src/views/cmm/file-ctl/ImageFileTextForm.jsx index 06a35cc..4bc5a0f 100644 --- a/src/views/cmm/file-ctl/ImageFileTextForm.jsx +++ b/src/views/cmm/file-ctl/ImageFileTextForm.jsx @@ -2,7 +2,7 @@ import { InputAdornment, TextField } from '@mui/material'; import { FileDownload } from '@mui/icons-material'; import PropTypes from 'prop-types'; -const ImageFileTextForm = ({ labelName, fileName = '', methodName, handleViewImg }) => ( +const ImageFileTextForm = ({ labelName = '', fileName, methodName = '', handleViewImg = () => {} }) => ( <> {fileName && ( )} - {/* {!fileName && ( */} - {/* handleViewImg(methodName)} /> */} - {/* )} */} ); ImageFileTextForm.propTypes = {