diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index a4599bffb..f03608c8b 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -48,8 +48,8 @@ class Addcourses extends Component{ } componentDidUpdate = (prevProps) => { - console.log(prevProps); - console.log(this.props); + // console.log(prevProps); + // console.log(this.props); if(prevProps.occupation!==this.props.occupation){ this.setState({ Addcoursestype:false, @@ -222,8 +222,8 @@ class Addcourses extends Component{ student:student } ).then((response) => { - console.log("submittojoinclass"); - console.log(response); + // console.log("submittojoinclass"); + // console.log(response); if(response === undefined){ this.setState({ // Addcoursestype:false, @@ -302,7 +302,7 @@ class Addcourses extends Component{ isSpin:false }); }).catch((error) => { - console.log(error) + console.log(error); this.setState({ Addcoursestype:false, isSpin:false @@ -326,8 +326,8 @@ class Addcourses extends Component{ Addcoursestypes }=this.state; const antIcon = ; - console.log("Addcourses"); - console.log(Addcoursestypes) + // console.log("Addcourses"); + // console.log(Addcoursestypes) return(
:
-
+
diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index ce602afc3..63360d55d 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -65,6 +65,8 @@ class PollNew extends Component { cancellation: false, bindingid:undefined, Newdisplay:false, + first_category_url:"", + left_banner_id:"", } // console.log("试卷新建和编辑"); // console.log(JSON.stringify(props)); @@ -72,6 +74,7 @@ class PollNew extends Component { } changeTopicName = (e) => { + console.log("调用了changeTopicName"); let num = 60 - parseInt(e.target.value.length); this.setState({ addonAfter: num < 0 ? 0 : num @@ -124,8 +127,35 @@ class PollNew extends Component { console.log("问卷返回"); console.log(this.props); + try { + if(this.props.current_user!==undefined){ + this.setState({ + first_category_url :this.props.current_user.first_category_url, + }); + console.log("======================="); + console.log(this.props.current_user.first_category_url); + } + }catch (e) { + console.log("12312312312") + console.log(e); + } + }; + componentDidUpdate = (prevProps) => { + // console.log("componentDidUpdate"); + // console.log(prevProps); + // console.log(this.props); + if(prevProps.current_user!=this.props.current_user){ + if(this.props.current_user!==undefined){ + // console.log(this.props.current_user.login); + // console.log(prevProps.current_user.login); + this.setState({ + first_category_url :this.props.current_user.first_category_url, + }) + } + } } + //获取权限 // getPollInfo(){ // // console.log(this.props.match); @@ -144,12 +174,12 @@ class PollNew extends Component { // } //初始化请求网络 Initializatio_data = () => { - // console.log("Initializatio_data 582") + console.log("Initializatio_data 582") //课堂id let coursesId = this.props.match.params.coursesId; //时间id let pollid = this.props.match.params.pollid; - // console.log(pollid); + console.log(pollid); // let coursesId = 557; if (pollid === undefined) { // console.log("没有问卷新建问卷~~~") @@ -215,6 +245,19 @@ class PollNew extends Component { polls_nametest: result.data.poll.polls_name, polls_descriptiontest: result.data.poll.polls_description, }); + + if(result.data){ + if(result.data.poll){ + if(result.data.poll.polls_name){ + let num = 60 - parseInt(result.data.poll.polls_name.length); + this.setState({ + addonAfter: num < 0 ? 0 : num + }) + } + } + + } + this.setState({ projects: result.data, pollid: pollid, @@ -229,6 +272,7 @@ class PollNew extends Component { polls_nametest: result.data.poll.polls_name, polls_descriptiontest: result.data.poll.polls_description, questionnair: true, + left_banner_id:result.data.left_banner_id }) // console.log(this.state.polls_nametest) // console.log(this.state.polls_descriptiontest) @@ -2338,10 +2382,13 @@ class PollNew extends Component { } gotohome=()=>{ // const { current_user} = this.props + if(this.state.first_category_url){ + window.location.href=this.state.first_category_url; + }else{ + this.props.history.goBack(); + } - // this.props.history.push(current_user && current_user.first_category_url); // - this.props.history.goBack() // let courseId=this.props.match.params.coursesId; // if(courseId===undefined){ // this.props.history.push("/courses"); @@ -2360,6 +2407,7 @@ class PollNew extends Component { readOnlys, newoption, cancellation, + left_banner_id } = this.state //获取老师权限 // console.log("[`${maps[polls_status && polls_status]}`]]"); @@ -2404,16 +2452,30 @@ class PollNew extends Component {

this.gotohome()}>{this.props.coursedata.name} > - 问卷 + { + this.props.match.params.news === "new"? + 问卷 + : + 问卷 + } + > {this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}

{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

- this.gotohome()} - className=" fr font-16">返回 + { + this.props.match.params.news === "new" ? + 返回 + : + 返回 + } +
{/*
*/} @@ -2461,12 +2523,13 @@ class PollNew extends Component { }
- + {/*addonAfter={String(addonAfter)}*/} diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 71fd8744e..74d142129 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1019,8 +1019,8 @@ class ShixunHomework extends Component{

- {/*{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}*/} - 实训作业 + {datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"} + {/* 实训作业*/}

  • {this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?