|
|
|
@ -122,41 +122,29 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//onAttachmentRemove = (file) => {
|
|
|
|
|
|
|
|
|
|
// confirm({
|
|
|
|
|
// title: '确定要删除这个附件吗?',
|
|
|
|
|
// okText: '确定',
|
|
|
|
|
// cancelText: '取消',
|
|
|
|
|
// // content: 'Some descriptions',
|
|
|
|
|
// onOk: () => {
|
|
|
|
|
// this.deleteAttachment(file)
|
|
|
|
|
// },
|
|
|
|
|
// onCancel() {
|
|
|
|
|
// console.log('Cancel');
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Modalstype:true,
|
|
|
|
|
// Modalstopval:'确定要删除这个附件吗?',
|
|
|
|
|
// ModalSave: ()=>this.deleteAttachment(file),
|
|
|
|
|
// ModalCancel:this.cancelAttachment
|
|
|
|
|
// })
|
|
|
|
|
// return false;
|
|
|
|
|
//}
|
|
|
|
|
onAttachmentRemove = (file) => {
|
|
|
|
|
if(!file.percent || file.percent == 100){
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:'确定要删除这个附件吗?',
|
|
|
|
|
ModalSave: ()=>this.deleteAttachment(file),
|
|
|
|
|
ModalCancel:this.cancelAttachment
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAttachment=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
Modalstopval:'确定要删除这个附件吗?',
|
|
|
|
|
Modalstopval:'',
|
|
|
|
|
ModalSave:"",
|
|
|
|
|
ModalCancel:""
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onAttachmentRemove = (file) => {
|
|
|
|
|
deleteAttachment = (file) => {
|
|
|
|
|
if(!file.percent || file.percent == 100){
|
|
|
|
|
let {attachments,fileList}=this.state;
|
|
|
|
|
let id=file.response ==undefined ? file.id : file.response.id;
|
|
|
|
@ -177,17 +165,15 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
ModalSave:this.cancelAttachment,
|
|
|
|
|
Loadtype:true,
|
|
|
|
|
attachments:newattachments
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Modalstype:true,
|
|
|
|
|
// Modalstopval:response.data.message,
|
|
|
|
|
// ModalSave:this.cancelAttachment,
|
|
|
|
|
// Loadtype:true,
|
|
|
|
|
// attachments:newattachments
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
this.cancelAttachment();
|
|
|
|
|
this.setState((state) => {
|
|
|
|
|
const index = state.fileList.indexOf(file);
|
|
|
|
|
const newFileList = state.fileList.slice();
|
|
|
|
|