import React, {Component} from "react"; 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"; import Startshixuntask from "../coursesPublic/Startshixuntask"; class ShixunHomeworkPage extends Component { constructor(props) { super(props); this.state = { tab: ["0"], jobsettingsdata: undefined, teacherdata: undefined, code_review: false, view_report: false, } } //切换tab ChangeTab = (e) => { // console.log(e); this.setState({ tab: e }) try { var currenturl = window.location.href; var newUrl = (currenturl.split("?"))[0]; window.history.pushState('','',newUrl+'?tab='+e); }catch (e) { console.log(e); console.log("44"); } } Getdataback = (jobsettingsdata, teacherdata) => { this.setState({ jobsettingsdata: jobsettingsdata, teacherdata: teacherdata, code_review: teacherdata.code_review, view_report: teacherdata.view_report, }) } componentDidMount() { const query = this.props.location.search; const type = query.split('?tab='); // let sum = [] // sum.push(type[1]) // console.log("componentDidMountcomponentDidMount"); console.log(type); this.setState({ tab: type[1], }) let querys = this.props.location.pathname; const types = querys.split('/'); console.log(types); this.setState({ shixuntypes: types[3] }) } render() { let {tab, jobsettingsdata, teacherdata} = this.state; const isAdmin = this.props.isAdmin(); return (