|
|
|
@ -103,11 +103,11 @@ class Poll extends Component{
|
|
|
|
|
this.InitList(e.key,StudentList_value,page);
|
|
|
|
|
}
|
|
|
|
|
// 获取列表数据
|
|
|
|
|
InitList=(type,search,page)=>{
|
|
|
|
|
InitList=(type,search,page,bank_checkValue)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
let {pageSize}=this.state
|
|
|
|
|
let { pageSize,checkBoxValues }=this.state
|
|
|
|
|
let coursesId=this.props.match.params.coursesId;
|
|
|
|
|
let url='/courses/'+coursesId+'/polls.json?limit='+pageSize+'&page='+page
|
|
|
|
|
if(type!="0"){
|
|
|
|
@ -123,7 +123,7 @@ class Poll extends Component{
|
|
|
|
|
course_types:result.data.course_types,
|
|
|
|
|
polls_counts:result.data.polls_counts,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
checkBoxValues:[]
|
|
|
|
|
checkBoxValues: bank_checkValue ? bank_checkValue : []
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
@ -209,12 +209,6 @@ class Poll extends Component{
|
|
|
|
|
//判断是否有选中数据
|
|
|
|
|
if(this.state.checkBoxValues.length==0){
|
|
|
|
|
this.props.showNotification("请先在列表中选择数据");
|
|
|
|
|
// this.setState({
|
|
|
|
|
// modalsType:true,
|
|
|
|
|
// modalsTopval:"请先在列表中选择数据",
|
|
|
|
|
// modalsBottomval:'',
|
|
|
|
|
// loadtype:true
|
|
|
|
|
// })
|
|
|
|
|
}else{
|
|
|
|
|
if(value != "bank"){
|
|
|
|
|
this.setState({
|
|
|
|
@ -325,15 +319,13 @@ class Poll extends Component{
|
|
|
|
|
}
|
|
|
|
|
// 题库选用成功后,立即发布,刷新页面
|
|
|
|
|
useBankSuccess=(checkValue,value)=>{
|
|
|
|
|
debugger;
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
let{type,StudentList_value,page}=this.state
|
|
|
|
|
this.InitList(type,StudentList_value,page);
|
|
|
|
|
this.InitList(type,StudentList_value,page,value);
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
checkBoxValues:[]
|
|
|
|
|
})
|
|
|
|
|
let coursesId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${coursesId}/polls/publish_modal.json`;
|
|
|
|
|
axios.get(url,{
|
|
|
|
@ -351,10 +343,6 @@ class Poll extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups:list,
|
|
|
|
|
checkBoxValues:value
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
modalname:"立即发布",
|
|
|
|
|
modaltype:response.data.un_publish > 0 ? 1 : 2,
|
|
|
|
@ -369,6 +357,8 @@ class Poll extends Component{
|
|
|
|
|
Savesname:"立即发布",
|
|
|
|
|
Cancel:this.homeworkhide,
|
|
|
|
|
Saves:this.homeworkstartend,
|
|
|
|
|
course_groups:list,
|
|
|
|
|
checkBoxValues:value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
@ -425,7 +415,7 @@ class Poll extends Component{
|
|
|
|
|
addname:undefined,
|
|
|
|
|
addnametype:false,
|
|
|
|
|
addnametab:undefined,
|
|
|
|
|
checkBoxValues:[]
|
|
|
|
|
// checkBoxValues:[]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|