参数传递

This commit is contained in:
谢思 2022-08-13 14:04:26 +08:00
parent 5ba6b27722
commit 53874bba88
2 changed files with 5 additions and 3 deletions

View File

@ -99,6 +99,7 @@ const Glcc = (propsF) => {
const [lockedTaskName, setLockedTaskName] = useState(undefined);
// id
const [checkedTaskId, setCheckedTaskId] = useState(undefined);
const [studentRegId, setStudentRegId] = useState(undefined);
useEffect(()=>{
// current_user user_id
@ -110,6 +111,7 @@ const Glcc = (propsF) => {
data[item.taskId] = item.id;
item.locked && setLockedTaskName(item.taskName);
item.passStatus && setCheckedTaskId(item.taskId);
item.passStatus && setStudentRegId(item.studentRegId);
})
setApplyTaskId(data);
response.data&&setCancelCount(Number(response.data.cancelCount));
@ -217,7 +219,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/middle/submit"
render={(props) => (
<StudentSubmit current_user={current_user} history={props.history} checkedTaskId={checkedTaskId} checkTime1={checkTime1}/>
<StudentSubmit current_user={current_user} history={props.history} checkedTaskId={checkedTaskId} checkTime1={checkTime1} studentRegId={studentRegId}/>
)}
></Route>

View File

@ -9,7 +9,7 @@ import {getMediumTermExamineInfo, submitMedium} from '../api';
import './index.scss';
function StudentSubmit(props){
const {form, checkedTaskId, checkTime1} = props;
const {form, checkedTaskId, checkTime1, studentRegId} = props;
const {getFieldDecorator, validateFieldsAndScroll } = form;
const [detail, setDetail] = useState(undefined);
const [reload, setReload] = useState(undefined);
@ -42,7 +42,7 @@ function StudentSubmit(props){
codeOrPrUrl,
defenceVideoUrl,
taskId: checkedTaskId,
studentRegId: detail.studentRegId
studentRegId: studentRegId
}
console.log('params', params);
submitMedium(params).then(res=>{