Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
杨树明 6 years ago
commit fddba8ffcc

@ -970,7 +970,7 @@ class GamesController < ApplicationController
game.update_attribute(:status, 0) if game.status == 1 game.update_attribute(:status, 0) if game.status == 1
game.update_attributes(status: 0, open_time: Time.now) if game.status == 3 game.update_attributes(status: 0, open_time: Time.now) if game.status == 3
# 开启实训更新myshixuns的时间方便跟踪用于的学习进度。 # 开启实训更新myshixuns的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:update_at, Time.now) game.myshixun.update_column(:updated_at, Time.now)
end end
end end

@ -81,22 +81,19 @@ class CoursesNew extends Component {
is_public: data.is_public === 1 ? true : false, is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication, Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification, Professionalcertification:data.professional_certification,
checkbofrups:data.course_modules, // checkbofrups:data.course_modules,
}); });
try { // try {
if(data.course_modules===undefined||data.course_modules.length===0){ // if(data.course_modules===undefined||data.course_modules.length===0){
this.setState({ // this.setState({
checkbofrups:this.state.checkbofrup, // checkbofrups:this.state.checkbofrup,
}); // });
} // }
}catch (e) { // }catch (e) {
this.setState({ // this.setState({
checkbofrups:this.state.checkbofrup, // checkbofrups:this.state.checkbofrup,
}); // });
} // }
this.handleSearchschool(data.school); this.handleSearchschool(data.school);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -464,7 +461,7 @@ class CoursesNew extends Component {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
} }
render() { render() {
let {datatime,school,searchlistscholl,checkbofrups} = this.state; let {datatime,school,searchlistscholl} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props) const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form delete propsWithoutForm.form
@ -705,23 +702,6 @@ class CoursesNew extends Component {
"shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group", "shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group",
], ],
})( })(
this.props.match.params.coursesId != undefined?
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
{
checkbofrups===undefined?"":checkbofrups.length===0?"":checkbofrups.map((item,key)=>{
return(
item.module_type==="announcement"?
""
:
item.module_type==="online_learning"?
""
:
<Checkbox key={key} value={item.module_type} className="fl">{item.module_name}</Checkbox>
)
})
}
</Checkbox.Group>
:
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}> <Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox> <Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox> <Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>

@ -144,20 +144,18 @@ class Goldsubject extends Component {
course_module_types: data.course_module_types, course_module_types: data.course_module_types,
school:data.school, school:data.school,
Whethertocreateanewclassroom:false, Whethertocreateanewclassroom:false,
checkbofrups:data.course_modules,
}); });
// try {
try { // if(data.course_modules===undefined||data.course_modules.length===0){
if(data.course_modules===undefined||data.course_modules.length===0){ // this.setState({
this.setState({ // checkbofrups:this.state.checkbofrup,
checkbofrups:this.state.checkbofrup, // });
}); // }
} // }catch (e) {
}catch (e) { // this.setState({
this.setState({ // checkbofrups:this.state.checkbofrup,
checkbofrups:this.state.checkbofrup, // });
}); // }
}
this.handleSearchschool(data.school); this.handleSearchschool(data.school);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -609,7 +607,7 @@ class Goldsubject extends Component {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
} }
render() { render() {
let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom,checkbofrups} = this.state; let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props) const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form delete propsWithoutForm.form
@ -884,25 +882,6 @@ class Goldsubject extends Component {
"announcement","online_learning","shixun_homework","common_homework", "announcement","online_learning","shixun_homework","common_homework",
], ],
})( })(
this.props.match.params.coursesId != undefined?
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
{
checkbofrups===undefined?"":checkbofrups.length===0?"":checkbofrups.map((item,key)=>{
return(
item.module_type==="announcement"?
<Checkbox value={"announcement"} className="fl" defaultChecked disabled>公告栏</Checkbox>
:
item.module_type==="online_learning"?
<Checkbox value={"online_learning"} className="fl" defaultChecked disabled>在线学习</Checkbox>
:
item.module_type==="graduation"?"":
item.module_type==="group_homework"?"":
<Checkbox key={key} value={item.module_type} className="fl">{item.module_name}</Checkbox>
)
})
}
</Checkbox.Group>
:
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}> <Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"announcement"} className="fl" defaultChecked disabled>公告栏</Checkbox> <Checkbox value={"announcement"} className="fl" defaultChecked disabled>公告栏</Checkbox>
<Checkbox value={"online_learning"} className="fl" defaultChecked disabled>在线学习</Checkbox> <Checkbox value={"online_learning"} className="fl" defaultChecked disabled>在线学习</Checkbox>

Loading…
Cancel
Save