杨树明 5 years ago
parent 51a5348237
commit ccb64e8b3f

@ -72,9 +72,8 @@ class AppraiseModal extends Component{
challenge_id:challenge_id challenge_id:challenge_id
}).then((response) => { }).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
debugger
this.props.showNotification(response.data.message)
this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id)
this.props.showNotification(response.data.message)
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }

@ -216,10 +216,13 @@ class ShixunWorkReport extends Component {
} }
isdeleteModal=(comment_id,visible_comment,type)=>{ isdeleteModal=(comment_id,visible_comment,type)=>{
let newcomment_id=comment_id;
let newvisible_comment=visible_comment;
let newtype=type;
this.setState({ this.setState({
modalsType: true, modalsType: true,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype),
modalCancel:()=>this.hideisdeleteModals(), modalCancel:()=>this.hideisdeleteModals(),
}) })
} }
@ -278,22 +281,24 @@ class ShixunWorkReport extends Component {
let newcomment_id=comment_id; let newcomment_id=comment_id;
let newvisible_comment=visible_comment; let newvisible_comment=visible_comment;
let newtype=type; let newtype=type;
if(comment_id!=null){
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: {
comment_id:comment_id,
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: {
comment_id:comment_id,
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
} }
render() { render() {
let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state;

Loading…
Cancel
Save