king
2023-06-18 21e4dcd784ea0504c07d66befc19ccda110c58e4
src/components/normalform/modalform/index.jsx
@@ -45,6 +45,8 @@
      
      item.hidden = false
      if (item.forbid && item.del) return false
      if (item.forbid) {
        item.hidden = true
      }
@@ -176,7 +178,9 @@
  recordChange = (values, item) => {
    this.record = {...this.record, ...values}
    if (item && item.controlFields) {
    if (!item) return
    if (item.controlFields) {
      let map = new Map()
      this.state.formlist.forEach(cell => {
        if (!cell.field) return
@@ -237,6 +241,24 @@
          return item || cell
        })
      })
    } else if (item.reset_source) {
      let map = new Map()
      this.state.formlist.forEach(cell => {
        if (!cell.field) return
        map.set(cell.field, cell)
      })
      item.callback(map, this.record)
      this.setState({
        formlist: this.state.formlist.map(cell => {
          if (!cell.field) return cell
          let item = map.get(cell.field)
          return item || cell
        })
      })
    }
  }