|
|
@ -658,32 +658,28 @@ class Coursesleftnav extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
updatadeleteSecondary=(url)=>{
|
|
|
|
updatadeleteSecondary=(url)=>{
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
// this.setState({
|
|
|
|
this.setState({
|
|
|
|
// ModalsType:true,
|
|
|
|
ModalsType:false,
|
|
|
|
// Modalstopval:"删除成功",
|
|
|
|
Modalstopval:"",
|
|
|
|
// loadtype:true,
|
|
|
|
loadtype:false,
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
// notification.open({
|
|
|
|
notification.open({
|
|
|
|
// message: "删除成功",
|
|
|
|
message: "删除成功",
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.history.replace(url);
|
|
|
|
this.props.history.replace(url);
|
|
|
|
window.location.href = url;
|
|
|
|
|
|
|
|
|
|
|
|
// window.location.href = url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deletenavchilds=(url,mainurl)=>{
|
|
|
|
deletenavchilds=(url,mainurl)=>{
|
|
|
|
this.setState({
|
|
|
|
console.log(this.props);
|
|
|
|
antIcon:true
|
|
|
|
this.setState({
|
|
|
|
})
|
|
|
|
antIcon:true
|
|
|
|
|
|
|
|
})
|
|
|
|
axios.delete(url).then((result)=>{
|
|
|
|
axios.delete(url).then((result)=>{
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
|
|
|
this.updatadeleteSecondary(mainurl || result.data.right_url);
|
|
|
|
if(mainurl===undefined){
|
|
|
|
|
|
|
|
this.updatadeleteSecondary(result.data.right_url)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.updatadeleteSecondary(mainurl)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error)=>{
|
|
|
|
}).catch((error)=>{
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
@ -698,8 +694,8 @@ class Coursesleftnav extends Component{
|
|
|
|
ModalsType:true,
|
|
|
|
ModalsType:true,
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalSave:()=>this.deletenavchilds(url),
|
|
|
|
ModalSave:()=>this.deletenavchilds(url,mainurl),
|
|
|
|
|
|
|
|
loadtype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}else if(type===2){
|
|
|
|
}else if(type===2){
|
|
|
@ -709,7 +705,7 @@ class Coursesleftnav extends Component{
|
|
|
|
Modalstopval:"该分班的学生将被移动到“未分班”,",
|
|
|
|
Modalstopval:"该分班的学生将被移动到“未分班”,",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalSave:()=>this.deletenavchilds(url),
|
|
|
|
ModalSave:()=>this.deletenavchilds(url),
|
|
|
|
|
|
|
|
loadtype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else if(type===3){
|
|
|
|
}else if(type===3){
|
|
|
|
let url="/boards/"+id+".json"
|
|
|
|
let url="/boards/"+id+".json"
|
|
|
@ -718,7 +714,7 @@ class Coursesleftnav extends Component{
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalSave:()=>this.deletenavchilds(url,mainurl),
|
|
|
|
ModalSave:()=>this.deletenavchilds(url,mainurl),
|
|
|
|
|
|
|
|
loadtype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -874,6 +870,9 @@ class Coursesleftnav extends Component{
|
|
|
|
{/*讨论区*/}
|
|
|
|
{/*讨论区*/}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除</div>:""}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除</div>:""}
|
|
|
|
|
|
|
|
{/*视频*/}
|
|
|
|
|
|
|
|
{item.type==="video"?<div onClick={e=>this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
|
|
|
|
|
|
|
|
{item.type==="video"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id,item.category_url)}>删除</div>:""}
|
|
|
|
</div>)
|
|
|
|
</div>)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|