king
2021-03-31 682a74e858e5a6cd24d36183931d3afafd6443d7
src/menu/components/form/normal-form/index.jsx
@@ -45,7 +45,8 @@
    visible: false,
    editform: null,
    formlist: null,
    sqlVerifing: false
    sqlVerifing: false,
    standardform: null
  }
  UNSAFE_componentWillMount () {
@@ -429,8 +430,9 @@
    group.fields.push(newcard)
    this.setState({group})
    this.handleForm(newcard)
    this.setState({group}, () => {
      this.handleForm(newcard)
    })
  }
  editModalCancel = () => {
@@ -453,6 +455,7 @@
      value: '',
      text: '空'
    }]
    let standardform = null
    _inputfields = group.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
    _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
@@ -460,7 +463,11 @@
    let uniq = new Map()
    uniq.set(_form.field, true)
    group.fields.forEach(item => {
    let index = null
    group.fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -475,6 +482,13 @@
        })
      }
    })
    if (index !== null) {
      if (index === 0) {
        standardform = group.fields[index + 1] || null
      } else {
        standardform = group.fields[index - 1] || null
      }
    }
    card.columns.forEach(col => {
      if (col.field && !uniq.has(col.field)) {
@@ -493,6 +507,7 @@
    }
    this.setState({
      standardform,
      visible: true,
      editform: _form,
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, false)
@@ -673,6 +688,7 @@
            card={this.state.editform}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            standardform={this.state.standardform}
            wrappedComponentRef={(inst) => this.formRef = inst}
          />
        </Modal>