|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import React, {Component} from "react";
|
|
|
|
|
import {Link, NavLink} from 'react-router-dom';
|
|
|
|
|
import {WordsBtn, ActionBtn} from 'educoder';
|
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import {
|
|
|
|
|
notification
|
|
|
|
@ -21,6 +22,9 @@ class Generaljobbankdetails extends Component {
|
|
|
|
|
// this.answerMdRef = React.createRef();
|
|
|
|
|
this.state = {
|
|
|
|
|
tab: ["0"],
|
|
|
|
|
workid:1,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
datas:[],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -53,48 +57,71 @@ class Generaljobbankdetails extends Component {
|
|
|
|
|
// 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,i) {
|
|
|
|
|
if(i===1){
|
|
|
|
|
child.daochushixunbaogao();
|
|
|
|
|
}
|
|
|
|
|
if(i===2){
|
|
|
|
|
child.daochuzuoye();
|
|
|
|
|
console.log("Generaljobbankdetails");
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
if( this.props.match.params.workid){
|
|
|
|
|
this.setState({
|
|
|
|
|
workid: this.props.match.params.workid,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.getdata(this.props.match.params.workid);
|
|
|
|
|
}
|
|
|
|
|
//获取数据的地方
|
|
|
|
|
getdata=(workid)=>{
|
|
|
|
|
var workids= workid;
|
|
|
|
|
if(workids){
|
|
|
|
|
|
|
|
|
|
homeworkendss(child){
|
|
|
|
|
// child.homeworkends();
|
|
|
|
|
}else{
|
|
|
|
|
workids=this.state.workid;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true,
|
|
|
|
|
})
|
|
|
|
|
let url = `/homework_banks/${workids}.json`;
|
|
|
|
|
//
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.data){
|
|
|
|
|
this.setState({
|
|
|
|
|
datas:response.data.informs,
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
this.setState({
|
|
|
|
|
datas:[],
|
|
|
|
|
|
|
|
|
|
homeworkstarts(child){
|
|
|
|
|
// child.homeworkstart();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
workshowmodels(child){
|
|
|
|
|
// child.workshowmodel();
|
|
|
|
|
}else {
|
|
|
|
|
this.setState({
|
|
|
|
|
datas:[],
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:false,
|
|
|
|
|
})
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
this.setState({
|
|
|
|
|
datas:[],
|
|
|
|
|
isSpin:false,
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/// 确认是否下载
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bindRef = ref => { this.child = ref }
|
|
|
|
|
///////////////教师截止
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
|
|
|
|
|
let {tab} = this.state;
|
|
|
|
|
|
|
|
|
|
const isAdmin = this.props.isAdmin();
|
|
|
|
|
// console.log(119)
|
|
|
|
|
console.log(jobsettingsdatapage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
@ -132,10 +159,10 @@ class Generaljobbankdetails extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{parseInt(tab) === 0 ? <Generaljobdetails/>:""}
|
|
|
|
|
{parseInt(tab) === 1 ? <Generaljobanswer/>:""}
|
|
|
|
|
|
|
|
|
|
<Spin size="large" spinning={this.state.isSpin} id={"cdiv"}>
|
|
|
|
|
{parseInt(tab) === 0 ? <Generaljobdetails {...this.props} {...this.state}/> :""}
|
|
|
|
|
{parseInt(tab) === 1 ? <Generaljobanswer{...this.props} {...this.state}/>:""}
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|