king
2019-12-06 2cb65d99c9aebf8293cb2838fcfe3e09fb2739ce
src/templates/modalconfig/settingform/index.jsx
@@ -1,15 +1,14 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio } from 'antd'
import { Form, Row, Col, Input, Radio, InputNumber } from 'antd'
import './index.scss'
const { TextArea } = Input
// const { TextArea } = Input
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
    formlist: PropTypes.any,
    card: PropTypes.object
    data: PropTypes.object
  }
  state = {
@@ -30,9 +29,9 @@
  }
  render() {
    const { data, dict } = this.props
    const { data } = this.props
    const { getFieldDecorator } = this.props.form
    console.log(data)
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -44,33 +43,36 @@
      }
    }
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form">
      <Form {...formItemLayout} className="ant-advanced-search-form modal-setting-form">
        <Row gutter={24}>
          <Col span={12}>
            <Form.Item label="固定按钮">
              {getFieldDecorator('actionfixed', {
                initialValue: data.actionfixed
            <Form.Item label="标题">
              {getFieldDecorator('title', {
                initialValue: data.title
              })(<Input placeholder="" autoComplete="off"/>)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="列数">
              {getFieldDecorator('cols', {
                initialValue: data.cols
              })(
                <Radio.Group>
                  <Radio value={true}>是</Radio>
                  <Radio value={false}>否</Radio>
                  <Radio value="1">1列</Radio>
                  <Radio value="2">2列</Radio>
                  <Radio value="3">3列</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="固定列">
              {getFieldDecorator('columnfixed', {
                initialValue: data.columnfixed
              })(
                <Radio.Group>
                  <Radio value={true}>是</Radio>
                  <Radio value={false}>否</Radio>
                </Radio.Group>
              )}
            <Form.Item label="宽度">
              {getFieldDecorator('width', {
                initialValue: data.width
              })(<InputNumber min={30} max={90} precision={0} />)}
            </Form.Item>
          </Col>
          <Col span={24}>
          {/* <Col span={24}>
            <Form.Item label="数据源" className="textarea">
              {getFieldDecorator('dataresource', {
                initialValue: data.dataresource,
@@ -82,7 +84,7 @@
                ]
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col>
          </Col> */}
        </Row>
      </Form>
    )