|
|
|
@ -293,6 +293,12 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
code_review:result.data.code_review
|
|
|
|
|
})
|
|
|
|
|
this.props.Getdataback(result,result.data);
|
|
|
|
|
if(this.props.isAdmin()!== undefined){
|
|
|
|
|
if(this.props.isAdmin()===true){
|
|
|
|
|
this.editSettings(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -1738,7 +1744,6 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
flagPageEditstwo:releasetime,
|
|
|
|
|
flagPageEditsthrees:deadline,
|
|
|
|
|
flagPageEditsfor:endtime,
|
|
|
|
|
|
|
|
|
|
unifiedsetting:this.state.unifiedsetting,
|
|
|
|
|
});
|
|
|
|
|
if(this.state.work_efficiencys===true){
|
|
|
|
@ -1784,7 +1789,121 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
//一进来就是老师要用的编辑页面
|
|
|
|
|
editSettings=(datas)=>{
|
|
|
|
|
console.log("编辑页面");
|
|
|
|
|
console.log(datas);
|
|
|
|
|
try {
|
|
|
|
|
if (datas.data.is_end === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsType: true,
|
|
|
|
|
modalsTopval: "课堂已结束不能再修改!",
|
|
|
|
|
loadtype: true,
|
|
|
|
|
modalSave: this.cancelBox
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
var releasetime =true;
|
|
|
|
|
var deadline = true;
|
|
|
|
|
var endtime =true;
|
|
|
|
|
var whethertopays =true;
|
|
|
|
|
//发布时间
|
|
|
|
|
|
|
|
|
|
if(moment(datas.data.publish_time,"YYYY-MM-DD HH:mm")<=moment()){
|
|
|
|
|
releasetime=false;
|
|
|
|
|
}
|
|
|
|
|
//截止时间
|
|
|
|
|
if(moment(datas.data.end_time,"YYYY-MM-DD HH:mm")<=moment()){
|
|
|
|
|
deadline=false;
|
|
|
|
|
}
|
|
|
|
|
//结束时间
|
|
|
|
|
if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){
|
|
|
|
|
endtime=false;
|
|
|
|
|
}
|
|
|
|
|
if(datas.data.allowreplenishment === false){
|
|
|
|
|
whethertopays=false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if(datas.data&& datas.data.homework_status[0]==="未发布"){
|
|
|
|
|
this.setState({
|
|
|
|
|
flagPageEditsbox:true,
|
|
|
|
|
flagPageEdit: true,
|
|
|
|
|
whethertopay:whethertopays,
|
|
|
|
|
flagPageEditstwo:releasetime,
|
|
|
|
|
flagPageEditsthrees:deadline,
|
|
|
|
|
flagPageEditsfor:endtime,
|
|
|
|
|
completionefficiencyscore:true,
|
|
|
|
|
work_efficiencys:true,
|
|
|
|
|
unifiedsetting:datas.data.unifiedsetting,
|
|
|
|
|
latedeductiontwo:20,
|
|
|
|
|
});
|
|
|
|
|
//均分比例
|
|
|
|
|
try {
|
|
|
|
|
if(datas.data.proportion==="均分比例"){
|
|
|
|
|
this.Equalproportion(20);
|
|
|
|
|
|
|
|
|
|
}else if(datas.data.proportion==="经验值比例"){
|
|
|
|
|
this.Empiricalvalueratio(20);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
this.setState({
|
|
|
|
|
flagPageEditsbox:true,
|
|
|
|
|
flagPageEdit: true,
|
|
|
|
|
whethertopay:whethertopays,
|
|
|
|
|
flagPageEditstwo:releasetime,
|
|
|
|
|
flagPageEditsthrees:deadline,
|
|
|
|
|
flagPageEditsfor:endtime,
|
|
|
|
|
unifiedsetting:datas.data.unifiedsetting,
|
|
|
|
|
});
|
|
|
|
|
if(datas.data.work_efficiencys===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
completionefficiencyscore:true,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
completionefficiencyscore:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
this.setState({
|
|
|
|
|
flagPageEditsbox:true,
|
|
|
|
|
flagPageEdit: true,
|
|
|
|
|
whethertopay:whethertopays,
|
|
|
|
|
flagPageEditstwo:releasetime,
|
|
|
|
|
flagPageEditsthrees:deadline,
|
|
|
|
|
flagPageEditsfor:endtime,
|
|
|
|
|
unifiedsetting:datas.data.unifiedsetting,
|
|
|
|
|
});
|
|
|
|
|
if(datas.data.work_efficiencys===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
completionefficiencyscore:true,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
completionefficiencyscore:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(datas.data.proportion === "自定义分值"){
|
|
|
|
|
this.setState({
|
|
|
|
|
boolUnitetwoname:"自定义分值",
|
|
|
|
|
boolUnitetwo: false,
|
|
|
|
|
flagPageEdits:true,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//取消编辑
|
|
|
|
|
cancelEdit = () => {
|
|
|
|
@ -1919,8 +2038,8 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
|
|
|
|
|
const dataformat = 'YYYY-MM-DD HH:mm';
|
|
|
|
|
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
|
|
|
|
|
console.log(publish_timebool);
|
|
|
|
|
console.log(!flagPageEditstwo);
|
|
|
|
|
// console.log(publish_timebool);
|
|
|
|
|
// console.log(!flagPageEditstwo);
|
|
|
|
|
const radioStyle = {
|
|
|
|
|
display: 'block',
|
|
|
|
|
height: '30px',
|
|
|
|
|