|
|
|
@ -59,6 +59,19 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
});
|
|
|
|
|
const [judgeDatas, setJudgeDatas] = useState(judgeData ?? []);
|
|
|
|
|
const [msuTeam, setMsuTeam] = useState(judgeTeam ?? '001');
|
|
|
|
|
const [judgeDataCnt, setJudgeDataCnt] = useState(judgeUserData.filter((d) => d.msResult === '0').length);
|
|
|
|
|
|
|
|
|
|
const onChangeTeam = (e) => {
|
|
|
|
|
setJudgeResult({
|
|
|
|
|
...judgeResult,
|
|
|
|
|
totJudgeUsers: [],
|
|
|
|
|
totJudgeUserData: [],
|
|
|
|
|
judgeCars: [],
|
|
|
|
|
judgeUserData: []
|
|
|
|
|
});
|
|
|
|
|
setJudgeDataCnt(0);
|
|
|
|
|
setMsuTeam(e.target.value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSearch = async () => {
|
|
|
|
|
if (msuTeam) {
|
|
|
|
@ -79,7 +92,6 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setJudgeDatas(arrJudgeData);
|
|
|
|
|
// judgeDatas.current = arrJudgeData;
|
|
|
|
|
|
|
|
|
|
setJudgeResult({
|
|
|
|
|
...judgeResult,
|
|
|
|
@ -88,14 +100,9 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
judgeCars: res.data?.judgeCars,
|
|
|
|
|
judgeUserData: res.data?.judgeUserData
|
|
|
|
|
});
|
|
|
|
|
setJudgeDataCnt(res.data?.judgeUserData.filter((d) => d.msResult === '0').length);
|
|
|
|
|
console.log(res.data?.judgeUserData.filter((d) => d.msResult === '0').length);
|
|
|
|
|
} else {
|
|
|
|
|
setJudgeResult({
|
|
|
|
|
...judgeResult,
|
|
|
|
|
totJudgeUsers: [],
|
|
|
|
|
totJudgeUserData: [],
|
|
|
|
|
judgeCars: [],
|
|
|
|
|
judgeUserData: []
|
|
|
|
|
});
|
|
|
|
|
alert.show('조회된 데이타가 없습니다.');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -156,7 +163,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
summaryRight: false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
excelDatas.forEach((row, idx) => {
|
|
|
|
|
excelDatas.forEach((row) => {
|
|
|
|
|
const dataRow = worksheet.addRow();
|
|
|
|
|
|
|
|
|
|
colNames.forEach((col, i) => {
|
|
|
|
@ -204,13 +211,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
<Grid item xs={3.7}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel required>팀</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
sx={{ marginTop: 1 }}
|
|
|
|
|
defaultValue={msuTeam}
|
|
|
|
|
value={msuTeam}
|
|
|
|
|
onChange={(e) => setMsuTeam(e.target.value)}
|
|
|
|
|
size="small"
|
|
|
|
|
>
|
|
|
|
|
<Select sx={{ marginTop: 1 }} defaultValue={msuTeam} value={msuTeam} onChange={onChangeTeam} size="small">
|
|
|
|
|
{combo.teams.map((team, idx) => (
|
|
|
|
|
<MenuItem key={idx} value={team.code}>
|
|
|
|
|
{team.value}
|
|
|
|
@ -224,7 +225,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
조회
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
disabled={judgeDatas.length === 0}
|
|
|
|
|
disabled={judgeDataCnt === 0}
|
|
|
|
|
variant="contained"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="small"
|
|
|
|
@ -234,7 +235,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
일괄처리
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
disabled={judgeDatas.length === 0}
|
|
|
|
|
disabled={judgeResult.totJudgeUsers.length === 0}
|
|
|
|
|
variant="contained"
|
|
|
|
|
size="small"
|
|
|
|
|
startIcon={<IconFileExport />}
|
|
|
|
|