mast_item_banktwo
杨树林 5 years ago
parent d98cda09f7
commit ffec573b33

@ -23,6 +23,7 @@ import Bottomsubmit from "../modals/Bottomsubmit";
import QuestionModalys from "./component/QuestionModalys"; import QuestionModalys from "./component/QuestionModalys";
//exam_id 试卷的id //exam_id 试卷的id
var Undoclickable=true;
class NewMyShixunModel extends Component { class NewMyShixunModel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -725,8 +726,11 @@ class NewMyShixunModel extends Component {
} }
// 撤销 // 撤销
getitem_basketss=(id)=>{ getitem_basketss=(id)=>{
let url=""; let url="";
if(this.props.exam_id===undefined){ if(this.props.exam_id===undefined){
if(Undoclickable===true) {
Undoclickable = false;
url = `/item_baskets/${id}.json`; url = `/item_baskets/${id}.json`;
axios.delete(url) axios.delete(url)
.then((result) => { .then((result) => {
@ -747,14 +751,26 @@ class NewMyShixunModel extends Component {
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); setTimeout(()=>{
Undoclickable=true;
},1000);
}) })
}
}else{ }else{
if(Undoclickable===true) {
Undoclickable = false;
url = `/examination_banks/${this.props.exam_id}/revoke_item.json`; url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: { axios.delete(url, {
data: {
item_id: id === undefined ? "" : parseInt(id), item_id: id === undefined ? "" : parseInt(id),
}}) }
})
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`); // this.props.showNotification(`撤销成功`);
@ -773,10 +789,16 @@ class NewMyShixunModel extends Component {
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); setTimeout(()=>{
Undoclickable=true;
},1000);
}) })
} }
}
} }

@ -717,10 +717,10 @@ class Question extends Component {
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
}
setTimeout(()=>{ setTimeout(()=>{
Undoclickable=true; Undoclickable=true;
},1000); },1000);
}
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
setTimeout(()=>{ setTimeout(()=>{

Loading…
Cancel
Save