dev_aliyun_beta
杨树林 6 years ago
parent 17efffcaa3
commit b63e0a9d68

@ -18,17 +18,67 @@ class Completetaskpage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
// this.answerMdRef = React.createRef(); // this.answerMdRef = React.createRef();
this.setState({
workid:1,
isSpin:false,
datas:[],
})
} }
componentDidMount() { componentDidMount() {
// console.log("父组件加载框"); // console.log("父组件加载框");
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){
}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:[],
})
}
}else {
this.setState({
datas:[],
})
}
this.setState({
isSpin:false,
})
}).catch((error) => {
console.log(error)
this.setState({
datas:[],
isSpin:false,
})
});
} }

@ -1,6 +1,7 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn} from 'educoder';
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import axios from 'axios'; import axios from 'axios';
import { import {
notification notification
@ -18,29 +19,68 @@ class CompletetopicdePage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
// this.answerMdRef = React.createRef(); // this.answerMdRef = React.createRef();
this.setState({
workid:1,
isSpin:false,
datas:[],
})
} }
componentDidMount() { componentDidMount() {
// console.log("父组件加载框"); 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;
homeworkendss(child){ if(workids){
// 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:[],
})
}
}else {
this.setState({
datas:[],
})
}
this.setState({
isSpin:false,
})
}).catch((error) => {
console.log(error)
this.setState({
datas:[],
isSpin:false,
})
});
} }
homeworkstarts(child){
// child.homeworkstart();
}
workshowmodels(child){
// child.workshowmodel();
}
/// 确认是否下载 /// 确认是否下载

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

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

Loading…
Cancel
Save