import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; import {WordsBtn, ActionBtn} from 'educoder'; import axios from 'axios'; import { notification } from "antd"; import '../css/members.css'; import "../common/formCommon.css"; import '../css/Courses.css'; import './style.css'; import '../css/busyWork.css'; import '../poll/pollStyle.css'; 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"; import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; import DownloadMessageysl from "../../modals/DownloadMessageysl"; class ShixunHomeworkPage extends Component { constructor(props) { super(props); // this.answerMdRef = React.createRef(); this.state = { tab: ["0"], jobsettingsdata: undefined, teacherdata: undefined, code_review: false, view_report: false, visible: false, showmodel:false, child:undefined, DownloadType:false, DownloadMessageval:undefined, } } //切换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) => { console.log("56"); console.log(jobsettingsdata); console.log(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] }) } // confirmysl(child,url) { // confirmysl(url); // } homeworkendss(child){ child.homeworkends(); } homeworkstarts(child){ child.homeworkstart(); } workshowmodels(child){ child.workshowmodel(); } /// 确认是否下载 confirmysl(url){ axios.get(url).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ if(response.data.messages === "100"){ // 已超出文件导出的上限数量(100 ),建议: this.setState({ DownloadType:true, DownloadMessageval:100 }) }else { //因附件资料超过500M this.setState({ DownloadType:true, DownloadMessageval:500 }) } }else { this.props.showNotification(`正在下载中`); window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) }); } Downloadcal=()=>{ this.setState({ DownloadType:false, DownloadMessageval:undefined }) } bindRef = ref => { this.child = ref } ///////////////教师截止 render() { let {tab, teacherdata, jobsettingsdata} = this.state; const isAdmin = this.props.isAdmin(); return (