From b6d4d824c514cfc9bfaa698aeef83b0d86d3693d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 17 Jul 2019 13:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworks.js | 2 +- .../shixunHomework/Listofworksstudentone.js | 1 + .../shixunHomework/ShixunHomeworkPage.js | 45 +++++++++++-------- .../shixunHomework/ShixunStudentWork.js | 1 + .../shixunHomework/Trainingjobsetting.js | 1 + .../shixunHomework/Workquestionandanswer.js | 1 + 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index de4679256..1a721f8b3 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -597,7 +597,7 @@ class Listofworks extends Component { componentDidMount() { console.log("Listofworks"); console.log("componentDidMount"); - this.props.onRef(this); + this.props.triggerRef(this) var homeworkid = this.props.match.params.homeworkid; // console.log(homeworkid) // this.Gettitleinformation(homeworkid); diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8192e6a17..6d2f5c9c9 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -317,6 +317,7 @@ class Listofworksstudentone extends Component { componentDidMount() { console.log("Listofworksstudentone"); console.log("componentDidMount"); + this.props.triggerRef(this); var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); let query = this.props.location.pathname; diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 242e99db1..baf1d6232 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -81,8 +81,8 @@ class ShixunHomeworkPage extends Component { } - confirmysl(url) { - this.refs.DownloadMessage.confirmysl(url); + confirmysl(child,url) { + child.confirmysl(url); } onRef = (ref) => { @@ -91,33 +91,40 @@ class ShixunHomeworkPage extends Component { this.state.child= ref } - homeworkendss(){ - // console.log(this.contentMdRef.current); + homeworkendss(child){ + // console.log(child); // // console.log(this.refs.childModel); - // console.log(this.state.child); - - // .homeworkends(); + // console.log(child); + child.homeworkends(); + // } - homeworkstarts(){ + homeworkstarts(child){ // console.log(this.contentMdRef.current); // console.log(this.state.child); + child.homeworkstart(); + // .homeworkstart(); } - workshowmodels(){ + workshowmodels(child){ // console.log(this.contentMdRef.current) // console.log(this.state.child); + // console.log(this.child); + child.workshowmodel(); // .workshowmodel(); } + bindRef = ref => { this.child = ref } ///////////////教师截止 render() { let {tab, teacherdata, jobsettingsdata} = this.state; const isAdmin = this.props.isAdmin(); + // console.log("126"); + // console.log(this.child);/ return (
@@ -208,27 +215,27 @@ class ShixunHomeworkPage extends Component { 导出 : ""} {this.props.isAdmin() ? teacherdata && teacherdata.end_immediately === true ? - 立即截止 + this.homeworkendss(this.child)}>立即截止 : "" : ""} {this.props.isAdmin() ? teacherdata && teacherdata.publish_immediately === true ? - 立即发布 + this.homeworkstarts(this.child)}>立即发布 : "" : ""} {this.props.isAdmin() ? teacherdata && teacherdata.code_review === true ? - 代码查重 + this.workshowmodels(this.child)}>代码查重 : "" : ""} {this.state.view_report === true ? @@ -252,21 +259,21 @@ class ShixunHomeworkPage extends Component { { // 教师列表 parseInt(tab) === 0 ? (isAdmin === true ? - this.Getdataback(jobsettingsdata, teacherdata)}> : - { this.child = ref}} + this.Getdataback(jobsettingsdata, teacherdata)}>) : parseInt(tab) === 1 ? - { this.child = ref}} + this.Getdataback(jobsettingsdata, teacherdata)}> : parseInt(tab) === 2 ? - { this.child = ref}} + this.Getdataback(jobsettingsdata, teacherdata)}> : - { this.child = ref}} + this.Getdataback(jobsettingsdata, teacherdata)}> }
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 17e51258f..37ea4d1c3 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -76,6 +76,7 @@ class ShixunStudentWork extends Component { componentDidMount() { console.log("ShixunStudentWork"); console.log("componentDidMount"); + this.props.triggerRef(this); this.getupdata(); this.getTrainingjobsetting(); } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index ae1058d8a..411855491 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -128,6 +128,7 @@ class Trainingjobsetting extends Component { componentDidMount() { console.log("Trainingjobsetting"); console.log("componentDidMount"); + this.props.triggerRef(this); this.getTrainingjobsetting(); let query = this.props.location.pathname; const type = query.split('/'); diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 52a214b7e..39a963023 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -84,6 +84,7 @@ class Workquestionandanswer extends Component { componentDidMount() { console.log("Workquestionandanswer"); console.log("componentDidMount"); + this.props.triggerRef(this); var homeworkid = this.props.match.params.homeworkid; // console.log(homeworkid) this.Gettitleinformation(homeworkid)