From 237af60494662f98732b7ff7483e36b8c64fd8ae Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Thu, 5 Sep 2019 18:11:32 +0800 Subject: [PATCH] =?UTF-8?q?check=E6=9C=80=E5=A4=A7=E9=99=90=E5=88=B6?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/busyWork/NewWorkForm.js | 49 ++++++++++++------- .../graduation/tasks/GraduationTasksedit.js | 13 +++-- .../graduation/tasks/GraduationTasksnew.js | 18 +++++-- .../graduation/topics/GraduateTopicNew.js | 2 +- 4 files changed, 58 insertions(+), 24 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index eaae55a42..1ae588db2 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -254,7 +254,6 @@ class NewWorkForm extends Component{ base_on_project_change = () => { this.setState({ base_on_project: !this.state.base_on_project }) } - render(){ let {typeId,coursesId,pageType}=this.props.match.params; const { getFieldDecorator } = this.props.form; @@ -370,6 +369,18 @@ class NewWorkForm extends Component{ display: inline-block; border-bottom: 1px solid #EDEDED; } + .courseForm .AboutInputForm.clearPaddingBottom{ + padding-bottom:0px!important; + } + .clearPaddingBottom .ant-form-explain{ + position:absolute; + bottom:0px; + left:0px + } + + .resetNewWorkUpload{ + border-bottom:none!important; + } `} @@ -380,7 +391,9 @@ class NewWorkForm extends Component{ > {getFieldDecorator('description', { rules: [{ - required: true, message: '请输入作业内容和要求' + required: true, message: '请输入作业内容和要求', + },{ + max: 5000 , message:'最大限制5000个字符' }], })( } - - {getFieldDecorator('reference_answer', { - rules: [{ - required: false - }], - })( - - )} - +
+ + {getFieldDecorator('reference_answer', { + rules: [{ + max: 5000 , message:'最大限制5000个字符' + }], + })( + + )} + + (单个文件150M以内) - +
{/* htmlType="submit" */} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index cc420f879..7f750ad70 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -290,6 +290,13 @@ class GraduationTasksedit extends Component{ shixunsreplace:false, }) } + checkContent = (rule, value, callback) => { + if(value.length>5000){ + callback('最大限制为5000个字符'); + }else{ + callback(); + } + } render(){ const { getFieldDecorator } = this.props.form; let {title_num,pageType,name,description,Loadtype,attachments,fileList, @@ -437,9 +444,9 @@ class GraduationTasksedit extends Component{ > {getFieldDecorator('description', { rules: [{ - required: true, message: '请输入帖子内容', - }, { - max: 10000, message: '最大限制为10000个字符', + required: true, message: '请输入内容', + },{ + max:5000,message:'最大限制5000个字符' }], })( { + if (value == "") { + callback('请输入内容'); + }else if(value.length>5000){ + callback('最大限制为5000个字符'); + }else{ + callback(); + } + } + render() { const {getFieldDecorator} = this.props.form; let { @@ -448,9 +460,9 @@ class GraduationTasksnew extends Component { {getFieldDecorator('description', { rules: [{ required: true, message: '请输入内容', - }, { - max: 5000, message: '最大限制为5000个字符', - }], + },{ + max:5000,message:'最大限制5000个字符' + }] })( diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js index 20e03d069..ba2ab53d9 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js @@ -449,7 +449,7 @@ class GraduateTopicNew extends Component{ rules: [{ required: true, message: '请输入选题简介', }, { - max: 10000, message: '最大限制为10000个字符', + max: 5000, message: '最大限制为5000个字符', }], })(