diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index bac740985..cb2198486 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -327,7 +327,9 @@ class Fileslistitem extends Component { { discussMessage.link && discussMessage.link ? -

外链

+

外链

: "" } diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index ffb9e0395..787865219 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -598,7 +598,8 @@ class Fileslists extends Component{ this.setState({ Addanexternallink:false, title: "", - link: "" + link: "", + discussMessageid:null, }) if(ints===1){ this.Updateresourcepage(); @@ -896,6 +897,7 @@ class Fileslists extends Component{ categoryid={category_id} setupdate={(ints,bool)=>this.sendResourcessls(ints,bool)} has_course_groups={this.state.has_course_groups} + course_id={this.props.match.params.coursesId} attachmentId={this.state.coursesecondcategoryid} />:""} {/*设置资源*/} diff --git a/public/react/src/modules/courses/coursesPublic/sendResources.js b/public/react/src/modules/courses/coursesPublic/sendResources.js index d7a3a2b98..75726a51f 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResources.js +++ b/public/react/src/modules/courses/coursesPublic/sendResources.js @@ -62,7 +62,7 @@ class sendResources extends Component{ componentDidMount() { - + let {discussMessageid} =this.props; try { this.setState({ resourcesname:this.props.title, @@ -72,9 +72,45 @@ class sendResources extends Component{ }catch (e) { } + console.log(discussMessageid); + try { + if(discussMessageid){ + this.getalldata(); + } + }catch (e) { + + } + } + getalldata=()=>{ + let {discussMessageid} =this.props; + let course_id=this.props.course_id; + let url="/files/"+discussMessageid+".json"; + axios.get(url, { + params:{ + course_id:course_id, + } + }) + .then((response) => { + if(response.status===200){ + this.setState({ + datalist:response.data, + description: response.data.description, + is_public:response.data.is_public, + datatime:response.data.publish_time, + Radiovalue:response.data.delay_publish==false?0:1, + //attachment_histories:response.data.attachment_histories + }) + + } + }) + .catch(function (error) { + console.log(error); + }); + + } //勾选实训 shixunhomeworkedit=(list)=>{