Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
cxt 5 years ago
commit 7a71611bee

@ -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 = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("Addcourses");
console.log(Addcoursestypes)
// console.log("Addcourses");
// console.log(Addcoursestypes)
return(
<div>
<Modals

@ -149,7 +149,7 @@ class Eduinforms extends Component{
</div>
:
<div className="edu-back-white ">
<div id="MakedownHTML" className={"markdown-body fonttext yslmtopcg"} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g, "▁▁▁")}}>
<div id="MakedownHTML" className={"markdown-body fonttext yslmtopcg"} style={{minHeight:"400px"}} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g, "▁▁▁")}}>
</div>

@ -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 {
<p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{
this.props.match.params.news === "new"?
<a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
:
<a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a>
}
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>
</p>
<div className="clearfix mb30">
<p
className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>
<a onClick={()=>this.gotohome()}
{
this.props.match.params.news === "new" ?
<a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}
className=" fr font-16">返回</a>
:
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16">返回</a>
}
</div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}
@ -2461,12 +2523,13 @@ class PollNew extends Component {
}
</div>
{/*addonAfter={String(addonAfter)}*/}
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
onInput={this.changeTopicName}
readOnly={readOnlys}
autoComplete="off" addonAfter={String(addonAfter)}
autoComplete="off"
suffix={String(addonAfter)+"/60"}
value={this.state.polls_nametest}
className="searchViewAfter"></Input>

@ -1019,8 +1019,8 @@ class ShixunHomework extends Component{
<div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}>
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span>
<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
{/* <span className="font-18 fl color-dark-21">实训作业</span>*/}
<li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>

Loading…
Cancel
Save