king
2023-11-14 169f6cd29a0d3add4fe2cf35c3579b45fa83c0d4
src/tabviews/custom/components/form/simple-form/index.jsx
@@ -176,11 +176,39 @@
  }
  reloadData = (menuId, id) => {
    const { config } = this.state
    const { config, group } = this.state
    if (config.uuid !== menuId) return
    this.loadData()
    if (id === 'focus-refresh' && config.wrap.refocus) {
      let _group = fromJS(group).toJS()
      _group.setting.focus = config.wrap.refocus
      if (config.wrap.datatype === 'static') {
        this.setState({
          data: null,
          group: _group
        }, () => {
          this.setState({data: {$$empty: true}})
        })
      } else {
        this.setState({
          group: _group
        }, () => {
          this.loadData(true)
        })
      }
    } else if (id === 'focus-nofresh' && config.wrap.refocus) {
      let formId = ''
      group.fields.forEach(item => {
        if (item.field === config.wrap.refocus) {
          formId = item.uuid
        }
      })
      MKEmitter.emit('mkFC', 'focus', formId)
    } else {
      this.loadData()
    }
  }
  /**
@@ -197,6 +225,14 @@
    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) {
      MKEmitter.emit('reloadData', config.setting.supModule, BID)
    } else if (position === 'grid' && config.wrap.datatype === 'static') {
      if (config.wrap.refocus && group.setting.focus === config.wrap.refocus) {
        let _group = fromJS(group).toJS()
        _group.setting.focus = config.wrap.focus
        this.setState({
          group: _group
        })
      }
      this.setState({
        data: null
      }, () => {
@@ -253,8 +289,17 @@
    }
  }
  async loadData () {
    const { config, BID } = this.state
  async loadData (refocus) {
    const { config, BID, group } = this.state
    if (config.wrap.refocus && !refocus && group.setting.focus === config.wrap.refocus) {
      let _group = fromJS(group).toJS()
      _group.setting.focus = config.wrap.focus
      this.setState({
        group: _group
      })
    }
    if (config.wrap.datatype === 'public') {
      MKEmitter.emit('reloadData', config.wrap.publicId)