|
|
@ -14,28 +14,49 @@ import PropTypes from 'prop-types';
|
|
|
|
import { IconFileExport } from '@tabler/icons';
|
|
|
|
import { IconFileExport } from '@tabler/icons';
|
|
|
|
|
|
|
|
|
|
|
|
import combo from 'commons/combo_data';
|
|
|
|
import combo from 'commons/combo_data';
|
|
|
|
|
|
|
|
import { useAlert } from 'react-alert';
|
|
|
|
|
|
|
|
|
|
|
|
const toDate = new Date();
|
|
|
|
const toDate = new Date();
|
|
|
|
|
|
|
|
|
|
|
|
const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
const [msuTeam, setMsuTeam] = useState(combo.teams[0].code);
|
|
|
|
const showAlert = useAlert();
|
|
|
|
|
|
|
|
const [msuTeam, setMsuTeam] = useState(' ');
|
|
|
|
const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msStartsi, setMsStartsi] = useState(getHours(toDate));
|
|
|
|
const [msStartsi, setMsStartsi] = useState(`${format(toDate, 'yyyy-MM-dd')} 09:00`);
|
|
|
|
const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msChasu, setMsChasu] = useState(99);
|
|
|
|
const [msChasu, setMsChasu] = useState();
|
|
|
|
const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
|
|
|
const [msClosesi, setMsClosesi] = useState(getHours(toDate));
|
|
|
|
const [msClosesi, setMsClosesi] = useState(`${format(toDate, 'yyyy-MM-dd')} 18:00`);
|
|
|
|
|
|
|
|
|
|
|
|
const onSave = () => {
|
|
|
|
const onSave = () => {
|
|
|
|
// TODO : validation check 추가
|
|
|
|
if (!msuTeam || msuTeam.length < 3) {
|
|
|
|
|
|
|
|
showAlert.show('심의팀을 선택해 주세요');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!msChasu || msChasu.length === 0) {
|
|
|
|
|
|
|
|
showAlert.show('심의 차수를 입력해 주세요');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (msSdate.toString() >= msEdate.toString()) {
|
|
|
|
|
|
|
|
showAlert.show('심의시작일과 심의종료일을 확인해 주세요');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (msEdate.toString() > msCdate.toString()) {
|
|
|
|
|
|
|
|
showAlert.show('심의종료일과 심의마감일을 확인해 주세요');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleModalSave({
|
|
|
|
handleModalSave({
|
|
|
|
msuTeam,
|
|
|
|
msuTeam,
|
|
|
|
msSdate,
|
|
|
|
msSdate,
|
|
|
|
msStartsi,
|
|
|
|
msStartsi: getHours(new Date(msStartsi)),
|
|
|
|
msEdate,
|
|
|
|
msEdate,
|
|
|
|
msChasu,
|
|
|
|
msChasu,
|
|
|
|
msCdate,
|
|
|
|
msCdate,
|
|
|
|
msClosesi
|
|
|
|
msClosesi: getHours(new Date(msClosesi))
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -70,7 +91,7 @@ const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
mask="__"
|
|
|
|
mask="__"
|
|
|
|
onChange={(newValue) => {
|
|
|
|
onChange={(newValue) => {
|
|
|
|
// setMsStartsi(format(newValue, 'HH'));
|
|
|
|
// setMsStartsi(format(newValue, 'HH'));
|
|
|
|
setMsStartsi(getHours(newValue));
|
|
|
|
setMsStartsi(newValue);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</LocalizationProvider>
|
|
|
|
</LocalizationProvider>
|
|
|
@ -93,8 +114,11 @@ const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<Grid item xs={12} sm={2}>
|
|
|
|
<Grid item xs={12} sm={2}>
|
|
|
|
<FormControl fullWidth>
|
|
|
|
<FormControl fullWidth>
|
|
|
|
<InputLabel required>팀</InputLabel>
|
|
|
|
<InputLabel required>심의팀</InputLabel>
|
|
|
|
<Select defaultValue={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
|
|
|
|
<Select defaultValue={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
|
|
|
|
|
|
|
|
<MenuItem key={0} value=" ">
|
|
|
|
|
|
|
|
팀선택
|
|
|
|
|
|
|
|
</MenuItem>
|
|
|
|
{combo.teams.map((team) => (
|
|
|
|
{combo.teams.map((team) => (
|
|
|
|
<MenuItem key={team.code} value={team.code}>
|
|
|
|
<MenuItem key={team.code} value={team.code}>
|
|
|
|
{team.value}
|
|
|
|
{team.value}
|
|
|
@ -109,10 +133,10 @@ const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
required
|
|
|
|
required
|
|
|
|
id="msChasu"
|
|
|
|
id="msChasu"
|
|
|
|
name="msChasu"
|
|
|
|
name="msChasu"
|
|
|
|
label="차수"
|
|
|
|
label="심의차수"
|
|
|
|
format="######"
|
|
|
|
format="######"
|
|
|
|
fullWidth
|
|
|
|
fullWidth
|
|
|
|
value={msChasu}
|
|
|
|
value={msChasu || ''}
|
|
|
|
onValueChange={(values) => setMsChasu(values.value)}
|
|
|
|
onValueChange={(values) => setMsChasu(values.value)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
@ -130,14 +154,6 @@ const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</LocalizationProvider>
|
|
|
|
</LocalizationProvider>
|
|
|
|
|
|
|
|
|
|
|
|
{/* <TextField */}
|
|
|
|
|
|
|
|
{/* type="date" */}
|
|
|
|
|
|
|
|
{/* value={msCdate} */}
|
|
|
|
|
|
|
|
{/* defaultValue={msCdate} */}
|
|
|
|
|
|
|
|
{/* InputLabelProps={{ shrink: true }} */}
|
|
|
|
|
|
|
|
{/* onChange={(e) => setMsCdate(format(e.target.value), 'yyyy-MM-dd')} */}
|
|
|
|
|
|
|
|
{/* /> */}
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<Grid item xs={12} sm={4}>
|
|
|
|
<Grid item xs={12} sm={4}>
|
|
|
|
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
|
|
|
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
|
|
@ -151,7 +167,8 @@ const JudgeTargetSaveForm = ({ handleModalSave }) => {
|
|
|
|
inputFormat="HH"
|
|
|
|
inputFormat="HH"
|
|
|
|
mask="__"
|
|
|
|
mask="__"
|
|
|
|
onChange={(newValue) => {
|
|
|
|
onChange={(newValue) => {
|
|
|
|
setMsClosesi(getHours(newValue));
|
|
|
|
console.log(newValue);
|
|
|
|
|
|
|
|
setMsClosesi(newValue);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</LocalizationProvider>
|
|
|
|
</LocalizationProvider>
|
|
|
|