分组作业题库发送和删除题

dev_aliyun_beta
杨树林 5 years ago
parent 69d0f5aaf7
commit a3bacbe24b

@ -8,6 +8,7 @@ import "../../../courses/css/Courses.css"
import "../../../courses/css/busyWork.css"
import SendTopics from '../../../modals/SendTopics';
import Modals from '../../../modals/Modals';
import axios from 'axios';
class BanksMenu extends Component{
constructor(props){
super(props);
@ -44,25 +45,33 @@ class BanksMenu extends Component{
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete(id,type),
ModalSave:()=>this.topicssavedelete(id,type),
})
}
topicssavedelete=(id,type)=>{
console.log("删除了");
console.log(id);
console.log(type);
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [id],
object_type:type
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
console.log(response);
if(response){
if(response.data){
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
}
}
})
.catch(function (error) {
console.log(error);
@ -71,9 +80,10 @@ class BanksMenu extends Component{
}
render(){
let { banksMenu,visible } = this.props;
let { banksMenu} = this.props;
let {visible}=this.state;
// console.log("问卷预览");
// console.log(banksMenu);
// console.log(visible);
let user_id=this.props.current_user&&this.props.current_user.user_id;
let user_type=this.props.current_user&&this.props.current_user.user_identity;
let targetuserid=this.props.data&&this.props.data.id;
@ -95,7 +105,7 @@ class BanksMenu extends Component{
{...this.props}
visible={visible}
category={banksMenu&&banksMenu.category}
checkBoxValues={[banksMenu&&banksMenu.bankId]}
checkBoxValues={[banksMenu&&banksMenu.id]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
}
@ -115,7 +125,7 @@ class BanksMenu extends Component{
}
<span className="fr mt18">
<WordsBtn onClick={()=>this.deletecheckBoxValues()}style="blue" className="ml20 font-16">删除</WordsBtn>
<WordsBtn onClick={()=>this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除</WordsBtn>
<WordsBtn to={banksMenu&&banksMenu.category==='poll'?banksMenu.tos:""} style="blue" className="ml20 font-16">编辑</WordsBtn>
<WordsBtn onClick={()=>this.sendTopics()} style="blue" className="ml20 font-16">发送</WordsBtn>
</span>

Loading…
Cancel
Save