From 5b7e71d303e94df1c656c742623ac89b303b7b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 4 Jul 2019 00:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShixunStudentWork.js | 4 +-- .../shixunHomework/ShixunWorkDetails.js | 31 +++++++++++-------- .../Shixunworkdetails/ShixunWorkModal.js | 4 +-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index c7ae7292d..7188c65bd 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -94,7 +94,6 @@ class ShixunStudentWork extends Component { let url = "/homework_commons/" + homeworkid + "/code_review_results.json"; axios.get(url).then((response) => { - debugger if (response.data.status === undefined || response.data.status === 0) { if(response.data!=undefined){ if(response.data.status!=-2){ @@ -688,6 +687,7 @@ class ShixunStudentWork extends Component { 分班情况: this.groupgroup([])} className={this.state.group_infolist.length===0?"pl10 pr10 mr20 check_on":"pl10 pr10 mr20 "}> 不限 @@ -756,7 +756,7 @@ class ShixunStudentWork extends Component { dataSource={datalist} columns={columns} pagination={{ //分页 - total: data&&data.all_reviews_count, //数据总数量 + total: datalist.length===0?0:data&&data.all_reviews_count, //数据总数量 pageSize: 10, //显示几条一页 current:page, }} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js index ba3eea530..c1233ed3f 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js @@ -51,13 +51,17 @@ class ShixunWorkDetails extends Component { }) } - goback=()=>{ - window.history.go(-1) + goback=(sum)=>{ + let{data}=this.state + if(sum===1){ + window.location.href = "/courses/"+data.course_id+"/students"; + }else{ + window.history.go(-1) + } + } render() { - let{data}=this.state; - console.log(data) return ( {data===undefined? "":
@@ -65,17 +69,18 @@ class ShixunWorkDetails extends Component {

- - - {data&&data.course_name} - - + this.goback(1)} + > + {data&&data.course_name}123 + > - - + 实训作业 - - + > {data&&data.username}

diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 715ffb7e8..5a4ad673c 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -221,7 +221,7 @@ class ShixunWorkModal extends Component{ let {course_groups,group_ids,onChangetype,group_list}=this.state; // let {data}=this.props; // console.log(group_list) - // console.log(course_groups) + console.log(group_list) return(
: - group_list&&group_list.map((item,key)=>{ + group_list&&group_list.length===0?"":group_list[0]===undefined?"":group_list.map((item,key)=>{ return( item.work_count===0?"":