competitions
杨树林 5 years ago
parent f5059130b6
commit edf4973717

@ -10,7 +10,8 @@ class SendTopics extends Component{
search:null,
Radiolist:undefined,
showcheck:false,
smallisSpin:false
smallisSpin:false,
yslbanksMenu:undefined
}
}
@ -18,8 +19,13 @@ class SendTopics extends Component{
componentDidMount(){
// console.log("SendTopicssssss");
// console.log(this.props);
let{search}=this.state;
this.onupdatalist(search)
this.setState({
yslbanksMenu:this.props.banksMenu,
})
}
onupdatalist=(search)=>{
@ -49,6 +55,8 @@ class SendTopics extends Component{
onChange=(e)=>{
console.log("SendTopics");
console.log(e);
this.setState({
Radiolist:e.target.value
})
@ -78,9 +86,35 @@ class SendTopics extends Component{
smallisSpin:false
})
if(result.data.status===0){
this.props.showNotification(result.data.message)
this.props.topicscancelmodel()
this.props.showNotification(result.data.message);
this.props.topicscancelmodel();
// result.data.task_ids;
try {
this.props.updataslist()
}catch (e) {
}
try {
var rurls="";
if(this.state.yslbanksMenu.category==="normal"){
//普通作业
rurls=`/courses/${this.state.Radiolist}/common_homeworks/${result.data.task_ids}/list`;
}else if(this.state.yslbanksMenu.category==="group"){
//分组作业
rurls=`/courses/${this.state.Radiolist}/group_homeworks/${result.data.task_ids}/list`;
}else if(this.state.yslbanksMenu.category==="exercise"){
// 试卷
rurls=`/courses/${this.state.Radiolist}/exercises/${result.data.task_ids}/student_exercise_list?tab=0`;
}else if(this.state.yslbanksMenu.category==="poll") {
//问卷
rurls=`/courses/${this.state.Radiolist}/polls/${result.data.task_ids}/detail`
}
window.open(rurls,'_blank');
}catch (e) {
}
}else{
this.props.showNotification(result.data.message)
}

@ -25,7 +25,10 @@ class BanksMenu extends Component{
})
}
componentDidMount() {
debugger
// var thestring=this.props;
// var yslarr=thestring.split("/");
// console.log(yslarr);
try {
const query = this.props.location.search;
const type = query.split('?tab=');
@ -160,8 +163,9 @@ class BanksMenu extends Component{
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
{
banksMenu.menuArray && banksMenu.menuArray.map((item,key)=>{
console.log("BanksMenu");
console.log(item);
// console.log("BanksMenussss");
// console.log(this.props);
// console.log(this.props.content);
return(
<Menu.Item key={key}><Link to={`${item.to}`}>{item.content}</Link></Menu.Item>
)

Loading…
Cancel
Save