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

dev_aliyun_beta
caicai8 6 years ago
commit 51fa698c46

@ -870,14 +870,14 @@ class CoursesNew extends Component {
})( })(
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} onInput={this.handleSearchschool}
className={"fl construction mr10 yslzxueshis2"} className={"fl construction mr10 yslzxueshis2"}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
dataSource={optionschool}
> >
{optionschool}
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
</span> </span>
<div id='isschool'></div> <div id='isschool'></div>

@ -1026,10 +1026,11 @@ class Goldsubject extends Component {
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} // onChange={this.handleChangeschools}
onInput={this.handleSearchschool}
className={"fl construction mr10 yslzxueshis2 "} className={"fl construction mr10 yslzxueshis2 "}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
dataSource={optionschool}
> >
{optionschool}
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>

@ -1803,27 +1803,49 @@ class PollNew extends Component {
var urlly = `/polls/${poll_id}/poll_questions.json` var urlly = `/polls/${poll_id}/poll_questions.json`
var max_choicess = null; var max_choicess = null;
var min_choicess = null; var min_choicess = null;
if (max_choices === 0 && min_choices === 0) { try {
if (max_choices === 0 && min_choices === 0) {
max_choicess = null;
min_choicess = null;
} else {
max_choicess = max_choices;
min_choicess = min_choices;
}
}catch (e) {
max_choicess = null; max_choicess = null;
min_choicess = null; min_choicess = null;
} else {
max_choicess = max_choices;
min_choicess = min_choices;
} }
console.log("createquestionsandanswers"); // console.log("createquestionsandanswers");
console.log(max_choicess); // console.log(max_choicess);
console.log(min_choicess); // console.log(min_choicess);
console.log(length); // console.log(length);
axios.post(urlly, { var datay={};
datay={
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
insert_id: insert_id insert_id: insert_id
}).then((result) => { }
try {
if(number===2){
datay={
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
question_answers: option,
question_other_answer: null,
insert_id: insert_id
}
}
}catch (e) {
}
axios.post(urlly, datay).then((result) => {
// try { // try {
if (result !== undefined) { if (result !== undefined) {
if (result.data.status === 0) { if (result.data.status === 0) {
@ -1856,27 +1878,50 @@ class PollNew extends Component {
var thiss = this; var thiss = this;
var max_choicess = null; var max_choicess = null;
var min_choicess = null; var min_choicess = null;
if (max_choices === 0 && min_choices === 0) { try {
if (max_choices === 0 && min_choices === 0) {
max_choicess = null;
min_choicess = null;
} else {
max_choicess = max_choices;
min_choicess = min_choices;
}
}catch (e) {
max_choicess = null; max_choicess = null;
min_choicess = null; min_choicess = null;
} else {
max_choicess = max_choices;
min_choicess = min_choices;
} }
console.log("createquestionsandanswers");
console.log(max_choicess); // console.log("createquestionsandanswers");
console.log(min_choicess); // console.log(max_choicess);
console.log(length); // console.log(min_choicess);
axios.put(url, { // console.log(length);
var datay={};
datay={
// debug: true, // debug: true,
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
}).then((result) => { };
try {
if(number===2){
datay={
// debug: true,
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
question_answers: option,
question_other_answer: null,
};
}
}catch (e) {
}
axios.put(url,datay).then((result) => {
try { try {
if (result.data.status === 0) { if (result.data.status === 0) {
this.props.showNotification(`编辑题目成功`); this.props.showNotification(`编辑题目成功`);

@ -35,6 +35,7 @@ class DetailTop extends Component{
getdatalist=()=>{ getdatalist=()=>{
let courseslist=[]; let courseslist=[];
let keys=1; let keys=1;
let listtype=false;
if(this.props.courses!=undefined&&this.props.courses.length!=0){ if(this.props.courses!=undefined&&this.props.courses.length!=0){
if(this.props.detailInfoList.has_start===true){ if(this.props.detailInfoList.has_start===true){
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
@ -47,14 +48,31 @@ class DetailTop extends Component{
}) })
}else{ }else{
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(this.props.pathtopskey===key+1){ if(listtype===false){
keys=key+1 keys=key+1
return( if(item.course_status.status===0) {
courseslist.push(item) listtype=true
) return (
} courseslist.push(item)
}) )
}
}
})
this.props.courses.map((item,key)=>{
if(listtype===false){
keys=key+1
if(item.course_status.status===2) {
listtype=true
return (
courseslist.push(item)
)
}
}
})
} }
} }
this.setState({ this.setState({

Loading…
Cancel
Save