diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 25459fcc6..a7e918ee1 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -48,7 +48,6 @@ class CoursesNew extends Component { 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() { @@ -81,19 +80,18 @@ class CoursesNew extends Component { is_public: data.is_public === 1 ? true : false, Realnamecertification: data.authentication, Professionalcertification:data.professional_certification, - checkbofrups:data.course_modules, }); - 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, - }); - } + // 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, + // }); + // } @@ -464,7 +462,7 @@ class CoursesNew extends Component { this.applyForAddOrgForm.setVisible(true) } render() { - let {datatime,school,searchlistscholl,checkbofrups} = this.state; + let {datatime,school,searchlistscholl} = this.state; const {getFieldDecorator} = this.props.form; const propsWithoutForm = Object.assign({}, this.props) delete propsWithoutForm.form @@ -472,10 +470,10 @@ 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); return ( @@ -699,29 +697,11 @@ class CoursesNew extends Component { label="课堂模块" hasFeedback > - {getFieldDecorator("checkboxgroup", { initialValue: [ "shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group", ], })( - this.props.match.params.coursesId != undefined? - - { - checkbofrups===undefined?"":checkbofrups.length===0?"":checkbofrups.map((item,key)=>{ - return( - item.module_type==="announcement"? - "" - : - item.module_type==="online_learning"? - "" - : - {item.module_name} - ) - }) - } - - : 实训作业 普通作业 diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index a51e535e9..76a8c21a8 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -55,7 +55,7 @@ class Goldsubject extends Component { ,{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 => { @@ -144,20 +144,7 @@ class Goldsubject extends Component { course_module_types: data.course_module_types, school:data.school, Whethertocreateanewclassroom:false, - checkbofrups:data.course_modules, }); - - 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); @@ -609,7 +596,7 @@ class Goldsubject extends Component { this.applyForAddOrgForm.setVisible(true) } render() { - let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom,checkbofrups} = this.state; + let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom} = this.state; const {getFieldDecorator} = this.props.form; const propsWithoutForm = Object.assign({}, this.props) delete propsWithoutForm.form @@ -621,6 +608,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(addonAfterone); + console.log(addonAfteronelen); return ( @@ -788,6 +787,14 @@ class Goldsubject extends Component { } `} + { - return event.target.value.replace(/\D/g,'') - }} + pattern: new RegExp(/^[1-9]\d*$/, "g"), + message: '必须是数值' + }, + { + max:4, + message: '不能超过5个字符', + }]} )( - + )} - + { - return event.target.value.replace(/\D/g,'') - }} + pattern: new RegExp(/^[1-9]\d*$/, "g"), + message: '必须是数值' + }, + { + max:4, + message: '不能超过5个字符', + } + ]} )( - + )} - { - checkbofrups===undefined?"":checkbofrups.length===0?"":checkbofrups.map((item,key)=>{ - return( - item.module_type==="announcement"? - 公告栏 - : - item.module_type==="online_learning"? - 在线学习 - : - item.module_type==="graduation"?"": - item.module_type==="group_homework"?"": - {item.module_name} - ) - }) - } - - : 公告栏 在线学习