From 432dea42a35cc7cb68ed8c1fd31a066cb5ef70e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 11 Jul 2019 17:19:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 32 ++-- .../courses/shixunHomework/CommitSummary.js | 6 +- .../courses/shixunHomework/Listofworks.js | 99 ++++++----- .../shixunHomework/Listofworksstudentone.js | 85 ++++------ .../shixunHomework/ShixunHomeworkPage.js | 143 ++++++++++++++++ .../shixunHomework/ShixunStudentWork.js | 72 ++------ .../shixunHomework/ShixunWorkReport.js | 2 +- .../shixunHomework/ShixunhomeWorkItem.js | 8 +- .../Shixunworkdetails/ShixunWorkModal.js | 2 +- .../shixunHomework/Trainingjobsetting.js | 159 ++++++++---------- .../shixunHomework/Workquestionandanswer.js | 74 +++----- 11 files changed, 366 insertions(+), 316 deletions(-) create mode 100644 public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index dcdb550fd..f5e62a134 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -73,6 +73,10 @@ const WrappedCoursesNewApp= Loadable({ loading: Loading, }) +const ShixunHomeworkPage =Loadable({ + loader: () => import('./shixunHomework/ShixunHomeworkPage'), + loading: Loading, +}) //实训作业 const ShixunHomework= Loadable({ loader: () => import('./shixunHomework/shixunHomework'), @@ -95,7 +99,6 @@ const Listofworks= Loadable({ // loader: () => import('./shixunHomework/Listofworksstudentone'), // loading: Loading, // }) - //实训作业列表完成的 const Studenthascompleted= Loadable({ loader: () => import('./shixunHomework/Listofworksstudentone'), @@ -720,12 +723,12 @@ class CoursesIndex extends Component{ {/*实训查重列表*/} () + (props) => () } > () + (props) => () } > @@ -744,24 +747,29 @@ class CoursesIndex extends Component{ {/*教师列表*/} () + (props) => () } > () + (props) => () + } + > + {/*实训作业page*/} + () } > - {/*实训作业设置*/} () + (props) => () } > () + (props) => () } > {/*/!*实训作品列表教师*!/*/} @@ -790,13 +798,13 @@ class CoursesIndex extends Component{ {/*实训学生作品列表已公布*/} () + (props) => () } > {/*实训学生作品列表已公布*/} () + (props) => () } > @@ -805,14 +813,14 @@ class CoursesIndex extends Component{ {/*实训作业问答主目录*/} () + (props) => () } > {/*实训作业问答子目录*/} () + (props) => () } > diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js index c2900e538..8e3097497 100644 --- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js +++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js @@ -98,7 +98,7 @@ class CommitSummary extends Component{ // console.log("提交总结接口") // console.log(JSON.stringify(result)) // message.success(result.data.message); - this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist`); + this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`); } }).catch((error) => { console.log(error) @@ -136,7 +136,7 @@ class CommitSummary extends Component{

提交总结

