From 9e051436c718583ea73c980cd84d91d0fc0c500a Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 17 Oct 2017 20:39:02 +0800 Subject: [PATCH] update BasicForm --- src/routes/Forms/BasicForm.js | 143 ++++++++++++++++++++++------------ src/routes/Forms/style.less | 5 ++ 2 files changed, 98 insertions(+), 50 deletions(-) diff --git a/src/routes/Forms/BasicForm.js b/src/routes/Forms/BasicForm.js index 482f976d..baaf8cfc 100644 --- a/src/routes/Forms/BasicForm.js +++ b/src/routes/Forms/BasicForm.js @@ -1,11 +1,15 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; -import { Form, Input, DatePicker, Select, Button, Card } from 'antd'; +import { + Form, Input, DatePicker, Select, Button, Card, InputNumber, Radio, Icon, Tooltip, +} from 'antd'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import styles from './style.less'; const FormItem = Form.Item; const { Option } = Select; const { RangePicker } = DatePicker; +const { TextArea } = Input; @connect(state => ({ submitting: state.form.regularFormSubmitting, @@ -25,12 +29,12 @@ export default class BasicForms extends PureComponent { } render() { const { submitting } = this.props; - const { getFieldDecorator } = this.props.form; + const { getFieldDecorator, getFieldValue } = this.props.form; const formItemLayout = { labelCol: { xs: { span: 24 }, - sm: { span: 3 }, + sm: { span: 7 }, }, wrapperCol: { xs: { span: 24 }, @@ -42,100 +46,139 @@ export default class BasicForms extends PureComponent { const submitFormLayout = { wrapperCol: { xs: { span: 24, offset: 0 }, - sm: { span: 10, offset: 3 }, + sm: { span: 10, offset: 7 }, }, }; return ( -
+ - {getFieldDecorator('appType', { + {getFieldDecorator('title', { rules: [{ - required: true, message: '应用类型', + required: true, message: '请输入标题', }], })( - + )} - {getFieldDecorator('productName', { + {getFieldDecorator('date', { rules: [{ - required: true, message: '请输入产品名', + required: true, message: '请选择起止日期', }], })( - + )} - {getFieldDecorator('appName', { - rules: [ - { required: true, message: '请输入应用名' }, - { pattern: /^[a-zA-Z0-9-]+$/, message: '只能输入英文、数字、中划线' }, - ], + {getFieldDecorator('goal', { + rules: [{ + required: true, message: '请输入目标描述', + }], })( - +