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

@ -18,17 +18,67 @@ class Completetaskpage extends Component {
constructor(props) {
super(props);
// this.answerMdRef = React.createRef();
this.setState({
workid:1,
isSpin:false,
datas:[],
})
}
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;
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 {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
@ -18,29 +19,68 @@ class CompletetopicdePage extends Component {
constructor(props) {
super(props);
// this.answerMdRef = React.createRef();
this.setState({
workid:1,
isSpin:false,
datas:[],
})
}
componentDidMount() {
// console.log("父组件加载框");
if( this.props.match.params.workid){
this.setState({
workid: this.props.match.params.workid,
})
}
this.getdata(this.props.match.params.workid);
}
homeworkendss(child){
// child.homeworkends();
//获取数据的地方
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,
})
});
}
homeworkstarts(child){
// child.homeworkstart();
}
workshowmodels(child){
// child.workshowmodel();
}
/// 确认是否下载

@ -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 GroupjobbankPage extends Component {
// this.answerMdRef = React.createRef();
this.state = {
tab: ["0"],
workid:1,
isSpin:false,
datas:[],
}
}
@ -60,41 +64,66 @@ class GroupjobbankPage extends Component {
this.setState({
shixuntypes: types[3]
})
}
confirmysl(child,i) {
if(i===1){
child.daochushixunbaogao();
}
if(i===2){
child.daochuzuoye();
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();
}
homeworkstarts(child){
// child.homeworkstart();
}
workshowmodels(child){
// child.workshowmodel();
}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,
})
});
}
/// 确认是否下载
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 +161,10 @@ class GroupjobbankPage extends Component {
</div>
</div>
</div>
<Spin size="large" spinning={this.state.isSpin} id={"cdiv"}>
{parseInt(tab) === 0 ? <Groupjobbandetails/>:""}
{parseInt(tab) === 1 ? <Groupjobquesanswer/>:""}
</Spin>
</div>
</div>
)

@ -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();
console.log("Generaljobbankdetails");
console.log(this.props);
if( this.props.match.params.workid){
this.setState({
workid: this.props.match.params.workid,
})
}
if(i===2){
child.daochuzuoye();
}
}
homeworkendss(child){
// child.homeworkends();
this.getdata(this.props.match.params.workid);
}
//获取数据的地方
getdata=(workid)=>{
var workids= workid;
if(workids){
homeworkstarts(child){
// child.homeworkstart();
}
workshowmodels(child){
// child.workshowmodel();
}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,
})
});
}
/// 确认是否下载
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>
)

Loading…
Cancel
Save