| | |
| | | }) |
| | | } |
| | | |
| | | clearConfig = () => { |
| | | const _this = this |
| | | let _config = {...this.state.config, fields: []} |
| | | |
| | | confirm({ |
| | | content: '确定清空表单吗?', |
| | | onOk() { |
| | | _this.setState({ config: _config }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config, dict, saving } = this.state |
| | | |
| | |
| | | <Button type="primary" loading={saving} onClick={this.submitConfig}>保存</Button> |
| | | <Button onClick={this.cancelConfig}>返回</Button> |
| | | <PasteComponent config={config} updateConfig={this.insert} /> |
| | | <Button type="danger" onClick={this.clearConfig}>清空</Button> |
| | | <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |
| | | </div> |
| | | <div className="setting"> |