|
|
@ -16,18 +16,19 @@ import MainCard from 'ui-component/cards/MainCard';
|
|
|
|
|
|
|
|
|
|
|
|
// project imports
|
|
|
|
// project imports
|
|
|
|
import MuiDataGrid from 'views/cmm/MuiDataGrid';
|
|
|
|
import MuiDataGrid from 'views/cmm/MuiDataGrid';
|
|
|
|
import xitCmm from 'commons/XitCmm';
|
|
|
|
import { findParkings, removeParkingJudge } from 'apis/parking';
|
|
|
|
import { findParkings } from 'apis/parking';
|
|
|
|
|
|
|
|
import { findJudgeResults } from 'apis/judge';
|
|
|
|
import { findJudgeResults } from 'apis/judge';
|
|
|
|
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
|
|
|
|
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
|
|
|
|
import ModalJudgeResult from 'views/biz/judge/ModalJudgeResult';
|
|
|
|
import ModalJudgeResult from 'views/biz/judge/ModalJudgeResult';
|
|
|
|
import CmmModal from 'views/cmm/CmmModal';
|
|
|
|
import CmmModal from 'views/cmm/CmmModal';
|
|
|
|
|
|
|
|
import { useAlert } from 'react-alert';
|
|
|
|
|
|
|
|
|
|
|
|
const ParkingReview = () => {
|
|
|
|
const ParkingReview = () => {
|
|
|
|
const isInit = useRef(true);
|
|
|
|
const isInit = useRef(true);
|
|
|
|
const year = getYear(new Date());
|
|
|
|
const year = getYear(new Date());
|
|
|
|
const years = _.range(year, year - 14, -1);
|
|
|
|
const years = _.range(year, year - 14, -1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const alert = useAlert();
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
const [title, setTitle] = useState();
|
|
|
|
const [title, setTitle] = useState();
|
|
|
|
|
|
|
|
|
|
|
@ -49,13 +50,35 @@ const ParkingReview = () => {
|
|
|
|
judgeTeam: ''
|
|
|
|
judgeTeam: ''
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const search = useCallback(() => {
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
|
|
page: rowsState.page,
|
|
|
|
|
|
|
|
size: rowsState.pageSize
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
|
|
|
|
|
|
|
|
if (response && response.data) {
|
|
|
|
|
|
|
|
setTotalCount(response.count);
|
|
|
|
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
|
|
|
|
|
|
|
// apiRef.current.forceUpdate(); // .updateRowData([]);
|
|
|
|
|
|
|
|
// apiRef.current.updateRowData([]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
|
|
|
|
|
|
|
const removeJudge = useCallback(
|
|
|
|
const removeJudge = useCallback(
|
|
|
|
(row) => () => {
|
|
|
|
(row) => () => {
|
|
|
|
// setTimeout(() => {
|
|
|
|
removeParkingJudge(row).then((response) => {
|
|
|
|
// setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId));
|
|
|
|
if (response && response.success) {
|
|
|
|
// });
|
|
|
|
setRowsState({
|
|
|
|
xitCmm.alertParam(`삭제대상<br>${JSON.stringify(row)}`);
|
|
|
|
...rowsState,
|
|
|
|
console.log(row);
|
|
|
|
page: 0
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
search();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
alert.show(response.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[]
|
|
|
|
[]
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -108,22 +131,6 @@ const ParkingReview = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const search = useCallback(() => {
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
|
|
page: rowsState.page,
|
|
|
|
|
|
|
|
size: rowsState.pageSize
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
|
|
|
|
|
|
|
|
if (response && response.data) {
|
|
|
|
|
|
|
|
setTotalCount(response.count);
|
|
|
|
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
|
|
|
|
|
|
|
// apiRef.current.forceUpdate(); // .updateRowData([]);
|
|
|
|
|
|
|
|
// apiRef.current.updateRowData([]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSearch = async (event) => {
|
|
|
|
const handleSearch = async (event) => {
|
|
|
|
if (!selectedYear) return;
|
|
|
|
if (!selectedYear) return;
|
|
|
|
|
|
|
|
|
|
|
|