|
|
|
@ -23,6 +23,7 @@ import Bottomsubmit from "../modals/Bottomsubmit";
|
|
|
|
|
import QuestionModalys from "./component/QuestionModalys";
|
|
|
|
|
|
|
|
|
|
//exam_id 试卷的id
|
|
|
|
|
var Undoclickable=true;
|
|
|
|
|
class NewMyShixunModel extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
@ -725,57 +726,78 @@ class NewMyShixunModel extends Component {
|
|
|
|
|
}
|
|
|
|
|
// 撤销
|
|
|
|
|
getitem_basketss=(id)=>{
|
|
|
|
|
|
|
|
|
|
let url="";
|
|
|
|
|
if(this.props.exam_id===undefined){
|
|
|
|
|
url=`/item_baskets/${id}.json`;
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
.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);
|
|
|
|
|
})
|
|
|
|
|
if(Undoclickable===true) {
|
|
|
|
|
Undoclickable = false;
|
|
|
|
|
url = `/item_baskets/${id}.json`;
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
.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);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}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);
|
|
|
|
|
})
|
|
|
|
|
if(Undoclickable===true) {
|
|
|
|
|
Undoclickable = false;
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
Undoclickable=true;
|
|
|
|
|
},1000);
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
Undoclickable=true;
|
|
|
|
|
},1000);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|