杨树明 6 years ago
parent 4db95c6102
commit 20dc1e0a84

@ -168,9 +168,9 @@ class GraduationTasksSubmitedit extends Component{
if (response.data.status === 0) { if (response.data.status === 0) {
console.log('--- success') console.log('--- success')
let newattachments=attachments; let newattachments=attachments;
if(file.uid===undefined){ if(id===undefined){
for(var i=0; i<newattachments.length; i++){ for(var i=0; i<newattachments.length; i++){
if(newattachments[i].id===file.id){ if(newattachments[i].id===id){
newattachments.splice(i, 1); newattachments.splice(i, 1);
} }
} }
@ -186,7 +186,7 @@ class GraduationTasksSubmitedit extends Component{
this.cancelAttachment(); this.cancelAttachment();
this.setState((state) => { this.setState((state) => {
const index = state.fileList.indexOf(file); const index = state.fileList.indexOf(id);
const newFileList = state.fileList.slice(); const newFileList = state.fileList.slice();
newFileList.splice(index, 1); newFileList.splice(index, 1);
return { return {

Loading…
Cancel
Save