From 16307a59382ac1e1a1ed5b7ca5a45acf38a824b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 27 Aug 2019 16:41:44 +0800 Subject: [PATCH] Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # public/react/src/modules/courses/new/CoursesNew.js # public/react/src/modules/courses/new/Goldsubject.js --- .../react/src/modules/courses/css/Courses.css | 2 +- .../src/modules/courses/new/CoursesNew.js | 121 +++++++++++--- .../src/modules/courses/new/Goldsubject.js | 153 ++++++++++-------- 3 files changed, 187 insertions(+), 89 deletions(-) diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index dbdd42398..78b6783a0 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1061,7 +1061,7 @@ samp { .newcoursestitle{ font-size: 12px; color: #989898; - margin-left: 10px; + margin-left: 40px; } .coursenavbox .ant-form-item-label{ diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index cbcb33fc2..71092ebdb 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -47,6 +47,7 @@ class CoursesNew extends Component { checkboxgroup:undefined, addonAfteronelenone:0, addonAfteronelentwo:0, + classroomyslstiring:"", 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:"分班"}], @@ -364,14 +365,16 @@ class CoursesNew extends Component { search:value }).then((result)=>{ // console.log(result.data) - if (result.data.message===undefined) { + if(result){ + if (result.data.message===undefined) { - this.setState({ - searchlist: result.data.course_lists, - // course:value, + this.setState({ + searchlist: result.data.course_lists, + // course:value, - }) - } + }) + } + } // this.props.form.setFieldsValue({ // course:value // }) @@ -393,11 +396,16 @@ class CoursesNew extends Component { }; handleChange=(value)=>{ + if(value){ + this.props.form.setFieldsValue({ + course:value+"", + classroom:value+"", + }); + this.setState({ + classroomyslstiring:value + }) + } - this.props.form.setFieldsValue({ - // course:value, - classroom:value - }) }; handleSearchschool=(value)=>{ @@ -489,6 +497,16 @@ class CoursesNew extends Component { if(addonAftertwo){ addonAfteronelens=String(addonAftertwo).length; } + var addonAfterthree=this.props.form&&this.props.form.getFieldValue('course'); + var addonAfteronelens3=0; + if(addonAfterthree){ + addonAfteronelens3=String(addonAfterthree).length; + } + var addonAfterfour=this.props.form&&this.props.form.getFieldValue('classroom'); + var addonAfteronelens4=0; + if(addonAfterfour){ + addonAfteronelens4=String(addonAfterfour).length; + } return ( @@ -550,20 +568,16 @@ class CoursesNew extends Component { .ant-select-dropdown{ // top: 221px !important; // left: 115px !important; - width: 280px !important; height: 160px; } .ant-select-dropdown-menu{ - width: 280px !important; height: 160px; } .construction .ant-input{ - width: 280px !important; margin-left: 0px !important; } .construction { - width: 280px; - margin-left: 10px; + margin-left: 11px; } .construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder { @@ -575,21 +589,51 @@ class CoursesNew extends Component {
+ {getFieldDecorator('course', { - rules: [{required: true, message: "不能为空"}], + rules: [{required: true, message: "不能为空"}, + { + max:60, + message: '不能超过60个字符', + }], })( - - {options} - + + + )} - + {/*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*/}

@@ -616,11 +660,38 @@ class CoursesNew extends Component { }

+ + {getFieldDecorator('classroom', { - rules: [{required: true, message: "不能为空"}], - })()} + rules: [{required: true, message: "不能为空"}, + { + max:60, + message: '不能超过60个字符', + }], + })()} {/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/}

@@ -698,7 +769,7 @@ class CoursesNew extends Component { } ]} )( - + )} { - this.props.form.setFieldsValue({ - // course:value, - classroom:value - }) + if(value){ + setTimeout(()=>{ + this.props.form.setFieldsValue({ + course:value+"", + classroom:value+"", + }); + },100) + + } }; handleSearchschool=(value)=>{ @@ -624,6 +629,12 @@ class Goldsubject extends Component { if(addonAftertwo){ addonAfteronelens=String(addonAftertwo).length; } + + var addonAfterfour=this.props.form&&this.props.form.getFieldValue('classroom'); + var addonAfteronelens4=0; + if(addonAfterfour){ + addonAfteronelens4=String(addonAfterfour).length; + } console.log(addonAfteronelenone); console.log(addonAfteronelentwo); console.log(options); @@ -688,20 +699,16 @@ class Goldsubject extends Component { .ant-select-dropdown{ // top: 221px !important; // left: 115px !important; - width: 280px !important; height: 160px; } .ant-select-dropdown-menu{ - width: 280px !important; height: 160px; } .construction .ant-input{ - width: 280px !important; margin-left: 0px !important; } .construction { - width: 280px; - margin-left: 10px; + margin-left: 11px; } .construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder { @@ -711,38 +718,7 @@ class Goldsubject extends Component { `} - {/*

*/} - {/*
*/} - {/* */} - {/* {getFieldDecorator('course', {*/} - {/* rules: [{required: true, message: "不能为空"}],*/} - {/* })(*/} - - {/* */} - {/* {options}*/} - {/* */} - {/* )}*/} - {/* */} - {/* /!*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*!/*/} - {/*

*/} - {/* */} - {/* 正确示例:数据结构*/} - {/*

*/} - {/*

*/} - {/* */} - {/* 错误示例:数据结构2019春*/} - {/*

*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} +
- - {getFieldDecorator('classroom', { - rules: [{required: true, message: "不能为空"}], - })( - - - - )} - {/**/} - {/* /!*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*!/*/} + {/* */} + + {/* {getFieldDecorator('classroom', {*/} + {/* rules: [{required: true, message: "不能为空"},*/} + {/* {*/} + {/* max:60,*/} + {/* message: '不能超过60个字符',*/} + {/* }],*/} + {/* })(*/} + {/* */} + {/* */} + {/* */} + {/* )}*/} + + {/**/} + + + {getFieldDecorator('classroom', { + rules: [{required: true, message: "不能为空"}, + { + max:60, + message: '不能超过60个字符', + }], + })( + + + + + + )} + {/**/} + {/* /!*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*!/*/} {/*

*/} - {/* */} - {/* 正确示例:数据结构2019春季班级*/} + {/* */} + {/* 正确示例:数据结构*/} {/*

*/} {/*

*/} - {/* */} - {/* 错误示例:2019春季班级数据结构*/} + {/* */} + {/* 错误示例:数据结构2019春*/} {/*

*/} {/*
*/} -
+
- -