From 5f003b3a4b709e72de00fe0ed5587f7d91d65096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Mar 2020 23:46:03 +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 --- .../modules/courses/Resource/Fileslistitem.js | 4 +- .../src/modules/courses/Resource/index.js | 4 +- .../courses/coursesPublic/sendResources.js | 38 ++++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) 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)=>{