|
|
|
@ -168,36 +168,38 @@ class GraduationTasksSubmitnew extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteAttachment = (file) => {
|
|
|
|
|
const url = `/attachments/${file}.json`
|
|
|
|
|
axios.delete(url, {
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
// const { status } = response.data;
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
|
|
|
|
|
|
console.log('--- success')
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
ModalSave:this.cancelAttachment,
|
|
|
|
|
Loadtype:true,
|
|
|
|
|
})
|
|
|
|
|
if(!file.percent || file.percent == 100){
|
|
|
|
|
let id = file.response == undefined ? file.id : file.response.id;
|
|
|
|
|
const url = `/attachments/${id}.json`
|
|
|
|
|
axios.delete(url, {})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
// const { status } = response.data;
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
|
|
|
|
|
|
console.log('--- success')
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype: true,
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inputSearchValue=(e)=>{
|
|
|
|
|