问卷-题库选用

dev_aliyun_beta
caicai8 6 years ago
parent f445af2d2b
commit 17e1f44146

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

Loading…
Cancel
Save