hjm 5 years ago
commit 7ba701d733

@ -40,8 +40,11 @@ class Fileslistitem extends Component{
let link = document.createElement('a');
// link.href = window.URL.createObjectURL(new Blob([result.data.url]));
link.href = result.data.url;
// link.download = encodeURI(result.data.title);
let filesname=encodeURIComponent(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");
evt.initEvent("click", false, false);

@ -687,9 +687,9 @@ class Fileslists extends Component{
<div className="studentList_operation_ul">
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>:""}
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSend}>发送</a></li>:""}
{this.props.isAdmin()?
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onOpen}>立即发布</a></li>
:""}
{/*{this.props.isAdmin()?*/}
{/*<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>*/}
{/*:""}*/}
{this.props.isAdmin()?course_is_public===true?
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onOpen}>设为公开</a></li>
:"":""}

@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{
max_nums: result.data.max_num,
task_type: result.data.task_type,
baseonproject: result.data.base_on_project,
publish_time:result.data.publish_time===null?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
publish_time:result.data.publish_time===null||result.data.publish_time=== ""?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null||result.data.end_time=== ""?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
allowlate: result.data.allow_late,
latepenalty: result.data.late_penalty,
latetime:result.data.late_time===null?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
latetime:result.data.late_time===null||result.data.late_time=== ""?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
crosscomment: result.data.cross_comment,
taskid: result.data.id,
taskname: result.data.task_name,
@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{
hasproject: result.data.has_project,
hascommit: result.data.has_commit,
assigngroups: assigngroups,
commenttime:result.data.comment_time===null?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
commenttime:result.data.comment_time===null||result.data.comment_time=== ""?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
task_status: result.data.task_status
})
}
@ -288,12 +288,13 @@ class GraduationTaskssettingapp extends Component{
allowlatefun=(e)=>{
let {end_time}=this.state;
debugger
if(e.target.value===true||e.target.value===1){
this.setState({
latepenalty:5,
allowlate:e.target.value,
latetime:end_time===null?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
latetime:end_time===null||end_time === ""?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
})
}else{
this.setState({
@ -341,7 +342,7 @@ class GraduationTaskssettingapp extends Component{
}
funcrosscomment=(e)=>{
debugger
let {latetime,end_time,allowlate}=this.state;
let newtime;
if(e.target.checked===true){
@ -700,10 +701,10 @@ class GraduationTaskssettingapp extends Component{
min_num: this.state.minnum,
max_num: this.state.maxnum,
base_on_project:baseonproject===true?1:0,
publish_time:this.state.publish_time===null?"":this.state.publish_time,
end_time: this.state.end_time===null?this.props.getNowFormatDates(2,1):this.state.end_time,
publish_time:this.state.publish_time===null||this.state.publish_time=== ""?"":this.state.publish_time,
end_time: this.state.end_time===null||this.state.end_time=== ""?this.props.getNowFormatDates(2,1):this.state.end_time,
allow_late:allowlate===true||allowlate===1?1:undefined,
late_time: this.state.latetime===null?this.props.getNowFormatDates(3,1):this.state.latetime,
late_time: this.state.latetime===null||this.state.latetime=== ""?this.props.getNowFormatDates(3,1):this.state.latetime,
late_penalty: latepenalty,
cross_comment: crosscomment===true?1:undefined,
comment_status: crosscomment===true?this.state.commentstatus===0?2:this.state.commentstatus===1?2:this.state.commentstatus:undefined,
@ -1273,7 +1274,7 @@ class GraduationTaskssettingapp extends Component{
placeholder="请选择发布时间"
id={"endTime"}
width={"210px"}
value={commenttime===null||commenttime===""?"":moment(commenttime, dateFormat)}
value={commenttime===null||commenttime=== ""?"":moment(commenttime, dateFormat)}
disabledTime={disabledDateTime}
onChange={this.onChangeTimecommenttime}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}

Loading…
Cancel
Save