|
|
@ -553,19 +553,28 @@ class Coursesleftnav extends Component{
|
|
|
|
// notification.open({
|
|
|
|
// notification.open({
|
|
|
|
// message: "删除成功",
|
|
|
|
// message: "删除成功",
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.history.replace(url);
|
|
|
|
window.location.href = url;
|
|
|
|
window.location.href = url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deletenavchilds=(url)=>{
|
|
|
|
deletenavchilds=(url,mainurl)=>{
|
|
|
|
|
|
|
|
|
|
|
|
axios.delete(url).then((result)=>{
|
|
|
|
axios.delete(url).then((result)=>{
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(mainurl===undefined){
|
|
|
|
this.updatadeleteSecondary(result.data.right_url)
|
|
|
|
this.updatadeleteSecondary(result.data.right_url)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.updatadeleteSecondary(mainurl)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error)=>{
|
|
|
|
}).catch((error)=>{
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deleteSecondary=(e,type,id)=>{
|
|
|
|
deleteSecondary=(e,type,id,mainurl)=>{
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
if(type===1){
|
|
|
|
if(type===1){
|
|
|
|
let url="/course_second_categories/"+id+".json"
|
|
|
|
let url="/course_second_categories/"+id+".json"
|
|
|
@ -593,7 +602,7 @@ class Coursesleftnav extends Component{
|
|
|
|
ModalsType:true,
|
|
|
|
ModalsType:true,
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
Modalstopval:"该目录下的内容将被移动到父目录,",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalsBottomval:"是否确认删除?",
|
|
|
|
ModalSave:()=>this.deletenavchilds(url),
|
|
|
|
ModalSave:()=>this.deletenavchilds(url,mainurl),
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -726,7 +735,7 @@ class Coursesleftnav extends Component{
|
|
|
|
{item.type==="course_group"?<div onClick={e=>this.deleteSecondary(e,2,iem.category_id)}>删除</div>:""}
|
|
|
|
{item.type==="course_group"?<div onClick={e=>this.deleteSecondary(e,2,iem.category_id)}>删除</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.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.deleteSecondary(e,3,iem.category_id)}>删除</div>:""}
|
|
|
|
{item.type==="board"?<div onClick={e=>this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除</div>:""}
|
|
|
|
</div>)
|
|
|
|
</div>)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|