From 0b46857684b5b345e5be644f3183111e181faa22 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, 10 Mar 2020 22:24:28 +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 --- .../src/modules/courses/Resource/index.js | 63 ++++++++++--------- .../courses/busyWork/CommonWorkList.js | 6 +- .../courses/coursesDetail/CoursesLeftNav.js | 8 ++- .../courses/shixunHomework/shixunHomework.js | 42 +++++++------ 4 files changed, 68 insertions(+), 51 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index b35eb4e06..11b81c33d 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -101,36 +101,43 @@ class Fileslists extends Component{ } } componentDidUpdate = (prevProps) => { - if(prevProps.match.params.main_id != this.props.match.params.main_id){ - this.getcourse_groupslists() - this.setState({ - isSpin:true, - checkBoxValues:[], - checkAllValue:false, - }) - if(this.props.match.params.main_id!=undefined){ - this.setState({ - child:false, - sort:"desc" - }) - this.seactall(undefined,"desc"); + + if(prevProps.coursesidtype!=this.props.coursesidtype||prevProps.match.params.main_id!=this.props.match.params.main_id||prevProps.match.params.Id!=this.props.match.params.Id){ + + + if(this.props.match.params.main_id){ + this.getcourse_groupslists() + this.setState({ + isSpin:true, + checkBoxValues:[], + checkAllValue:false, + }) + if(this.props.match.params.main_id!=undefined){ + this.setState({ + child:false, + sort:"desc" + }) + this.seactall(undefined,"desc"); + } } - } - if(prevProps.match.params.Id != this.props.match.params.Id){ - this.getcourse_groupslists() - this.setState({ - isSpin:true, - checkBoxValues:[], - checkAllValue:false, - }) - if(this.props.match.params.Id!=undefined){ - this.setState({ - child:true, - sort:"desc" - }) - this.seactall(parseInt(this.props.match.params.Id),"desc") + + if(this.props.match.params.Id){ + this.getcourse_groupslists() + this.setState({ + isSpin:true, + checkBoxValues:[], + checkAllValue:false, + }) + if(this.props.match.params.Id!=undefined){ + this.setState({ + child:true, + sort:"desc" + }) + this.seactall(parseInt(this.props.match.params.Id),"desc") + } } } + } updadatalist=(id)=>{ @@ -916,7 +923,7 @@ class Fileslists extends Component{ { ` .filesnameslist{ - max-width: 200px; + max-width: 370px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 314411248..1ddba9e63 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -295,9 +295,11 @@ function buildColumns(that, student_works, studentData) { key: 'user_comment_count', dataIndex: 'user_comment_count', - render: (student_score, record) => ( + render: (user_comment_count, record) => ( - {record.user_comment_count} + + {record.user_comment_count} + ), }) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 535573d02..816129b18 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -548,7 +548,11 @@ class Coursesleftnav extends Component{ description:result.data.message }); - + if(positiontype==="shixun_homeworks"){ + this.updasaveNavmoda() + trigger('updateNavSuccess') + this.props.history.push(`/classrooms/${coursesId}/shixun_homework/${result.data.category_id}`); + } if(positiontype==="files"){ this.updasaveNavmoda() trigger('updateNavSuccess') @@ -561,7 +565,7 @@ class Coursesleftnav extends Component{ this.props.history.push(`/classrooms/${coursesId}/boards/${result.data.category_id}`); } - if(positiontype!="course_groups"){ + if(positiontype!="course_groups"&&positiontype!="shixun_homeworks"){ this.updasaveNavmoda() } diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index e32479735..a6fca8e0b 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -146,27 +146,31 @@ class ShixunHomework extends Component{ componentDidUpdate = (prevProps) => { - if(prevProps.match.params.main_id != this.props.match.params.main_id){ - if(this.props.match.params.main_id!=undefined){ - this.setState({ - checkedtype:false, - orders:"8", - order:undefined, - page:1 - }) - this.seactall(); + if(prevProps.coursesidtype!=this.props.coursesidtype||prevProps.match.params.main_id!=this.props.match.params.main_id||prevProps.match.params.category_id!=this.props.match.params.category_id) { + + if(this.props.match.params.main_id){ + if(this.props.match.params.main_id!=undefined){ + this.setState({ + checkedtype:false, + orders:"8", + order:undefined, + page:1 + }) + this.seactall(); + } } - } - if(prevProps.match.params.category_id != this.props.match.params.category_id){ - if(this.props.match.params.category_id!=undefined){ - this.setState({ - checkedtype:false, - orders:"8", - order:undefined, - page:1 - }) - this.seactall(parseInt(this.props.match.params.category_id)) + if(this.props.match.params.category_id){ + if(this.props.match.params.category_id!=undefined){ + this.setState({ + checkedtype:false, + orders:"8", + order:undefined, + page:1 + }) + this.seactall(parseInt(this.props.match.params.category_id)) + } } + } }