dev_forum
杨树明 5 years ago
parent b3cdc99433
commit 38fd3e6db2

@ -26,8 +26,8 @@ class Fileslistitem extends Component{
})
this.props.Settingtypes(discussMessage.id)
}
showfiles=()=>{
debugger
showfiles=(value)=>{
let {discussMessage,coursesId}=this.props
let file_id=discussMessage.id
let url="/files/"+file_id+"/histories.json"
@ -42,10 +42,8 @@ class Fileslistitem extends Component{
let link = document.createElement('a');
document.body.appendChild(link);
link.href = result.data.url;
let filesname=escape(result.data.title)
debugger
console.log(filesname)
link.download = unescape(filesname);
link.download = value;
//兼容火狐浏览器
let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
@ -208,13 +206,13 @@ class Fileslistitem extends Component{
{
this.props.isAdmin ? <a
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={this.showfiles}
onClick={()=>this.showfiles(discussMessage.title)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isStudent? <a
onClick={this.showfiles}
onClick={()=>this.showfiles(discussMessage.title)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> :""
}

Loading…
Cancel
Save