dev_forum
杨树林 6 years ago
parent 2b3b1ac0ad
commit b6d4d824c5

@ -597,7 +597,7 @@ class Listofworks extends Component {
componentDidMount() { componentDidMount() {
console.log("Listofworks"); console.log("Listofworks");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.onRef(this); this.props.triggerRef(this)
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid) // console.log(homeworkid)
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);

@ -317,6 +317,7 @@ class Listofworksstudentone extends Component {
componentDidMount() { componentDidMount() {
console.log("Listofworksstudentone"); console.log("Listofworksstudentone");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
this.Getalistofworks(homeworkid); this.Getalistofworks(homeworkid);
let query = this.props.location.pathname; let query = this.props.location.pathname;

@ -81,8 +81,8 @@ class ShixunHomeworkPage extends Component {
} }
confirmysl(url) { confirmysl(child,url) {
this.refs.DownloadMessage.confirmysl(url); child.confirmysl(url);
} }
onRef = (ref) => { onRef = (ref) => {
@ -91,33 +91,40 @@ class ShixunHomeworkPage extends Component {
this.state.child= ref this.state.child= ref
} }
homeworkendss(){ homeworkendss(child){
// console.log(this.contentMdRef.current); // console.log(child);
// // console.log(this.refs.childModel); // // console.log(this.refs.childModel);
// console.log(this.state.child); // console.log(child);
child.homeworkends();
// .homeworkends(); //
} }
homeworkstarts(){ homeworkstarts(child){
// console.log(this.contentMdRef.current); // console.log(this.contentMdRef.current);
// console.log(this.state.child); // console.log(this.state.child);
child.homeworkstart();
// .homeworkstart(); // .homeworkstart();
} }
workshowmodels(){ workshowmodels(child){
// console.log(this.contentMdRef.current) // console.log(this.contentMdRef.current)
// console.log(this.state.child); // console.log(this.state.child);
// console.log(this.child);
child.workshowmodel();
// .workshowmodel(); // .workshowmodel();
} }
bindRef = ref => { this.child = ref }
///////////////教师截止 ///////////////教师截止
render() { render() {
let {tab, teacherdata, jobsettingsdata} = this.state; let {tab, teacherdata, jobsettingsdata} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
// console.log("126");
// console.log(this.child);/
return ( return (
<div className="newMain clearfix "> <div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px"}}> <div className={"educontent mb20"} style={{width: "1200px"}}>
@ -208,27 +215,27 @@ class ShixunHomeworkPage extends Component {
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}> <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a <li><a
onClick={() => this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a> onClick={(child) => this.confirmysl(this.child,`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a>
</li> </li>
<li><a <li><a
onClick={() => this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a> onClick={(child) => this.confirmysl(this.child,`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
</li> </li>
</ul> </ul>
</li> : ""} </li> : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.end_immediately === true ? teacherdata && teacherdata.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkendss}>立即截止</a> <a className="fr color-blue font-16" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a>
: "" : ""
: ""} : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.publish_immediately === true ? teacherdata && teacherdata.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstarts}>立即发布</a> <a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
: "" : ""
: ""} : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.code_review === true ? teacherdata && teacherdata.code_review === true ?
<a className="fr color-blue font-16" onClick={this.workshowmodels}>代码查重</a> <a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""} : "" : ""}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/shixun_work_report`}> to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/shixun_work_report`}>
@ -252,21 +259,21 @@ class ShixunHomeworkPage extends Component {
{ {
// 教师列表 // 教师列表
parseInt(tab) === 0 ? (isAdmin === true ? parseInt(tab) === 0 ? (isAdmin === true ?
<Listofworks {...this.props} {...this.state} onRef={this.onRef} <Listofworks triggerRef={this.bindRef} {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks>
: :
<Listofworksstudentone ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}} <Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>) Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>)
: :
parseInt(tab) === 1 ? parseInt(tab) === 1 ?
<Workquestionandanswer ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}} <Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>
: :
parseInt(tab) === 2 ? parseInt(tab) === 2 ?
<ShixunStudentWork ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}} <ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>
: :
<Trainingjobsetting ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}} <Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
} }
</div> </div>

@ -76,6 +76,7 @@ class ShixunStudentWork extends Component {
componentDidMount() { componentDidMount() {
console.log("ShixunStudentWork"); console.log("ShixunStudentWork");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
this.getupdata(); this.getupdata();
this.getTrainingjobsetting(); this.getTrainingjobsetting();
} }

@ -128,6 +128,7 @@ class Trainingjobsetting extends Component {
componentDidMount() { componentDidMount() {
console.log("Trainingjobsetting"); console.log("Trainingjobsetting");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
this.getTrainingjobsetting(); this.getTrainingjobsetting();
let query = this.props.location.pathname; let query = this.props.location.pathname;
const type = query.split('/'); const type = query.split('/');

@ -84,6 +84,7 @@ class Workquestionandanswer extends Component {
componentDidMount() { componentDidMount() {
console.log("Workquestionandanswer"); console.log("Workquestionandanswer");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid) // console.log(homeworkid)
this.Gettitleinformation(homeworkid) this.Gettitleinformation(homeworkid)

Loading…
Cancel
Save