king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/mob/modalconfig/index.jsx
@@ -65,6 +65,7 @@
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('completeSave', this.completeSave)
  }
@@ -75,11 +76,30 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
    MKEmitter.removeListener('completeSave', this.completeSave)
  }
  completeSave = () => {
    this.setState({saving: false})
  }
  getStyle = (comIds, style) => {
    const { config } = this.state
    if (comIds[0] !== 'form') return
    let Index = config.fields.findIndex(n => n.uuid === comIds[1])
    if (Index === -1) return
    let _config = fromJS(config).toJS()
    _config.fields[Index].style = style
    this.setState({
      config: _config
    })
  }
  /**
@@ -198,11 +218,6 @@
      card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
    }
    if (!card.span && standardform && standardform.span) {
      card.span = standardform.span
      card.labelwidth = standardform.labelwidth
    }
    this.setState({
      standardform,
      visible: true,
@@ -228,6 +243,9 @@
        }
        if (item.uuid === res.uuid) {
          if (item.style) {
            res.style = item.style
          }
          return res
        } else {
          return item
@@ -470,7 +488,8 @@
        <Modal
          title={this.state.dict['model.edit']}
          visible={this.state.visible}
          width={850}
          width={950}
          maskClosable={false}
          onCancel={this.editModalCancel}
          onOk={this.handleSubmit}
          confirmLoading={this.state.sqlVerifing}