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

dev_aliyun_beta
杨树林 5 years ago
parent 6db157fe7f
commit 69d0f5aaf7

@ -6,15 +6,99 @@ import { WordsBtn } from 'educoder'
import "../usersInfo.css"
import "../../../courses/css/Courses.css"
import "../../../courses/css/busyWork.css"
import SendTopics from '../../../modals/SendTopics';
import Modals from '../../../modals/Modals';
class BanksMenu extends Component{
constructor(props){
super(props);
this.state={
visible:false
}
}
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
topicscancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
checkedtype:false
})
}
//删除相关
deletecheckBoxValues=(id,type)=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete(id,type),
})
}
topicssavedelete=(id,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)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render(){
let { banksMenu } = this.props;
let { banksMenu,visible } = this.props;
// console.log("问卷预览");
// console.log(banksMenu);
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;
return(
<div className="clearfix bor-bottom-greyE edu-back-white" style={{padding:"2px 30px"}}>
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
{/*发送至弹窗*/}
{
visible&&visible===true?
<SendTopics
{...this.state}
{...this.props}
visible={visible}
category={banksMenu&&banksMenu.category}
checkBoxValues={[banksMenu&&banksMenu.bankId]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
}
{
banksMenu &&
<div className="task_menu_ul fl">
@ -31,9 +115,9 @@ class BanksMenu extends Component{
}
<span className="fr mt18">
<WordsBtn to={''} style="blue" className="ml20 font-16">删除</WordsBtn>
<WordsBtn onClick={()=>this.deletecheckBoxValues()}style="blue" className="ml20 font-16">删除</WordsBtn>
<WordsBtn to={banksMenu&&banksMenu.category==='poll'?banksMenu.tos:""} style="blue" className="ml20 font-16">编辑</WordsBtn>
<WordsBtn to={''} style="blue" className="ml20 font-16">发送</WordsBtn>
<WordsBtn onClick={()=>this.sendTopics()} style="blue" className="ml20 font-16">发送</WordsBtn>
</span>
</div>
)

Loading…
Cancel
Save