diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 90fb3939b..e0e26577e 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -137,7 +137,7 @@ class Trainingjobsetting extends Component { componentDidMount() { console.log("Trainingjobsetting"); console.log("componentDidMount"); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(true); let query = this.props.location.pathname; const type = query.split('/'); this.setState({ @@ -165,7 +165,7 @@ class Trainingjobsetting extends Component { // } // 获取数据地方 - getTrainingjobsetting = () => { + getTrainingjobsetting = (bool) => { // console.log("getTrainingjobsetting") var homeworkid = this.props.match.params.homeworkid; // console.log(homeworkid) @@ -293,6 +293,14 @@ class Trainingjobsetting extends Component { code_review:result.data.code_review }) this.props.Getdataback(result,result.data); + + if(bool===true){ + if(this.props.isAdmin() !== undefined){ + if(this.props.isAdmin() === true){ + this.editSettings(result); + } + } + } } }) @@ -1592,7 +1600,7 @@ class Trainingjobsetting extends Component { description:result.data.message }); this.homeworkhide(); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); } } @@ -1623,7 +1631,7 @@ class Trainingjobsetting extends Component { // message:"提示", // description:response.data.message // }); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); this.homeworkhide() } }) @@ -1814,7 +1822,7 @@ class Trainingjobsetting extends Component { if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){ endtime=false; } - if(datas.data.allowreplenishment === false){ + if(datas.data.allow_late === false){ whethertopays=false; } @@ -1833,11 +1841,12 @@ class Trainingjobsetting extends Component { latedeductiontwo:20, }); //均分比例 + // result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? try { - if(datas.data.proportion==="均分比例"){ + if(datas.data.shixun_evaluation === 0){ this.Equalproportion(20); - }else if(datas.data.proportion==="经验值比例"){ + }else if(datas.data.shixun_evaluation === 1){ this.Empiricalvalueratio(20); } @@ -1886,7 +1895,7 @@ class Trainingjobsetting extends Component { } } - if(datas.data.proportion === "自定义分值"){ + if(datas.data.shixun_evaluation === 2){ this.setState({ boolUnitetwoname:"自定义分值", boolUnitetwo: false, @@ -1920,7 +1929,7 @@ class Trainingjobsetting extends Component { unit_e_tip: "", }) this.refs.targetElementTrainingjobsetting.scrollIntoView(); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); } rulesCheckInfo=(rules)=>{