|
|
|
@ -148,39 +148,42 @@ class GraduationTasksedit extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onAttachmentRemove = (file) => {
|
|
|
|
|
// debugger
|
|
|
|
|
this.cancelAttachment();
|
|
|
|
|
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
|
|
|
|
|
// const url = `/attachments/${file}.json`
|
|
|
|
|
axios.delete(url, {
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
|
|
|
|
|
if ( response.data.status === 0) {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
ModalSave:this.cancelAttachment,
|
|
|
|
|
Loadtype:true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState((state) => {
|
|
|
|
|
|
|
|
|
|
const index = state.fileList.indexOf(file);
|
|
|
|
|
const newFileList = state.fileList.slice();
|
|
|
|
|
newFileList.splice(index, 1);
|
|
|
|
|
return {
|
|
|
|
|
fileList: newFileList,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
if(file.response!=undefined){
|
|
|
|
|
// debugger
|
|
|
|
|
this.cancelAttachment();
|
|
|
|
|
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
|
|
|
|
|
// const url = `/attachments/${file}.json`
|
|
|
|
|
axios.delete(url, {
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
|
|
|
|
|
if ( response.data.status === 0) {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
ModalSave:this.cancelAttachment,
|
|
|
|
|
Loadtype:true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState((state) => {
|
|
|
|
|
|
|
|
|
|
const index = state.fileList.indexOf(file);
|
|
|
|
|
const newFileList = state.fileList.slice();
|
|
|
|
|
newFileList.splice(index, 1);
|
|
|
|
|
return {
|
|
|
|
|
fileList: newFileList,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Commoninterface=(fileList)=>{
|
|
|
|
|