| | |
| | | |
| | | class PasteController extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 组件配置 |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | const { config } = this.props |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType !== 'form') { |
| | | if (res.copyType !== 'search') { |
| | | notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 }) |
| | | return |
| | | } |
| | | |
| | | let keys = config.fields.map(item => item.field ? item.field.toLowerCase() : '$emp_ty$') |
| | | |
| | | if (['multiselect', 'color', 'brafteditor'].includes(res.type)) { |
| | | res.type = 'text' |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '搜索字段已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.props.updateConfig(config) |
| | | this.props.updateConfig(res) |
| | | this.setState({visible: false}) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | }) |
| | | } |
| | | |