|
|
|
@ -546,6 +546,7 @@ class Newshixuns extends Component {
|
|
|
|
|
// const { id } = response.data;
|
|
|
|
|
// if (id) {
|
|
|
|
|
if(this.state.file !== undefined){
|
|
|
|
|
console.log("549");
|
|
|
|
|
this.deleteAttachment(this.state.file);
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
@ -577,6 +578,7 @@ class Newshixuns extends Component {
|
|
|
|
|
postapplyvisible: false,
|
|
|
|
|
})
|
|
|
|
|
if(this.state.file !== undefined){
|
|
|
|
|
console.log("580");
|
|
|
|
|
this.deleteAttachment(this.state.file);
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
@ -662,6 +664,7 @@ class Newshixuns extends Component {
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
// content: 'Some descriptions',
|
|
|
|
|
onOk: () => {
|
|
|
|
|
console.log("665")
|
|
|
|
|
this.deleteAttachment(file)
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
@ -671,7 +674,7 @@ class Newshixuns extends Component {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
deleteAttachment = (file) => {
|
|
|
|
|
// console.log(file);
|
|
|
|
|
console.log(file);
|
|
|
|
|
let id=file.response ==undefined ? file.id : file.response.id
|
|
|
|
|
const url = `/attachments/${id}.json`
|
|
|
|
|
axios.delete(url, {
|
|
|
|
@ -760,6 +763,7 @@ class Newshixuns extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(thiss.state.file !== undefined){
|
|
|
|
|
console.log("763")
|
|
|
|
|
thiss.deleteAttachment(thiss.state.file);
|
|
|
|
|
thiss.setState({
|
|
|
|
|
file:file
|
|
|
|
|