weiximei 5 years ago
parent
commit
c8f7869a9a
1 changed files with 12 additions and 2 deletions
  1. 12
    2
      src/pages/building/list/add/components/modalImage.jsx

+ 12
- 2
src/pages/building/list/add/components/modalImage.jsx View File

196
               </Form.Item>
196
               </Form.Item>
197
               <Form.Item label="面积" help="单位 ㎡">
197
               <Form.Item label="面积" help="单位 ㎡">
198
                 {getFieldDecorator('buildingArea', {
198
                 {getFieldDecorator('buildingArea', {
199
-                  rules: [{ required: true, message: '请填写面积' }],
199
+                  rules: [{ required: true, message: '请填写面积' },
200
+                          {
201
+                            pattern: new RegExp('^[0-9]*$'),
202
+                            message: '只允许输入数字',
203
+                          },
204
+                  ],
200
                 })(<Input type="number" />)}
205
                 })(<Input type="number" />)}
201
               </Form.Item>
206
               </Form.Item>
202
               <Form.Item label="套内面积" help="单位 ㎡">
207
               <Form.Item label="套内面积" help="单位 ㎡">
203
                 {getFieldDecorator('insideArea', {
208
                 {getFieldDecorator('insideArea', {
204
-                  rules: [{ required: true, message: '请填写套内面积' }],
209
+                  rules: [{ required: true, message: '请填写套内面积' },
210
+                          {
211
+                            pattern: new RegExp('^[0-9]*$'),
212
+                            message: '只允许输入数字',
213
+                          },
214
+                  ],
205
                 })(<Input type="number" />)}
215
                 })(<Input type="number" />)}
206
               </Form.Item>
216
               </Form.Item>
207
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
217
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>