dev_forum
杨树明 5 years ago
parent da474ff992
commit ddad5986dc

@ -38,14 +38,10 @@ class Fileslistitem extends Component{
if(result.data.attachment_histories.length===0){ if(result.data.attachment_histories.length===0){
let link = document.createElement('a'); let link = document.createElement('a');
// link.href = window.URL.createObjectURL(new Blob([result.data.url])); document.body.appendChild(link);
link.href = result.data.url; link.href = result.data.url;
let filesname=encodeURIComponent(result.data.title) link.download = result.data.title;
console.log(result.data.title)
link.download = decodeURIComponent(filesname)
//兼容火狐浏览器 //兼容火狐浏览器
console.log(result.data.title)
document.body.appendChild(link);
let evt = document.createEvent("MouseEvents"); let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false); evt.initEvent("click", false, false);
link.dispatchEvent(evt); link.dispatchEvent(evt);

@ -360,7 +360,7 @@ class ShixunhomeWorkItem extends Component{
</style> </style>
{this.props.isAdmin?<div className={this.props.isClassManagement?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}> {this.props.isAdmin?<div className={this.props.isClassManagement?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a> <a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a>
{this.props.isClassManagement?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""} {this.props.isAdminOrTeacher()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn> <WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn>
</div>:""} </div>:""}

Loading…
Cancel
Save