How to use the antd.Form.Item function in antd

To help you get started, we’ve selected a few antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github didilinkin / react-admin-antd / src / modules / FINANCE / components / CollectRent / CollectRentHead.jsx View on Github external
import {Form, Select, Input, Button, Row, Col, DatePicker } from 'antd'
import React from 'react'
const Option = Select.Option
const FormItem = Form.Item
const { RangePicker } = DatePicker


class CollectRentHead extends React.Component {
    constructor (props) {
        super(props)
        this.state = {
            open: '展开',
            none: 'none',
            openState: false
        }
    }
    // 清除
    handleReset = () => {
        this.props.form.resetFields()
    }
github xjchenhao / egg-admin-service / app / assets / src / pages / auth / users.js View on Github external
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Row, Col, Card, Form, Input, Icon, Button, Dropdown, Menu, Modal, Table, Divider, Popconfirm } from 'antd';
// import StandardTable from '../../components/StandardTable';
import PageHeaderLayout from './../../layouts/pageHeaderLayout';

import styles from './../../utils/utils.less';


const FormItem = Form.Item;
const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');

// 重置密码弹框
const ResetPwdModal = Form.create()((props) => {
  const { visible, form, onCancel, onOk } = props;

  return (
     {
        e.preventDefault();

        form.validateFields((err, fieldsValue) => {
          if (err) return;
          onOk(fieldsValue);
github ant-design / scaffold-market / src / components / Contribute / Submit.js View on Github external
import React from 'react';
import { Select, Button, Input, Form, Upload, Icon, Progress, Tooltip, message } from 'antd';
import { FormattedMessage } from 'react-intl';
import styles from './Submit.less';

const FormItem = Form.Item;
const { Dragger } = Upload;

function Submit({ repo, dispatch, form, loading, intl }) {
  if (!repo) {
    return null;
  }
  const { getFieldDecorator, validateFields, getFieldValue, setFieldsValue } = form;
  const coverPicture = getFieldValue('coverPicture');
  const coverPictureUploading = (coverPicture && !coverPicture.response);
  const coverPictureUploaded = (
    coverPicture && coverPicture.response && coverPicture.response.file
  );
  return (
    <form>
      <h3>
        </h3></form>
github seawind8888 / Nobibi-admin / src / pages / user / components / Modal.js View on Github external
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Form, Input, Radio, Modal, Select } from 'antd'
import { withI18n } from '@lingui/react'
import md5 from 'md5'
import { find } from 'lodash'
import { getRandomColor } from 'utils'
const { Option } = Select

const FormItem = Form.Item

const formItemLayout = {
  labelCol: {
    span: 6,
  },
  wrapperCol: {
    span: 14,
  },
}
@withI18n()
@Form.create()
class UserModal extends PureComponent {
  state = {
    roleSelectPermission: [],
  }
  handleOk = () => {
github sysgears / apollo-universal-starter-kit / modules / look / client-react / ui-antd / components / RenderSelect.jsx View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import { Form } from 'antd';
import Select from './Select';

const FormItem = Form.Item;

const RenderSelect = props => {
  const {
    input,
    label,
    type,
    children,
    meta: { touched, error }
  } = props;
  let validateStatus = '';
  if (touched && error) {
    validateStatus = 'error';
  }

  const onChange = value => {
    const { formik, name } = props;
github didi / nightingale / web / src / components / EndpointList / BatchSearch.tsx View on Github external
import { FormProps } from 'antd/lib/form';
import _ from 'lodash';
import ModalControl from '@cpts/ModalControl';
import { FormattedMessage } from 'react-intl';

interface Props {
  field: string,
  batch: string,
  title: string,
  visible: boolean,
  onOk: (field: string, batch: string) =&gt; void,
  onCancel: () =&gt; void,
  destroy: () =&gt; void,
}

const FormItem = Form.Item;
const RadioGroup = Radio.Group;

class BatchSearch extends Component {
  static defaultProps: any = {
    field: 'ident',
    batch: '',
    title: '',
    visible: true,
    onOk: _.noop,
    onCancel: _.noop,
    destroy: _.noop,
  };

  handleOk = () =&gt; {
    this.props.form!.validateFields((err, values) =&gt; {
      if (!err) {
github fireyy / react-antd-admin / src / views / Login / index.jsx View on Github external
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Input, Button, Row, Col, Icon, message } from 'antd'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom';
import { login } from '../../actions/auth'
const FormItem = Form.Item

import './index.less'

const propTypes = {
  user: PropTypes.object,
  loggingIn: PropTypes.bool,
  loginErrors: PropTypes.string
};

class Login extends React.Component {

  constructor (props) {
    super(props);
    this.state = {
      loading: false
    }