From a9ff5259fc9cb7598569d4dad99565d5223a4b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 8 Oct 2019 12:39:21 +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 --- .../courses/exercise/ExerciseListItem.js | 2 +- .../graduation/tasks/GraduateTaskItem.js | 2 +- .../src/modules/courses/poll/PollListItem.js | 2 +- .../shixunHomework/ShixunStudentWork.js | 3 -- .../shixunHomework/Workquestionandanswer.js | 1 - .../courses/shixunHomework/shixunHomework.js | 28 ++++++++++++------- .../react/src/modules/user/usersInfo/Infos.js | 18 +++++++----- .../modules/user/usersInfo/InfosProject.js | 24 ++++++++++++---- 8 files changed, 51 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 07606bd58..28ead276c 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -213,7 +213,7 @@ class ExerciseListItem extends Component{ IsStudent &&
{item.current_status ===0&&item.exercise_status>1?
  • 继续答题
  • : - item.current_status ===1&&item.exercise_status>1?
  • 查看答题
  • : + item.current_status ===1&&item.exercise_status>1?
  • 查看答题
  • : item.current_status ===2&&item.exercise_status>1?
  • this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题
  • :""}
    } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 2b27571e2..427ef30d4 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -346,7 +346,7 @@ class GraduateTaskItem extends Component{ {item==="查看作品"? - 查看作品 + 查看作品 :""} diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js index 1e453d180..9f13e5465 100644 --- a/public/react/src/modules/courses/poll/PollListItem.js +++ b/public/react/src/modules/courses/poll/PollListItem.js @@ -98,7 +98,7 @@ class PollListItem extends Component{ } { - isStudent ? + isStudent ? { item.current_status == 0 && "继续答题" } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index fb8721f9d..3caa63ac3 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -448,9 +448,6 @@ class ShixunStudentWork extends Component { axios.get(url).then((response) => { if(response.status===200){ - this.setState({ - - }) this.setState({ modalname:"立即截止", modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1, diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 4ed45790d..ae8845bf5 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -189,7 +189,6 @@ class Workquestionandanswer extends Component { axios.get(url).then((response) => { if (response.status === 200) { - this.setState({}) this.setState({ modalname: "立即截止", modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 44a8e003b..221a8e377 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -44,6 +44,7 @@ class ShixunHomework extends Component{ page:1, Coursename:"", order:"", + orders:"8", shixunmodal:false, shixunmodallist:undefined, hometypepvisible:false, @@ -90,7 +91,8 @@ class ShixunHomework extends Component{ if(this.props.match.params.main_id){ this.setState({ isSpin:true, - checkedtype:false + checkedtype:false, + orders:"8" }) this.seactall(); if(this.props.isAdmin()===true){ @@ -100,7 +102,8 @@ class ShixunHomework extends Component{ }else if(this.props.match.params.category_id){ this.setState({ isSpin:true, - checkedtype:false + checkedtype:false, + orders:"8" }) this.seactall(parseInt(this.props.match.params.category_id)) if(this.props.isAdmin()===true){ @@ -139,7 +142,8 @@ class ShixunHomework extends Component{ if(prevProps.match.params.main_id != this.props.match.params.main_id){ if(this.props.match.params.main_id!=undefined){ this.setState({ - checkedtype:false + checkedtype:false, + orders:"8" }) this.seactall(); } @@ -147,7 +151,8 @@ class ShixunHomework extends Component{ if(prevProps.match.params.category_id != this.props.match.params.category_id){ if(this.props.match.params.category_id!=undefined){ this.setState({ - checkedtype:false + checkedtype:false, + orders:"8" }) this.seactall(parseInt(this.props.match.params.category_id)) } @@ -162,8 +167,8 @@ class ShixunHomework extends Component{ let category_id=this.props.match.params.category_id let url="/courses/"+coursesId+"/homework_commons.json?type=4"; let neworder=order; - if(order==="null"){ - neworder="" + if(order==="8"){ + neworder=undefined } axios.get(url, { @@ -600,14 +605,16 @@ class ShixunHomework extends Component{ let {Coursename,page}=this.state; this.setState({ order: e.key, + orders:e.key, checkBoxValues:[], checkedtype:false, isSpin:true }); let newkey=e.key; - if(newkey==="null"){ - newkey="" + if(newkey==="8"){ + newkey=undefined } + this.homeworkupdatalist(Coursename,page,newkey); } @@ -955,6 +962,7 @@ class ShixunHomework extends Component{ course_modules, shixunpath, order, + orders, NewShixunModelType, }=this.state; @@ -1084,8 +1092,8 @@ class ShixunHomework extends Component{

    - - 全部 + + 全部 {this.props.isAdmin()?未发布:""} 提交中 补交中 diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 3a2632061..e872d25d1 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -102,13 +102,17 @@ class Infos extends Component{ let url =`/users/${user_login}/homepage_info.json`; axios.get(url).then((result)=>{ if(result){ - this.setState({ - data:result.data, - followed:result.data.followed, - sign:result.data.brief_introduction, - id:result.data.id, - next_gold:result.data.tomorrow_attendance_gold - }) + if (result.data.status === 403||result.data.status === 401||result.data.status === 500||result.data.status === 404) { + + }else{ + this.setState({ + data:result.data, + followed:result.data.followed, + sign:result.data.brief_introduction, + id:result.data.id, + next_gold:result.data.tomorrow_attendance_gold + }) + } } }).catch((error)=>{ console.log(error); diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index 030af5fb6..79a985d1d 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -40,11 +40,19 @@ class InfosProject extends Component{ per_page:this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ - this.setState({ - totalCount:result.data.count, - data:result.data, - isSpin:false - }) + if (result.data.status === 403||result.data.status === 401||result.data.status === 500||result.data.status === 404) { + this.setState({ + isSpin:false, + totalCount:0 + }) + }else{ + this.setState({ + totalCount:result.data.count, + data:result.data, + isSpin:false + }) + } + } }).catch((error)=>{ console.log(error); @@ -99,6 +107,8 @@ class InfosProject extends Component{ } = this.state; let isStudent = this.props.isStudent(); let is_current=this.props.is_current; + + console.log(data) return(
    @@ -127,7 +137,11 @@ class InfosProject extends Component{ } { (!data || (data && data.projects.length==0)) && category && + } + { + data===undefined||data.length===0?:"" + } { data && data.projects && data.projects.map((item,key)=>{ return(