| | |
| | | let _config = fromJS(this.state.card).toJS() |
| | | |
| | | if (res.subButton) { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | _config.subcards[0].setting.focus = res.focus |
| | | _config.subcards[0].setting.cache = res.cache |
| | |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `替换表单及按钮配置?`, |
| | | content: '替换表单及按钮配置?', |
| | | onOk() { |
| | | _this.updateComponent(_config) |
| | | that.updateComponent(_config) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | return |
| | | } else if (res.fields) { |
| | | if (_config.subcards[0].fields.length > 0) { |
| | | let that = this |
| | | _config.subcards[0].fields = res.fields.map(item => { |
| | | item.uuid = Utils.getuuid() |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | title: '确定替换表单吗?', |
| | | content: '原表单将删除。', |
| | | onOk() { |
| | | that.updateComponent(_config) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | _config.subcards[0].fields = res.fields.map(item => { |
| | | item.uuid = Utils.getuuid() |
| | | return item |
| | | }) |
| | | |
| | | this.updateComponent(_config) |
| | | } |
| | | |
| | | return |
| | | } |
| | | |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="simpleform" card={card}/> |
| | | <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} /> |
| | | <PasteComponent config={card} options={['form', 'forms', 'formgroup']} updateConfig={this.pasteForm} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <UserComponent config={card}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |