|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd";
|
|
|
|
|
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col ,Spin} from "antd";
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
class SendTopics extends Component{
|
|
|
|
@ -9,7 +9,8 @@ class SendTopics extends Component{
|
|
|
|
|
courses:[],
|
|
|
|
|
search:null,
|
|
|
|
|
Radiolist:undefined,
|
|
|
|
|
showcheck:false
|
|
|
|
|
showcheck:false,
|
|
|
|
|
smallisSpin:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -54,13 +55,17 @@ class SendTopics extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submitInfo=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
smallisSpin:true
|
|
|
|
|
})
|
|
|
|
|
let{Radiolist}=this.state;
|
|
|
|
|
let url=`/question_banks/send_to_course.json`;
|
|
|
|
|
let object_id=this.props.checkBoxValues;
|
|
|
|
|
let object_type=this.props.category;
|
|
|
|
|
if(Radiolist===undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
showcheck:true
|
|
|
|
|
showcheck:true,
|
|
|
|
|
smallisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
axios.post(url,{
|
|
|
|
@ -69,6 +74,9 @@ class SendTopics extends Component{
|
|
|
|
|
course_id:Radiolist
|
|
|
|
|
}
|
|
|
|
|
).then((result)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
smallisSpin:false
|
|
|
|
|
})
|
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
this.props.showNotification(result.data.message)
|
|
|
|
|
this.props.topicscancelmodel()
|
|
|
|
@ -78,12 +86,15 @@ class SendTopics extends Component{
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error)
|
|
|
|
|
this.setState({
|
|
|
|
|
smallisSpin:false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let{courses,Radiolist,showcheck}= this.state;
|
|
|
|
|
let{courses,Radiolist,showcheck,smallisSpin}= this.state;
|
|
|
|
|
|
|
|
|
|
const radioStyle = {
|
|
|
|
|
display: 'block',
|
|
|
|
@ -108,6 +119,9 @@ class SendTopics extends Component{
|
|
|
|
|
height:221px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
.ml200{
|
|
|
|
|
margin-left:200px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
@ -151,9 +165,9 @@ class SendTopics extends Component{
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
{showcheck===true?<div className={"color-red mt10"}>请先选择课堂</div>:""}
|
|
|
|
|
<div className="mt20 clearfix edu-txt-center">
|
|
|
|
|
<a onClick={()=>this.props.topicscancelmodel()} className="pop_close task-btn mr30">取消</a>
|
|
|
|
|
<a className="task-btn task-btn-orange" onClick={()=>this.submitInfo()}>确定</a>
|
|
|
|
|
<div className="mt20 clearfix edu-txt-center ml200" >
|
|
|
|
|
<a onClick={()=>this.props.topicscancelmodel()} className="pop_close task-btn mr30 fl">取消</a>
|
|
|
|
|
<Spin size="small" spinning={smallisSpin}><a className="task-btn task-btn-orange fl" onClick={()=>this.submitInfo()}>确定</a></Spin>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|