删除目录

courseware
caicai8 5 years ago
parent b2d153169e
commit 303546c40a

@ -465,13 +465,14 @@ class Coursesleftnav extends Component{
Modalstopval:"隐藏后将不再显示此模块,", Modalstopval:"隐藏后将不再显示此模块,",
ModalsBottomval:"后续可在课堂设置中重新勾选模块恢复显示", ModalsBottomval:"后续可在课堂设置中重新勾选模块恢复显示",
ModalSave:()=>this.edithiddens(id), ModalSave:()=>this.edithiddens(id),
loadtype:false
}) })
}else{ }else{
this.setState({ this.setState({
ModalsType:true, ModalsType:true,
Modalstopval:"您不能隐藏所有课堂模块,请至少保留", Modalstopval:"您不能隐藏所有课堂模块,请至少保留",
ModalsBottomval:"其中一个模块。", ModalsBottomval:"其中一个模块。",
loadtype:true, loadtype:false,
ModalSave:()=>this.cannerNavmoda(), ModalSave:()=>this.cannerNavmoda(),
}) })
} }
@ -674,6 +675,7 @@ class Coursesleftnav extends Component{
ModalsType:false, ModalsType:false,
Modalstopval:"", Modalstopval:"",
loadtype:false, loadtype:false,
antIcon:false
}) })
notification.open({ notification.open({
message: "删除成功", message: "删除成功",
@ -692,6 +694,7 @@ class Coursesleftnav extends Component{
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); this.updatadeleteSecondary(mainurl || result.data.right_url);
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
@ -699,17 +702,16 @@ class Coursesleftnav extends Component{
} }
deleteSecondary=(e,type,id,mainurl)=>{ deleteSecondary=(e,type,id,mainurl)=>{
e.stopPropagation();//阻止冒泡 e.stopPropagation();//阻止冒泡
debugger;
if(type===1){ if(type===1){
let url="/course_second_categories/"+id+".json" let url="/course_second_categories/"+id+".json"
this.setState({ this.setState({
ModalsType:true, loadtype:false,
Modalstopval:"该目录下的内容将被移动到父目录,", ModalsType:true,
ModalsBottomval:"是否确认删除?", Modalstopval:"该目录下的内容将被移动到父目录,",
ModalSave:()=>this.deletenavchilds(url,mainurl), ModalsBottomval:"是否确认删除?",
loadtype:false ModalSave:()=>this.deletenavchilds(url,mainurl)
}) })
}else if(type===2){ }else if(type===2){
let url="/course_groups/"+id+".json" let url="/course_groups/"+id+".json"
this.setState({ this.setState({

Loading…
Cancel
Save