删除调整

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

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

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

Loading…
Cancel
Save