feat: 创建或求该项目表单的校验

This commit is contained in:
wenbo.dong 2017-07-20 14:41:38 +08:00
parent f4f3479b56
commit c6a866975c
2 changed files with 9 additions and 4 deletions

View File

@ -248,7 +248,9 @@ class ProjectList extends Component {
>
{getFieldDecorator('prd_host', {
rules: [{
required: true, message: '请输入项目线上域名!'
required: true,
message: '请输入项目线上域名,不允许出现‘\/!',
pattern: /.+\w$/
}]
})(
<Input addonBefore={(
@ -265,7 +267,8 @@ class ProjectList extends Component {
>
{getFieldDecorator('basepath', {
rules: [{
required: true, message: '请输入项目基本路径!'
required: true, message: '基本路径应以\'\/\'开头,以\'\/\'结尾! ',
pattern: /^\/.+\/$/
}]
})(
<Input />

View File

@ -251,7 +251,8 @@ class UpDateModal extends Component {
{getFieldDecorator('prd_host', {
initialValue: initFormValues.prd_host,
rules: [{
required: true, message: '请输入项目线上域名!'
required: true, message: '格式错误!',
pattern: /.+\w$/
}]
})(
<Input addonBefore={(
@ -269,7 +270,8 @@ class UpDateModal extends Component {
{getFieldDecorator('basepath', {
initialValue: initFormValues.basepath,
rules: [{
required: true, message: '请输入项目基本路径!'
required: true, message: '基本路径应以\'\/\'开头,以\'\/\'结尾! ',
pattern: /^\/.+\/$/
}]
})(
<Input />