|
|
|
@ -27,7 +27,9 @@ function disabledDateTime() {
|
|
|
|
|
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function disabledDate(current) {
|
|
|
|
|
return current && current < moment().endOf('day').subtract(1, 'days');
|
|
|
|
|
}
|
|
|
|
|
// function disabledDate(current) {
|
|
|
|
|
// console.log(current);
|
|
|
|
|
// return current && current < moment().endOf('day').subtract(1, 'days');
|
|
|
|
@ -49,13 +51,15 @@ class Goldsubject extends Component {
|
|
|
|
|
fetching:false,
|
|
|
|
|
subject_id:"",
|
|
|
|
|
start_date:"",
|
|
|
|
|
addonAfteronelenone:"",
|
|
|
|
|
addonAfteronelentwo:"",
|
|
|
|
|
Whethertocreateanewclassroom:true,
|
|
|
|
|
checkbofrup:[
|
|
|
|
|
{module_type:"announcement",module_name:"公告栏"},{module_type:"online_learning",module_name:"在线学习"}
|
|
|
|
|
,{module_type:"shixun_homework",module_name:"实训作业"},{module_type:"common_homework",module_name:"普通作业"}
|
|
|
|
|
,{module_type:"exercise",module_name:"试卷"},{module_type:"poll",module_name:"问卷"}
|
|
|
|
|
,{module_type:"attachment",module_name:"资源"},{module_type:"board",module_name:"讨论"},{module_type:"course_group",module_name:"分班"},],
|
|
|
|
|
checkbofrups:[],
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// disabledEndDate= endValue => {
|
|
|
|
@ -121,8 +125,8 @@ class Goldsubject 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,
|
|
|
|
@ -140,22 +144,13 @@ class Goldsubject extends Component {
|
|
|
|
|
Professionalcertification:data.professional_certification,
|
|
|
|
|
name: data.name,
|
|
|
|
|
class_period: data.class_period,
|
|
|
|
|
credit: parseFloat(data.credit),
|
|
|
|
|
addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period,
|
|
|
|
|
credit: parseFloat(data.credit),
|
|
|
|
|
addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit,
|
|
|
|
|
course_module_types: data.course_module_types,
|
|
|
|
|
school:data.school,
|
|
|
|
|
Whethertocreateanewclassroom:false,
|
|
|
|
|
});
|
|
|
|
|
// try {
|
|
|
|
|
// if(data.course_modules===undefined||data.course_modules.length===0){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// checkbofrups:this.state.checkbofrup,
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }catch (e) {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// checkbofrups:this.state.checkbofrup,
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
this.handleSearchschool(data.school);
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
@ -607,7 +602,7 @@ class Goldsubject extends Component {
|
|
|
|
|
this.applyForAddOrgForm.setVisible(true)
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom} = this.state;
|
|
|
|
|
let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom,addonAfteronelenone,addonAfteronelentwo} = this.state;
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
const propsWithoutForm = Object.assign({}, this.props)
|
|
|
|
|
delete propsWithoutForm.form
|
|
|
|
@ -619,6 +614,18 @@ class Goldsubject 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;
|
|
|
|
|
}
|
|
|
|
|
console.log(addonAfteronelenone);
|
|
|
|
|
console.log(addonAfteronelentwo);
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
|
@ -786,6 +793,23 @@ class Goldsubject 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
|
|
|
|
@ -793,18 +817,17 @@ class Goldsubject 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" placeholder="例如:30" className="yslzxueshi" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="学分"
|
|
|
|
|
hasFeedback
|
|
|
|
@ -812,15 +835,16 @@ class Goldsubject 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" placeholder="例如:3" className="yslzxueshi" addonAfter={String(addonAfteronelens)+"/5"} maxLength={5}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
@ -850,7 +874,8 @@ class Goldsubject extends Component {
|
|
|
|
|
label="结束时间"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator("endtime", {
|
|
|
|
|
rules: [{type: 'object',required: true, message: "结束时间不能为空"}],
|
|
|
|
|
rules: [{type: 'object',
|
|
|
|
|
required: true, message: "结束时间不能为空"}],
|
|
|
|
|
})(
|
|
|
|
|
<span className="fl mt5">
|
|
|
|
|
<DatePicker
|
|
|
|
|