diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index edee26a27..cbcb33fc2 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -45,10 +45,11 @@ 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:"分班"}],
- checkbofrups:[],
}
}
componentDidMount() {
@@ -66,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,
@@ -81,7 +82,9 @@ class CoursesNew extends Component {
is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
- // checkbofrups:data.course_modules,
+ 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){
@@ -94,6 +97,9 @@ class CoursesNew extends Component {
// checkbofrups:this.state.checkbofrup,
// });
// }
+
+
+
this.handleSearchschool(data.school);
}).catch((error) => {
console.log(error);
@@ -469,10 +475,20 @@ class CoursesNew extends Component {
const optionschool = this.state.searchlistscholl===undefined?"":this.state.searchlistscholl===null?"":this.state.searchlistscholl==="[]"?"":this.state.searchlistscholl.map(z => );
// console.log(this.props.current_user.user_school)
// form合并了
- console.log("获取到的数据");
- console.log(this.state);
- console.log(this.props);
- console.log(this.props.current_user);
+ // console.log("获取到的数据");
+ // 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 (
@@ -630,6 +646,23 @@ class CoursesNew extends Component {
}
`}
+
{
- return event.target.value.replace(/\D/g,'')
- }}
+ pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
+ message: '必须是数值'
+ },
+ {
+ max:5,
+ message: '不能超过5个字符',
+ }]}
)(
-
+
)}
@@ -656,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个字符',
+ }
+ ]}
)(
-
+
)}
-
{getFieldDecorator("checkboxgroup", {
initialValue: [
"shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group",
diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js
index 80530c7ed..5149d3e5a 100644
--- a/public/react/src/modules/courses/new/Goldsubject.js
+++ b/public/react/src/modules/courses/new/Goldsubject.js
@@ -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 (
@@ -786,6 +793,23 @@ class Goldsubject extends Component {
}
`}
+
{
- return event.target.value.replace(/\D/g,'')
- }}
+ pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
+ message: '必须是数值'
+ },
+ {
+ max:5,
+ message: '不能超过5个字符',
+ }]}
)(
-
+
)}
-
{
- return event.target.value.replace(/\D/g,'')
- }}
+ pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
+ message: '必须是数值'
+ },
+ {
+ max:5,
+ message: '不能超过5个字符',
+ }
+ ]}
)(
-
+
)}
{getFieldDecorator("endtime", {
- rules: [{type: 'object',required: true, message: "结束时间不能为空"}],
+ rules: [{type: 'object',
+ required: true, message: "结束时间不能为空"}],
})(