mast_item_banktwo
杨树林 5 years ago
parent af26a97137
commit d98cda09f7

@ -258,16 +258,10 @@ export function initAxiosInterceptors(props) {
}
//
// console.log(config);
if (config.method === "post") {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
if (requestMap[config.url] === true) {
return false;
}
}
// 非file_update请求
// // 非file_update请求
if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true;

@ -22,6 +22,7 @@ import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars";
import QuestionModalys from "./component/QuestionModalys";
var Undoclickable=true;
class Question extends Component {
constructor(props) {
super(props);
@ -69,6 +70,9 @@ class Question extends Component {
isVisible: false,
selectionbools:false,
chakanjiexiboolindex:"无",
}
}
@ -287,7 +291,10 @@ class Question extends Component {
})
this.getdataslen(response.data.items);
// Undoclickable=true;
}).catch((error) => {
// Undoclickable=true;
});
}
@ -634,6 +641,7 @@ class Question extends Component {
single_questions_count: result.data.single_questions_count,
subjective_questions_count: result.data.subjective_questions_count,
})
// Undoclickable=true;
}).catch((error) => {
// ////console.log(error);
@ -646,6 +654,7 @@ class Question extends Component {
single_questions_count: 0,
subjective_questions_count: 0,
})
// Undoclickable=true;
})
}
@ -683,30 +692,49 @@ class Question extends Component {
}
// 撤销
getitem_basketss=(id)=>{
//选用题型可以上传单个 或者多个题型
let url=`/item_baskets/${id}.json`;
this.setState({
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,
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
})
if(Undoclickable===true){
Undoclickable=false;
//选用题型可以上传单个 或者多个题型
let 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,
};
this.getdatasy(data);
this.getbasket_listdata();
setTimeout(()=>{
Undoclickable=true;
},1000);
}
}).catch((error) => {
////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}else{
return
}
}
//全选试题库
selectallquestionsonthispage=()=>{

@ -588,7 +588,7 @@ class Questionitem_banks extends Component {
""
:
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
}
</div>
)

Loading…
Cancel
Save