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,46 +95,63 @@ 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;
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
shixunsreplaces:true,
hidestartshixunsreplacevalues:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessages:response.data.message,
startshixunCombattypes:true,
})
} else {
console.log("开始学习了");
window.open("/tasks/" + response.data.game_identifier,'_blank');
//这个是传过来 调用刷新
this.Myreload();
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
});
break;
}
console.log("这是"+i);
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({
shixunsreplaces:true,
hidestartshixunsreplacevalues:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessages:response.data.message,
startshixunCombattypes:true,
})
} else {
console.log("开始学习了");
window.open("/tasks/" + response.data.game_identifier,'_blank');
//这个是传过来 调用刷新
this.Myreload();
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
});
}
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
};
console.log("327");
console.log(datasysl);
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
};
console.log("提交的ysldatas数据");
console.log(ysldatas);
console.log(JSON.stringify(ysldatas));
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