|
|
|
@ -39,6 +39,7 @@ class Question extends Component {
|
|
|
|
|
visiblemyss:false,
|
|
|
|
|
item_type:null,
|
|
|
|
|
keyword:null,
|
|
|
|
|
timuid:null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -131,20 +132,23 @@ class Question extends Component {
|
|
|
|
|
this.container = container;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
showmodels=()=>{
|
|
|
|
|
showmodels=(id)=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsType:true,
|
|
|
|
|
titilesm:"设为公开后,所有成员均可使用试题",
|
|
|
|
|
titiless:"是否设置为公开?",
|
|
|
|
|
titbool:false
|
|
|
|
|
titbool:true,
|
|
|
|
|
timuid:id
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
showmodelysl=()=>{
|
|
|
|
|
showmodelysl=(id)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsType:true,
|
|
|
|
|
titilesm:"确认删除后,无法撤销",
|
|
|
|
|
titiless:"是否确认删除?",
|
|
|
|
|
titbool:false
|
|
|
|
|
titbool:false,
|
|
|
|
|
timuid:id
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -156,6 +160,14 @@ class Question extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
setDownload=()=>{
|
|
|
|
|
//确认
|
|
|
|
|
if(this.state.titbool===true){
|
|
|
|
|
//公开
|
|
|
|
|
this.publicopentimu(this.state.timuid);
|
|
|
|
|
}else {
|
|
|
|
|
// 删除
|
|
|
|
|
this.deletetimu(this.state.timuid);
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsType:false
|
|
|
|
|
})
|
|
|
|
@ -246,6 +258,34 @@ class Question extends Component {
|
|
|
|
|
|
|
|
|
|
this.getdata(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deletetimu=(id)=>{
|
|
|
|
|
|
|
|
|
|
const url = `/item_banks/${id}.json`;
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification('删除试题成功')
|
|
|
|
|
// props.history.push(response.data.right_url)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
publicopentimu=(id)=>{
|
|
|
|
|
|
|
|
|
|
const url = `/item_banks/${id}/set_public.json`;
|
|
|
|
|
axios.post(url)
|
|
|
|
|
.then((result) => {
|
|
|
|
|
if (result.data.status == 0) {
|
|
|
|
|
this.props.showNotification(`公开题目成功`);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let {page,limit,count,Headertop,visible,placement,modalsType}=this.state;
|
|
|
|
|
return (
|
|
|
|
@ -266,8 +306,8 @@ class Question extends Component {
|
|
|
|
|
setitem_types={(e)=>this.setitem_types(e)}
|
|
|
|
|
handleVisibleChange={(e)=>this.handleVisibleChange(e)}
|
|
|
|
|
setdifficulty={(e)=>this.setdifficulty(e)}
|
|
|
|
|
showmodels={()=>this.showmodels()}
|
|
|
|
|
showmodelysl={()=>this.showmodelysl()}
|
|
|
|
|
showmodels={(e)=>this.showmodels(e)}
|
|
|
|
|
showmodelysl={(e)=>this.showmodelysl(e)}
|
|
|
|
|
callback={(e)=>this.callback(e)}></Contentpart>
|
|
|
|
|
{/*分页*/}
|
|
|
|
|
{/*<div className="clearfix mt5">*/}
|
|
|
|
|