附件组件-删除刚上传的文件,没有及时更新

This commit is contained in:
caishi 2023-03-17 16:30:19 +08:00
parent 201ece7558
commit caf1195d05
2 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,6 @@ function NewPanel(props,ref){
if(list && list.length>0 ){ if(list && list.length>0 ){
arr = list.filter(i=>i.id !== id); arr = list.filter(i=>i.id !== id);
} }
console.log('删除后:',arr);
setFileList(arr.map(i=>{return i.id})); setFileList(arr.map(i=>{return i.id}));
} }
@ -55,7 +54,6 @@ function NewPanel(props,ref){
function sureFunc(){ function sureFunc(){
validateFields((error,values)=>{ validateFields((error,values)=>{
if (!error) { if (!error) {
console.log('保存时:',fileList);
createFunc(values,fileList,receivers_login,description); createFunc(values,fileList,receivers_login,description);
} }
}) })

View File

@ -59,8 +59,9 @@ class Index extends Component {
return { return {
fileList: newFileList, fileList: newFileList,
}; };
},()=>{
this.fileIdList(this.state.fileList);
}); });
this.fileIdList(this.state.fileList);
} else { } else {
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }