调整参数

dev_aliyun_beta
杨树明 6 years ago
parent 0b43367fa9
commit 672fcd61de

@ -186,23 +186,26 @@ class BoardsNew extends Component{
});
}
onAttachmentRemove = (file) => {
confirm({
// title: '确定要删除这个附件吗?',
title: '是否确认删除?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
if(file.response!=undefined){
confirm({
// title: '确定要删除这个附件吗?',
title: '是否确认删除?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
return false;
}
deleteAttachment = (file) => {
// 初次上传不能直接取uid

@ -88,21 +88,24 @@ class GraduationTasksappraiseMainEditor extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file, stateName) => {
this.props.confirm({
content: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
if(file.response!=undefined){
this.props.confirm({
content: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
return false;
}
deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid

@ -148,39 +148,42 @@ class GraduationTasksedit extends Component{
}
onAttachmentRemove = (file) => {
// debugger
this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
if ( response.data.status === 0) {
this.setState({
Modalstype:false,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,
})
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
if(file.response!=undefined){
// debugger
this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
if ( response.data.status === 0) {
this.setState({
Modalstype:false,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,
})
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
}
Commoninterface=(fileList)=>{

@ -215,19 +215,23 @@ class GraduateTopicNew extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
deleteAttachment = (file) => {
console.log(file);

@ -163,21 +163,25 @@ class GraduateTopicPostWorksNew extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
return false;
}
deleteAttachment = (file) => {
const url = `/attachments/${file.id}.json`

@ -561,21 +561,24 @@ class MemoNew extends Component {
}
}
onAttachmentRemove = (file) => {
this.props.confirm({
// title: '确定要删除这个附件吗?',
content: '是否确认删除?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
if(file.response!=undefined){
this.props.confirm({
// title: '确定要删除这个附件吗?',
content: '是否确认删除?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
deleteAttachment = (file) => {
// 初次上传不能直接取uid

@ -47,16 +47,19 @@ class CaseNew extends Component{
// 上传附件-删除确认框
onAttachmentRemove = (file, stateName) => {
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
// 上传附件-确认删除

Loading…
Cancel
Save