删除调整

dev_hss
杨树明 5 years ago
parent a449496d59
commit 353cd74715

@ -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();

@ -161,7 +161,7 @@ class GraduationTasksSubmitnew extends Component{
cancelAttachment=()=>{
this.setState({
Modalstype:false,
Modalstopval:'确定要删除这个附件吗?',
Modalstopval:'',
ModalSave:"",
ModalCancel:""
})
@ -178,12 +178,13 @@ class GraduationTasksSubmitnew extends Component{
if (response.data.status === 0) {
console.log('--- success')
this.setState({
Modalstype: true,
Modalstopval: response.data.message,
ModalSave: this.cancelAttachment,
Loadtype: true,
})
// this.setState({
// Modalstype: true,
// Modalstopval: response.data.message,
// ModalSave: this.cancelAttachment,
// Loadtype: true,
// })
this.cancelAttachment();
this.setState((state) => {
const index = state.fileList.indexOf(file);

Loading…
Cancel
Save