king
2020-02-10 34f78e1203a839592ca6764f88f1632088e07d2a
src/templates/ushare/editable/index.jsx
@@ -44,12 +44,13 @@
    this.form = form
    const { children, dataIndex, record } = this.props
    const { editing } = this.state
    return editing ? (
      <Form.Item style={{ margin: 0 }}>
        {form.getFieldDecorator(dataIndex, {
          rules: [
            {
              required: true,
              required: dataIndex === 'Value' || dataIndex === 'Text',
              message: 'NOT NULL.',
            },
          ],
@@ -150,7 +151,8 @@
      columns: columns,
      dataSource: props.data,
      count: props.data.length,
      type: props.type
      type: props.type,
      linkSubFields: props.linkSubFields
    }
  }
@@ -187,8 +189,17 @@
  }
  resetColumn = (type, linkSubFields) => {
    let dataSource = JSON.parse(JSON.stringify(this.state.dataSource))
    let _width = '40%'
    let fields = []
    if (type === 'select' && linkSubFields.length > this.state.linkSubFields) {
      let addcol = linkSubFields[linkSubFields.length - 1]
      dataSource = dataSource.map(data => {
        data[addcol.field] = data.Text
        return data
      })
    }
    if (type === 'link') {
      _width = '27%'
@@ -242,6 +253,7 @@
    this.setState({
      columns: columns,
      dataSource: dataSource,
      type: type
    })
  }