From 3f2cdc3ecef7cfa6d724951749fdeab8e3726aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 17 Aug 2019 14:39:27 +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 | 69 ++++++++++---------
1 file changed, 37 insertions(+), 32 deletions(-)
diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index d3405ebf5..feae05740 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -27,35 +27,40 @@ class Fileslistitem extends Component{
this.props.Settingtypes(discussMessage.id)
}
- showfiles=(value)=>{
- let {discussMessage,coursesId}=this.props
- let file_id=discussMessage.id
- let url="/files/"+file_id+"/histories.json"
- axios.get(url,{
- params:{
- course_id:coursesId
- },
- }).then((result)=>{
-
- if(result.data.attachment_histories.length===0){
- // if(result.data.is_pdf===true){
- // this.props.ShowOnlinePdf(result.data.url)
- // //预览pdf
- // }else{
- //
- // }
- this.props.DownloadFileA(result.data.title,result.data.url)
- }else{
- this.setState({
- Showoldfiles:true,
- allfiles:result.data
- })
- }
-
-
- }).catch((error)=>{
- console.log(error)
- })
+ showfiles=(list)=>{
+ if(list.is_history_file===false){
+ this.props.DownloadFileA(list.title,list.url)
+ }else{
+ let {discussMessage,coursesId}=this.props
+ let file_id=discussMessage.id
+ let url="/files/"+file_id+"/histories.json"
+ axios.get(url,{
+ params:{
+ course_id:coursesId
+ },
+ }).then((result)=>{
+
+ if(result.data.attachment_histories.length===0){
+ // if(result.data.is_pdf===true){
+ // this.props.ShowOnlinePdf(result.data.url)
+ // //预览pdf
+ // }else{
+ //
+ // }
+ this.props.DownloadFileA(result.data.title,result.data.url)
+ }else{
+ this.setState({
+ Showoldfiles:true,
+ allfiles:result.data
+ })
+ }
+
+
+ }).catch((error)=>{
+ console.log(error)
+ })
+ }
+
}
closaoldfilesprops=()=>{
@@ -191,13 +196,13 @@ class Fileslistitem extends Component{
{
this.props.isAdmin ? this.showfiles(discussMessage.title)}
+ onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title} : ""
}
{
this.props.isStudent? this.showfiles(discussMessage.title)}
+ onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title} :""
}
@@ -207,7 +212,7 @@ class Fileslistitem extends Component{
discussMessage.is_lock === true ?
{discussMessage.title}
:this.showfiles(discussMessage.title)}
+ onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}:""
}