dev_forum
parent
896cc174cc
commit
432dea42a3
@ -0,0 +1,143 @@
|
||||
import React,{ Component } from "react";
|
||||
import {Checkbox,Input,Table, Pagination,Menu} from "antd";
|
||||
import {Link,NavLink} from 'react-router-dom';
|
||||
import { WordsBtn ,ActionBtn} from 'educoder';
|
||||
import axios from 'axios';
|
||||
import '../css/members.css';
|
||||
import "../common/formCommon.css";
|
||||
import '../css/Courses.css';
|
||||
import './style.css';
|
||||
import '../css/busyWork.css'
|
||||
import '../poll/pollStyle.css'
|
||||
import Listofworks from "./Listofworks";
|
||||
import Listofworksstudentone from './Listofworksstudentone'
|
||||
import Trainingjobsetting from './Trainingjobsetting'
|
||||
import Workquestionandanswer from './Workquestionandanswer'
|
||||
import CoursesListType from '../coursesPublic/CoursesListType';
|
||||
import ShixunStudentWork from "./ShixunStudentWork";
|
||||
|
||||
class ShixunHomeworkPage extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
tab:["0"],
|
||||
jobsettingsdata:undefined,
|
||||
teacherdata:undefined,
|
||||
}
|
||||
|
||||
}
|
||||
//切换tab
|
||||
ChangeTab=(e)=>{
|
||||
console.log(e);
|
||||
this.setState({
|
||||
tab:e
|
||||
})
|
||||
}
|
||||
Getdataback = (jobsettingsdata,teacherdata)=>{
|
||||
this.setState({
|
||||
jobsettingsdata:jobsettingsdata,
|
||||
teacherdata:teacherdata,
|
||||
})
|
||||
}
|
||||
componentDidMount() {
|
||||
const query =this.props.location.search;
|
||||
const type = query.split('?tab=');
|
||||
// let sum = []
|
||||
// sum.push(type[1])
|
||||
// console.log("componentDidMountcomponentDidMount");
|
||||
// console.log(sum);
|
||||
this.setState({
|
||||
tab:type,
|
||||
})
|
||||
let querys = this.props.location.pathname;
|
||||
const types = querys.split('/');
|
||||
this.setState({
|
||||
shixuntypes: types[3]
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
let {tab,jobsettingsdata,teacherdata}=this.state;
|
||||
const isAdmin =this.props.isAdmin();
|
||||
return (
|
||||
<div className="newMain clearfix " >
|
||||
<div className={"educontent mb20"} style={{width:"1200px"}}>
|
||||
|
||||
<div className="educontent mb20">
|
||||
<p className="clearfix mb20 mt10">
|
||||
<ActionBtn className=" btn colorgrey fl hovercolorblue "
|
||||
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<ActionBtn
|
||||
className=" btn colorgrey fl hovercolorblue "
|
||||
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<WordsBtn className="fl">作业详情</WordsBtn>
|
||||
</p>
|
||||
</div>
|
||||
<div className="educontent mb20">
|
||||
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
|
||||
{teacherdata === undefined ? "" : teacherdata.homework_name}
|
||||
</p>
|
||||
<CoursesListType
|
||||
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
|
||||
/>
|
||||
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
|
||||
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>
|
||||
<a className="color-grey-9 fr font-16 mr20"
|
||||
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}
|
||||
target={"_blank"}>实训详情</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{
|
||||
// 教师列表
|
||||
parseInt(tab)===0 ? (isAdmin===true ?
|
||||
<Listofworks {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworks>
|
||||
:
|
||||
<Listofworksstudentone {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworksstudentone>)
|
||||
:
|
||||
parseInt(tab)===1 ?<Workquestionandanswer {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Workquestionandanswer>
|
||||
:
|
||||
parseInt(tab)===2? <ShixunStudentWork {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></ShixunStudentWork>
|
||||
:
|
||||
<Trainingjobsetting {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Trainingjobsetting>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ShixunHomeworkPage;
|
||||
|
||||
// <div className="edu-back-white mt10" >
|
||||
// <div className="stud-class-set bor-bottom-greyE ">
|
||||
// <div className=" clearfix edu-back-white pl30 pr30">
|
||||
// <div className="fl task_menu_ul">
|
||||
// {this.props.isAdmin() === true ?
|
||||
//
|
||||
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
|
||||
// <Menu.Item key="0">作品列表</Menu.Item>
|
||||
// <Menu.Item key="1">作业回答</Menu.Item>
|
||||
// <Menu.Item key="2">代码查重</Menu.Item>
|
||||
// <Menu.Item key="3">设置</Menu.Item>
|
||||
// </Menu>
|
||||
// :
|
||||
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
|
||||
// <Menu.Item key="0">作品列表</Menu.Item>
|
||||
// <Menu.Item key="1">作业回答</Menu.Item>
|
||||
// <Menu.Item key="2">代码查重</Menu.Item>
|
||||
// </Menu>
|
||||
// }
|
||||
//
|
||||
// </div>
|
||||
// </div>
|
||||
{/* </div>*/}
|
||||
|
||||
|
||||
|
||||
|
||||
{/*</div>*/}
|
Loading…
Reference in new issue