附件删除问题

dev_hss
caicai8 6 years ago
parent e307ee9927
commit c88aafa0c5

@ -84,8 +84,10 @@ class GraduationTasksappraiseMainEditor extends Component{
componentDidMount(){ componentDidMount(){
} }
handleUploadChange = (info) => { handleUploadChange = (info) => {
let fileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ fileList }); let fileList = info.fileList;
this.setState({ fileList });
}
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){

@ -103,7 +103,7 @@ class GraduationTasksedit extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading"){ if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
// console.log(fileList) // console.log(fileList)
// for(var list of fileList ){ // for(var list of fileList ){

@ -159,8 +159,10 @@ class GraduateTopicPostWorksNew extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ fileList }); let fileList = info.fileList;
this.setState({ fileList });
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){

@ -1373,14 +1373,15 @@ export default class TPMsettings extends Component {
} }
handleChange = (info) => { handleChange = (info) => {
console.log("handleChange1"); if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList}=this.state; console.log("handleChange1");
if(fileList.length===0){ let {fileList}=this.state;
let fileLists = info.fileList; if(fileList.length===0){
this.setState({ fileList:fileLists, let fileLists = info.fileList;
deleteisnot:false}); this.setState({ fileList:fileLists,
deleteisnot:false});
}
} }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {

@ -760,15 +760,17 @@ class Newshixuns extends Component {
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let {fileList}=this.state; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1"); let {fileList}=this.state;
if(fileList.length===0){ console.log("handleChange1");
if(fileList.length===0){
let fileLists = info.fileList; let fileLists = info.fileList;
this.setState({ this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList), // fileList:appendFileSizeToUploadFileAll(fileList),
fileList:fileLists, fileList:fileLists,
deleteisnot:false}); deleteisnot:false});
} }
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {

Loading…
Cancel
Save