| | |
| | | }) |
| | | } |
| | | |
| | | 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 |
| | | |
| | |
| | | title={this.state.dict['header.edit']} |
| | | visible={this.state.visible} |
| | | width={700} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | onCancel={this.editModalCancel} |
| | | onOk={this.handleSubmit} |
| | | destroyOnClose |
| | | > |