import React,{ Component } from "react"; import CoursesListType from '../coursesPublic/CoursesListType'; import { WordsBtn } from 'educoder'; import {Tooltip,message,Modal} from 'antd'; import {Link} from 'react-router-dom'; import axios from 'axios'; import Modals from '../../modals/Modals'; import Associationmodel from '../coursesPublic/Associationmodel'; import ModalsRename from '../coursesPublic/ModalsRename'; // import '../../css/members.css' import './style.css' class ShixunhomeWorkItem extends Component{ constructor(props){ super(props); this.state = { props:props, modalname:"关联项目", visible:false, startbtn:false, code_review:false } // console.log("获取到this.propssssssssssss") // console.log(this.props) } componentDidMount() { let query = this.props.location.pathname; const type = query.split('/'); this.setState({ shixuntypes:type[3] }) } componentDidUpdate = (prevProps) => { if(prevProps.location.pathname != this.props.location.pathname){ let query = this.props.location.pathname; const type = query.split('/'); this.setState({ shixuntypes:type[3] }) } } Cancel=()=>{ this.setState({ visible:false }) } taskoperationId=(list)=>{ this.setState({ startbtn:true, }) let url= list+".json"; axios.get(url).then((response) => { if(response.status===200){ if(response.data.status===-2){ this.setState({ startbtn:false, shixunsreplace:true, hidestartshixunsreplacevalue:response.data.message+".json" }) }else if(response.data.status===-1){ console.log(response) }else if(response.data.status===-3){ this.setState({ shixunsmessage:response.data.message, startshixunCombattype:true, startbtn:false }) }else{ if(response.data.status!=401&&response.data.status!=403){ const w=window.open('about:blank'); w.location.href= "/tasks/"+response.data.game_identifier } } } }).catch((error) => { this.setState({ startbtn:false }) }); } hidestartshixunsreplace=(url)=>{ axios.get(url).then((response) => { if(response.status===200){ this.setState({ shixunsreplace:false }) message.success('重置成功,正在进入实训!'); let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; this.props.history.push(path); }} ).catch((error) => { this.setState({ startbtn:false, shixunsreplace:false }) }); } hidestartshixunCombattype=()=>{ this.setState({ startshixunCombattype:false }) } editname = (name,id) => { this.setState({ ModalsRenametype:true, NavmodalValue:name, Navmodalname:"重命名", url:`/homework_commons/${id}/alter_name.json` }) } cannerNavmoda=()=>{ this.setState({ ModalsRenametype:false, }) } render(){ let { Modalstype, Modalstopval, Modalsbottomval, cardsModalcancel, cardsModalsavetype, loadtype, modalname, visible, shixunsreplace, hidestartshixunsreplacevalue, startshixunCombattype, shixunsmessage, startbtn, } = this.state; const { checkBox, discussMessage, taskid, } = this.props; // // allow_late: true //是否开启补交 // homework_id: 9250 // shixun_identifier: "25ykhpvl" // // console.log("this.props.isAdmin"); return(
实训已经更新了,正在为您重置!
本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战
*/} {/*知道了*/} {/*
*/}
{/* {discussMessage.author.name} */}
{discussMessage.commit_count===undefined?"":{discussMessage.commit_count} 已交}
{discussMessage.uncommit_count===undefined?"":{discussMessage.uncommit_count} 未交}
{/*{discussMessage.replies_count} 3 未评*/}