From 4e4d011d4339d819254482d838f6773844b4f62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 30 Jul 2019 22:01:12 +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/busyWork/CommonWorkDetailIndex.js | 10 ++-- .../courses/busyWork/CommonWorkList.js | 3 +- .../courses/exercise/ExerciseDisplay.js | 30 ++++++++++++ .../courses/exercise/Exercisesetting.js | 33 ++++++++++++- .../exercise/Exercisestatisticalresult.js | 21 +++++++- .../exercise/Studentshavecompletedthelist.js | 49 +++++++++++++------ .../exercise/Testpapersettinghomepage.js | 25 +++++++--- 7 files changed, 139 insertions(+), 32 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index f1b9faab7..e34783933 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -102,8 +102,10 @@ class CommonWorkDetailIndex extends Component{ } /// 确认是否下载 - confirmysl(url){ - axios.get(url).then((response) => { + confirmysl(url,params){ + axios.get(url,{ + params + }).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -171,7 +173,9 @@ class CommonWorkDetailIndex extends Component{ let params = {} if (isListModule) { // TODO - params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{}; + if(this.child!=undefined) { + params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {}; + } } // console.log("普通作业176176176"); // console.log(params); diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 8bc029cec..9224e7eb2 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -425,7 +425,8 @@ class CommonWorkList extends Component{ teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0], order, limit: PAGE_SIZE, - b_order: orderMap[order] + b_order: orderMap[order], + group_id:arg_course_group, } } fetchList = () => { diff --git a/public/react/src/modules/courses/exercise/ExerciseDisplay.js b/public/react/src/modules/courses/exercise/ExerciseDisplay.js index bd70bece6..a0296476f 100644 --- a/public/react/src/modules/courses/exercise/ExerciseDisplay.js +++ b/public/react/src/modules/courses/exercise/ExerciseDisplay.js @@ -33,6 +33,21 @@ class ExerciseDisplay extends Component{ this.state = { exercise_questions: [], + exercise_group_id:[], + page:1, + limit:10, + searchtext:"", + order: "end_at", + } + } + _getRequestParams() { + const { order, exercise_group_id,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:exercise_group_id, } } componentDidMount = () => { @@ -49,6 +64,21 @@ class ExerciseDisplay extends Component{ console.log(error); }); } + try { + this.props.triggerRef(this); + }catch (e) { + + } + } + _getRequestParams() { + const { order, exercise_group_id,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:exercise_group_id, + } } render() { // let { question_title, question_score, question_type, question_choices, standard_answer, diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 06269244d..9b6103fdb 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -63,17 +63,46 @@ class Exercisesetting extends Component{ choice_random:true, time:0, publish_timetype:false, - end_timetype:false + end_timetype:false, + exercise_group_id:[], + page:1, + limit:10, + searchtext:"", + order: "end_at", } console.log("Exercisesetting"); console.log("69"); console.log(props); } - + _getRequestParams() { + const { order, exercise_group_id,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:exercise_group_id, + } + } //加载 componentDidMount=()=>{ this.getSettingInfo(); // window.addEventListener('click', this.handleClick); + try { + this.props.triggerRef(this); + }catch (e) { + + } + } + _getRequestParams() { + const { order, exercise_group_id,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:exercise_group_id, + } } // handleClick=(e)=>{ diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 1771d87b3..34f32b234 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -23,15 +23,32 @@ class Exercisestatisticalresult extends Component { exercise_group_id:[], page:1, limit:10, + searchtext:"", + order: "end_at", + } } componentDidMount() { let{sort,exercise_group_id,page,limit}=this.state; - this.updatefun(sort,exercise_group_id,page,limit) - } + this.updatefun(sort,exercise_group_id,page,limit); + try { + this.props.triggerRef(this); + }catch (e) { + } + } + _getRequestParams() { + const { order, exercise_group_id,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:exercise_group_id, + } + } updatefun=(sort,exercise_group_id,page,limit)=>{ let ExerciseId=this.props.match.params.Id; let url = `/exercises/`+ExerciseId+`/exercise_result.json`; diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index fffadccf6..fcfea19c3 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1213,6 +1213,11 @@ class Studentshavecompletedthelist extends Component { // console.log("2222222222222"); // console.log(this.props.isAdmin()); // } + try { + this.props.triggerRef(this); + }catch (e) { + + } } componentWillReceiveProps = (nextProps) => { @@ -2279,22 +2284,8 @@ class Studentshavecompletedthelist extends Component { this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); } - } - //搜索学生 文字输入 - inputSearchValues = (e) => { - // console.log(e.target.value) - if (e.target.value === "") { - this.setState({ - searchtext: undefined, - }) - } else { - this.setState({ - searchtext: e.target.value, - }) - } - - } - //搜索学生按钮输入 + }; + //搜索学生按钮输入 老师 searchValues = (value) => { //点击直接搜索 // if(value === ""){ @@ -2313,8 +2304,34 @@ class Studentshavecompletedthelist extends Component { // console.log(value) + }; + _getRequestParams() { + const { order, course_groups,searchtext, page ,limit} = this.state + return { + page, + search:searchtext, + order, + limit: limit, + group_id:course_groups, + } } + //搜索学生 文字输入 + inputSearchValues = (e) => { + // console.log(e.target.value) + if (e.target.value === "") { + this.setState({ + searchtext: undefined, + }) + } else { + this.setState({ + searchtext: e.target.value, + }) + } + + }; + + //排序 funordersy = (e) => { if (e === "end_at") { diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index ddb448cfc..333824538 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -163,8 +163,10 @@ class Testpapersettinghomepage extends Component{ } /// 确认是否下载 - confirmysl(url){ - axios.get(url).then((response) => { + confirmysl(url,params){ + axios.get(url,{ + params + }).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -218,6 +220,7 @@ class Testpapersettinghomepage extends Component{ // DownloadMessageval:undefined // }) // } + bindRef = ref => { this.child = ref }; goback=()=>{ // let {datalist}=this.state; // let courseId=this.props.match.params.coursesId; @@ -236,7 +239,13 @@ class Testpapersettinghomepage extends Component{ let {tab,visible,Commonheadofthetestpaper}=this.state; const isAdmin =this.props.isAdmin(); const isStudent = this.props.isStudent(); - + // TODO + let params ={} + if(this.child!=undefined){ + params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{}; + } + // console.log("246"); + // console.log(this.child); return(
{/* 导出 @@ -400,22 +409,22 @@ class Testpapersettinghomepage extends Component{ /> { // 教师列表 - parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}> + parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}> } {/*统计结果*/} { - parseInt(tab[0])==1 && + parseInt(tab[0])==1 && } { - parseInt(tab[0])==2 && + parseInt(tab[0])==2 && } { - parseInt(tab[0])==3 && + parseInt(tab[0])==3 && }