|
|
|
@ -45,6 +45,8 @@ class CoursesNew extends Component {
|
|
|
|
|
fetching:false,
|
|
|
|
|
boolxinjian:false,
|
|
|
|
|
checkboxgroup:undefined,
|
|
|
|
|
addonAfteronelenone:0,
|
|
|
|
|
addonAfteronelentwo:0,
|
|
|
|
|
checkbofrup:[{module_type:"shixun_homework",module_name:"实训作业"},{module_type:"common_homework",module_name:"普通作业"},{module_type:"group_homework",module_name:"分组作业"}
|
|
|
|
|
,{module_type:"exercise",module_name:"试卷"},{module_type:"poll",module_name:"问卷"},{module_type:"graduation",module_name:"毕业设计"}
|
|
|
|
|
,{module_type:"board",module_name:"讨论"},{module_type:"attachment",module_name:"资源"},{module_type:"course_group",module_name:"分班"}],
|
|
|
|
@ -65,8 +67,8 @@ class CoursesNew extends Component {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
course: data.course_list_name,
|
|
|
|
|
classroom: data.name,
|
|
|
|
|
period: data.class_period,
|
|
|
|
|
credit: data.credit,
|
|
|
|
|
period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"",
|
|
|
|
|
credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"",
|
|
|
|
|
checkboxgroup: data.course_module_types,
|
|
|
|
|
Realnamecertification: data.authentication,
|
|
|
|
|
Professionalcertification:data.professional_certification,
|
|
|
|
@ -80,6 +82,9 @@ class CoursesNew extends Component {
|
|
|
|
|
is_public: data.is_public === 1 ? true : false,
|
|
|
|
|
Realnamecertification: data.authentication,
|
|
|
|
|
Professionalcertification:data.professional_certification,
|
|
|
|
|
addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period,
|
|
|
|
|
addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
// try {
|
|
|
|
|
// if(data.course_modules===undefined||data.course_modules.length===0){
|
|
|
|
@ -474,6 +479,16 @@ class CoursesNew extends Component {
|
|
|
|
|
// console.log(this.state);
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
// console.log(this.props.current_user);
|
|
|
|
|
var addonAfterone=this.props.form&&this.props.form.getFieldValue('period');
|
|
|
|
|
var addonAfteronelen=0;
|
|
|
|
|
if(addonAfterone){
|
|
|
|
|
addonAfteronelen=String(addonAfterone).length;
|
|
|
|
|
}
|
|
|
|
|
var addonAftertwo=this.props.form&&this.props.form.getFieldValue('credit');
|
|
|
|
|
var addonAfteronelens=0;
|
|
|
|
|
if(addonAftertwo){
|
|
|
|
|
addonAfteronelens=String(addonAftertwo).length;
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
|
@ -631,6 +646,23 @@ class CoursesNew extends Component {
|
|
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
</style>
|
|
|
|
|
<style>{
|
|
|
|
|
`
|
|
|
|
|
.yslzxueshi .ant-input{
|
|
|
|
|
border-right: none !important;
|
|
|
|
|
height: 40px !important;
|
|
|
|
|
width: 236px !important
|
|
|
|
|
}
|
|
|
|
|
.yslzxueshi .ant-input-group {
|
|
|
|
|
width: 280px !important;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.yslzxueshi .ant-input-group-addon{
|
|
|
|
|
width: 44px !important;
|
|
|
|
|
background-color: #fafafa!important;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}</style>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="总学时"
|
|
|
|
|
hasFeedback
|
|
|
|
@ -638,15 +670,15 @@ class CoursesNew extends Component {
|
|
|
|
|
{getFieldDecorator("period",
|
|
|
|
|
{
|
|
|
|
|
rules:[{
|
|
|
|
|
required:false,
|
|
|
|
|
pattern: new RegExp(/^[0-9]\d*$/, "g"),
|
|
|
|
|
message: ''
|
|
|
|
|
}],
|
|
|
|
|
getValueFromEvent: (event) => {
|
|
|
|
|
return event.target.value.replace(/\D/g,'')
|
|
|
|
|
}}
|
|
|
|
|
pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
|
|
|
|
|
message: '必须是数值'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
max:5,
|
|
|
|
|
message: '不能超过5个字符',
|
|
|
|
|
}]}
|
|
|
|
|
)(
|
|
|
|
|
<Input id="period" className="greyInput " placeholder="例如:30"/>
|
|
|
|
|
<Input id="period" className="yslzxueshi " placeholder="例如:30" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
@ -657,15 +689,16 @@ class CoursesNew extends Component {
|
|
|
|
|
{getFieldDecorator("credit",
|
|
|
|
|
{
|
|
|
|
|
rules:[{
|
|
|
|
|
required:false,
|
|
|
|
|
pattern: new RegExp(/^[0-9]\d*$/, "g"),
|
|
|
|
|
message: ''
|
|
|
|
|
}],
|
|
|
|
|
getValueFromEvent: (event) => {
|
|
|
|
|
return event.target.value.replace(/\D/g,'')
|
|
|
|
|
}}
|
|
|
|
|
pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
|
|
|
|
|
message: '必须是数值'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
max:5,
|
|
|
|
|
message: '不能超过5个字符',
|
|
|
|
|
}
|
|
|
|
|
]}
|
|
|
|
|
)(
|
|
|
|
|
<Input id="credit" className={"greyInput "} placeholder="例如:3"/>
|
|
|
|
|
<Input id="credit" className="yslzxueshi" placeholder="例如:3" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|