dev_aliyun2
杨树林 6 years ago committed by harry
parent 87dcbd9a20
commit 8fe085112d

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

@ -710,10 +710,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