king
2020-02-25 0c86e5e2eaf907dfcb63aea13e6efac3ccc52cce
src/templates/modalconfig/index.jsx
@@ -971,6 +971,35 @@
    })
  }
  editModalCancel = () => {
    const { config, card } = this.state
    if (card.focus) {
      let _config = null
      if (config.groups.length > 0) {
        let _groups = config.groups.map(group => {
          group.sublist = group.sublist.filter(item => item.uuid !== card.uuid)
          return group
        })
        _config = {...config, groups: _groups}
      } else {
        let _fields = config.fields.filter(item => item.uuid !== card.uuid)
        _config = {...config, fields: _fields}
      }
      this.setState({
        card: null,
        config: _config,
        visible: false
      })
    } else {
      this.setState({
        card: null,
        visible: false
      })
    }
  }
  render () {
    const { config } = this.state
@@ -1098,7 +1127,7 @@
          title={this.state.dict['header.edit']}
          visible={this.state.visible}
          width={700}
          onCancel={() => { this.setState({ visible: false }) }}
          onCancel={this.editModalCancel}
          onOk={this.handleSubmit}
          destroyOnClose
        >