hjm 5 years ago
commit 7ba701d733

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

@ -687,9 +687,9 @@ class Fileslists extends Component{
<div className="studentList_operation_ul"> <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.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.onSend}>发送</a></li>:""}
{this.props.isAdmin()? {/*{this.props.isAdmin()?*/}
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onOpen}>立即发布</a></li> {/*<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? {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> <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, max_nums: result.data.max_num,
task_type: result.data.task_type, task_type: result.data.task_type,
baseonproject: result.data.base_on_project, 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"), 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?"":moment(moment(handleDateString(result.data.end_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, allowlate: result.data.allow_late,
latepenalty: result.data.late_penalty, 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, crosscomment: result.data.cross_comment,
taskid: result.data.id, taskid: result.data.id,
taskname: result.data.task_name, taskname: result.data.task_name,
@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{
hasproject: result.data.has_project, hasproject: result.data.has_project,
hascommit: result.data.has_commit, hascommit: result.data.has_commit,
assigngroups: assigngroups, 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 task_status: result.data.task_status
}) })
} }
@ -288,12 +288,13 @@ class GraduationTaskssettingapp extends Component{
allowlatefun=(e)=>{ allowlatefun=(e)=>{
let {end_time}=this.state; let {end_time}=this.state;
debugger
if(e.target.value===true||e.target.value===1){ if(e.target.value===true||e.target.value===1){
this.setState({ this.setState({
latepenalty:5, latepenalty:5,
allowlate:e.target.value, 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{ }else{
this.setState({ this.setState({
@ -341,7 +342,7 @@ class GraduationTaskssettingapp extends Component{
} }
funcrosscomment=(e)=>{ funcrosscomment=(e)=>{
debugger
let {latetime,end_time,allowlate}=this.state; let {latetime,end_time,allowlate}=this.state;
let newtime; let newtime;
if(e.target.checked===true){ if(e.target.checked===true){
@ -700,10 +701,10 @@ class GraduationTaskssettingapp extends Component{
min_num: this.state.minnum, min_num: this.state.minnum,
max_num: this.state.maxnum, max_num: this.state.maxnum,
base_on_project:baseonproject===true?1:0, base_on_project:baseonproject===true?1:0,
publish_time:this.state.publish_time===null?"":this.state.publish_time, publish_time:this.state.publish_time===null||this.state.publish_time=== ""?"":this.state.publish_time,
end_time: this.state.end_time===null?this.props.getNowFormatDates(2,1):this.state.end_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, 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, late_penalty: latepenalty,
cross_comment: crosscomment===true?1:undefined, cross_comment: crosscomment===true?1:undefined,
comment_status: crosscomment===true?this.state.commentstatus===0?2:this.state.commentstatus===1?2:this.state.commentstatus: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="请选择发布时间" placeholder="请选择发布时间"
id={"endTime"} id={"endTime"}
width={"210px"} width={"210px"}
value={commenttime===null||commenttime===""?"":moment(commenttime, dateFormat)} value={commenttime===null||commenttime=== ""?"":moment(commenttime, dateFormat)}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
onChange={this.onChangeTimecommenttime} onChange={this.onChangeTimecommenttime}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}

Loading…
Cancel
Save