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,57 +726,78 @@ 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){
url=`/item_baskets/${id}.json`; if(Undoclickable===true) {
axios.delete(url) Undoclickable = false;
.then((result) => { url = `/item_baskets/${id}.json`;
if (result.data.status == 0) { axios.delete(url)
// this.props.showNotification(`撤销成功`); .then((result) => {
var data = { if (result.data.status == 0) {
discipline_id:this.state.discipline_id, // this.props.showNotification(`撤销成功`);
sub_discipline_id:this.state.sub_discipline_id, var data = {
tag_discipline_id:this.state.tag_discipline_id, discipline_id: this.state.discipline_id,
public: this.state.defaultActiveKey, sub_discipline_id: this.state.sub_discipline_id,
difficulty: this.state.difficulty, tag_discipline_id: this.state.tag_discipline_id,
item_type: this.state.item_type, public: this.state.defaultActiveKey,
keyword: this.state.keywords, difficulty: this.state.difficulty,
page: this.state.page, item_type: this.state.item_type,
per_page:10, keyword: this.state.keywords,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), page: this.state.page,
}; per_page: 10,
this.getdatasy(data); exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
this.getbasket_listdata(); };
} this.getdatasy(data);
}).catch((error) => { this.getbasket_listdata();
////console.log(error); }
}) setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}
}else{ }else{
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`; if(Undoclickable===true) {
axios.delete(url,{ data: { Undoclickable = false;
item_id:id===undefined?"":parseInt(id), url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
}}) axios.delete(url, {
.then((result) => { data: {
if (result.data.status == 0) { item_id: id === undefined ? "" : parseInt(id),
// this.props.showNotification(`撤销成功`); }
var data = { })
discipline_id:this.state.discipline_id, .then((result) => {
sub_discipline_id:this.state.sub_discipline_id, if (result.data.status == 0) {
tag_discipline_id:this.state.tag_discipline_id, // this.props.showNotification(`撤销成功`);
public: this.state.defaultActiveKey, var data = {
difficulty: this.state.difficulty, discipline_id: this.state.discipline_id,
item_type: this.state.item_type, sub_discipline_id: this.state.sub_discipline_id,
keyword: this.state.keywords, tag_discipline_id: this.state.tag_discipline_id,
page: this.state.page, public: this.state.defaultActiveKey,
per_page:10, difficulty: this.state.difficulty,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), item_type: this.state.item_type,
}; keyword: this.state.keywords,
this.getdatasy(data); page: this.state.page,
this.getbasket_listdata(); per_page: 10,
} exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}).catch((error) => { };
////console.log(error); this.getdatasy(data);
}) this.getbasket_listdata();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((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(()=>{
Undoclickable=true;
},1000);
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
setTimeout(()=>{ setTimeout(()=>{

Loading…
Cancel
Save