dev_hs
杨树林 6 years ago
parent e8ebdeddb2
commit 3534d888ba

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message,Progress} from "antd";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message,Progress,notification} from "antd";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myelearning.css'
import axios from 'axios';
@ -95,12 +95,37 @@ class Elearning extends Component{
}else {
let {stages}=this.state;
if(stages.length>0){
var stagesdatas=[];
for(var i=0;i<stages.length;i++){
if(i===0){
var id=stages[0].shixuns_list[0].identifier;
for(var ki=0;ki<stages[i].shixuns_list.length;ki++){
if(stages[i].shixuns_list[ki].shixun_status !=="暂未公开"){
var id=stages[i].shixuns_list[ki].identifier;
console.log(id);
stagesdatas.push(id);
}
}
}
console.log(stagesdatas[0]);
if(stagesdatas.length>0){
this.kaishishixun(stagesdatas[0]);
}else {
notification.open({
message:"提示",
description: "实训暂未公开!"
});
}
console.log("这是"+i);
}
}
};
kaishishixun=(id)=>{
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
console.log("精品课堂开发学习");
console.log(response);
console.log(JSON.stringify(response));
debugger
if (response.data.status === -2) {
this.setState({
@ -126,15 +151,7 @@ class Elearning extends Component{
}).catch((error) => {
});
break;
}
console.log("这是"+i);
}
}
}
};
Startlearningtwo=()=>{
this.setState({

@ -214,7 +214,7 @@ class Goldsubject extends Component {
datatime: dateString,
});
this.props.form.setFieldsValue({
endtime: moment(dateString, dateFormat).add(1, 'days'),
endtime: moment(dateString, dateFormat),
});
}
@ -237,7 +237,7 @@ class Goldsubject extends Component {
datatimetwo: dateString,
})
this.props.form.setFieldsValue({
starttime: moment(dateString, dateFormat).add(1, 'days'),
starttime: moment(dateString, dateFormat),
});
}
@ -318,14 +318,23 @@ class Goldsubject extends Component {
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:values.starttime,
end_date: values.endtime,
start_date:moment(values.starttime).format("YYYY-MM-DD"),
end_date: moment(values.endtime).format("YYYY-MM-DD"),
is_public: this.state.is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
};
try {
console.log("327");
console.log(datasysl);
console.log(JSON.stringify(datasysl));
console.log("88887777");
console.log(moment(values.starttime).format("YYYY-MM-DD"));
console.log(moment(values.endtime).format("YYYY-MM-DD"));
}catch (e) {
}
let url = "/courses/" + coursesId + ".json";
axios.put(url,
datasysl
@ -392,15 +401,22 @@ class Goldsubject extends Component {
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:values.starttime,
end_date: values.endtime,
start_date:moment(values.starttime).format("YYYY-MM-DD"),
end_date: moment(values.endtime).format("YYYY-MM-DD"),
is_public: is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
};
try {
console.log("提交的ysldatas数据");
console.log(ysldatas);
console.log(JSON.stringify(ysldatas));
console.log(moment(values.starttime).format("YYYY-MM-DD"));
console.log(moment(values.endtime).format("YYYY-MM-DD"));
}catch (e) {
}
axios.post(url,
ysldatas
).then((response) => {

Loading…
Cancel
Save