- 返回 + 返回
{/*educontentbox*/}
@@ -171,7 +171,7 @@ class CommitSummary extends Component{ - 取消 + 取消
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index d9abecd72..62583642c 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -596,6 +596,8 @@ class Listofworks extends Component { } componentDidMount() { + console.log("Listofworks"); + console.log("componentDidMount"); var homeworkid = this.props.match.params.homeworkid; // console.log(homeworkid) // this.Gettitleinformation(homeworkid); @@ -655,6 +657,7 @@ class Listofworks extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, }) + this.props.Getdataback(result,result.data); this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); } } }).catch((error) => { @@ -714,6 +717,7 @@ class Listofworks extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, }) + this.props.Getdataback(result,result.data); this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); } } @@ -1362,6 +1366,10 @@ class Listofworks extends Component { DownloadMessageval:undefined }) } + + ChangeTab=(e)=>{ + this.props.ChangeTab(e); + } render() { // console.log("Listofworks.js000") @@ -1371,7 +1379,7 @@ class Listofworks extends Component { // console.log(course_group_info) // console.log(JSON.stringify(this.props)); return ( -
+
{visible === true ?
-
-

- {jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name} - > - {jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name} - > - 作业详情 -

-
-
-

- {teacherdata === undefined ? "" : teacherdata.homework_name} -

- - 返回 - 实训详情 - - -
- 作品列表 - 作业问答 + this.ChangeTab(0)}>作品列表 + this.ChangeTab(1)}>作业问答 {this.props.isAdmin() ? - this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : - 代码查重 : ""} - 设置 + onClick={(e)=>this.ChangeTab(2)}> + 代码查重 : ""} + this.ChangeTab(3)} + >设置 {/*{this.props.isAdmin() ? :""} {this.props.isAdmin() ? teacherdata && teacherdata.end_immediately === true ? - 立即截止 : "" + 立即截止 + : "" : ""} {this.props.isAdmin() ? teacherdata && teacherdata.publish_immediately === true ? - 立即发布 : "" + 立即发布 + : "" : ""} - {/*提交总结*/} - {this.props.isAdmin() ? - this.state.code_review === false ? - "" - : 代码查重 : ""} + teacherdata && teacherdata.code_review === true ? + 代码查重 + : "": ""}
@@ -1754,4 +1733,32 @@ class Listofworks extends Component { } } -export default Listofworks; \ No newline at end of file +export default Listofworks; + +{/*
*/} +{/*

*/} +{/* {jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}*/} +{/* >*/} +{/* {jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}*/} +{/* >*/} +{/* 作业详情*/} +{/*

*/} +{/*
*/} +{/*
*/} +{/*

*/} +{/*{teacherdata === undefined ? "" : teacherdata.homework_name}*/} +{/*

*/} +{/**/} +{/*返回*/} +{/*实训详情*/} + + +{/*
*/} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 7985293ae..ef3051aaf 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -177,13 +177,13 @@ class Listofworksstudentone extends Component { className:'font-14', render: (text, record) => ( - {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} + {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} ), @@ -316,7 +316,8 @@ class Listofworksstudentone extends Component { } componentDidMount() { - + console.log("Listofworksstudentone"); + console.log("componentDidMount"); var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); let query = this.props.location.pathname; @@ -347,7 +348,9 @@ class Listofworksstudentone extends Component { course_group: "", } axios.post(urll, data).then((result) => { - + if(result === undefined){ + return + } if (result.status === 200) { if(this.props.isNotMember()===false) { this.setState({ @@ -364,7 +367,8 @@ class Listofworksstudentone extends Component { challenges_count: result.data.challenges_count, view_report: result.data.view_report, }) - if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { + this.props.Getdataback(result,result.data); + if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { this.seacthdata(result.data); } else { this.seacthdatas(result.data, result.data.student_works); @@ -421,6 +425,7 @@ class Listofworksstudentone extends Component { challenges_count:result.data.challenges_count, view_report:result.data.view_report, }) + this.props.Getdataback(result,result.data); if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { this.seacthdata(result.data); } else { @@ -785,7 +790,8 @@ class Listofworksstudentone extends Component { challenges_count:result.data.challenges_count, view_report:result.data.view_report, }) - this.seacthdata(result.data); + this.props.Getdataback(result,result.data); + this.seacthdata(result.data); } } }).catch((error) => { @@ -837,6 +843,9 @@ class Listofworksstudentone extends Component { }); } + ChangeTab=(e)=>{ + this.props.ChangeTab(e); + } render() { let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; // console.log(this.state.data); @@ -845,7 +854,7 @@ class Listofworksstudentone extends Component { return ( teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? // 学生不能查看别人的 -
+
- 设置 - {/**/} - {/*查看实训报告*/} - {/**/} + this.ChangeTab(3)} + >设置