|
|
@ -33,7 +33,7 @@ const JudgeReview = ({ msDatagb, menuName }) => {
|
|
|
|
const [title, setTitle] = useState();
|
|
|
|
const [title, setTitle] = useState();
|
|
|
|
|
|
|
|
|
|
|
|
const [selectedYear, setSelectedYear] = useState(year);
|
|
|
|
const [selectedYear, setSelectedYear] = useState(year);
|
|
|
|
const [searchTxt, setSearchTxt] = useState('');
|
|
|
|
const inputRef = useRef('');
|
|
|
|
|
|
|
|
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
const [rowsState, setRowsState] = useState({
|
|
|
|
const [rowsState, setRowsState] = useState({
|
|
|
@ -56,29 +56,23 @@ const JudgeReview = ({ msDatagb, menuName }) => {
|
|
|
|
const search = useCallback(async () => {
|
|
|
|
const search = useCallback(async () => {
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
msDatagb,
|
|
|
|
msDatagb,
|
|
|
|
|
|
|
|
msYear: selectedYear,
|
|
|
|
|
|
|
|
msChasu: inputRef.current,
|
|
|
|
page: rowsState.page,
|
|
|
|
page: rowsState.page,
|
|
|
|
size: rowsState.pageSize
|
|
|
|
size: rowsState.pageSize
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let res = {};
|
|
|
|
let res = {};
|
|
|
|
if (msDatagb) {
|
|
|
|
if (msDatagb) {
|
|
|
|
res = await findJudges({ ...params, msYear: selectedYear, msChasu: searchTxt });
|
|
|
|
res = await findJudges(params);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
res = await findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt });
|
|
|
|
res = await findParkings(params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (res && res.data) {
|
|
|
|
if (res && res.data) {
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
setTotalCount(res.count);
|
|
|
|
setTotalCount(res.count);
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows: res.data }));
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows: res.data }));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]);
|
|
|
|
// 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]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const removeJudge = useCallback(
|
|
|
|
const removeJudge = useCallback(
|
|
|
|
(row) => async () => {
|
|
|
|
(row) => async () => {
|
|
|
@ -150,21 +144,11 @@ const JudgeReview = ({ msDatagb, menuName }) => {
|
|
|
|
if (!selectedYear) return;
|
|
|
|
if (!selectedYear) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (event.type === 'keydown' && event.key === 'Enter') {
|
|
|
|
if (event.type === 'keydown' && event.key === 'Enter') {
|
|
|
|
const newString = event?.target.value;
|
|
|
|
inputRef.current = event.target.value;
|
|
|
|
setSearchTxt(newString);
|
|
|
|
|
|
|
|
search();
|
|
|
|
search();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (isInit.current) {
|
|
|
|
|
|
|
|
isInit.current = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
search();
|
|
|
|
|
|
|
|
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
|
|
|
}, [search]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOnCellClick = async (e) => {
|
|
|
|
const handleOnCellClick = async (e) => {
|
|
|
|
if (e?.field === 'msDate') {
|
|
|
|
if (e?.field === 'msDate') {
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|