king
2024-07-02 c0e1a2f76bb28ab71e54d30ac2dda945fa1e4a7e
src/components/normalform/modalform/index.jsx
@@ -32,6 +32,7 @@
  state = {
    formlist: [],    // 表单项
    formId: ''
  }
  record = {}
@@ -40,6 +41,15 @@
    let record = {}
    let controlFields = {}
    let fieldMap = new Map()
    let formId = (() => {
      let uuid = []
      let _options = '0123456789abcdefghigklmnopqrstuv'
      for (let i = 0; i < 19; i++) {
        uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
      }
      uuid = uuid.join('')
      return uuid
    })()
    let formlist = this.props.formlist.filter(item => {
      if (item.controlFields) { // 多层表单控制
@@ -56,6 +66,7 @@
      if (item.options) {
        item.oriOptions = fromJS(item.options).toJS()
      }
      item.$formId = formId
      if (item.type === 'text') {
        let _rules = [{
@@ -162,7 +173,7 @@
    this.record = record
    this.setState({ formlist })
    this.setState({ formlist, formId })
  }
  checkNumber = (rule, value, callback, item) => {
@@ -385,7 +396,7 @@
    }
    return (
      <Form {...formItemLayout} className="normal-form-field" id="normal-form-field">
      <Form {...formItemLayout} className="normal-form-field" id={this.state.formId}>
        <Row gutter={24}>{this.getFields()}</Row>
      </Form>
    )