| | |
| | | return item |
| | | } |
| | | |
| | | extra = (res) => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | if (res.copyType === 'mk_actions') { |
| | | config.action = res.action |
| | | this.props.updateConfig(config) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revertBtn', config.uuid) |
| | | }, 30) |
| | | } else if (res.copyType === 'mk_searches') { |
| | | config.search = res.search |
| | | this.props.updateConfig(config) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert', config.uuid, 'search') |
| | | }, 30) |
| | | } else if (res.copyType === 'mk_fields') { |
| | | config.columns = res.columns |
| | | this.props.updateConfig(config) |
| | | } else if (res.copyType === 'mk_cols') { |
| | | config.cols = res.cols |
| | | this.props.updateConfig(config) |
| | | } else if (res.copyType === 'mk_setting') { |
| | | config.setting = res.setting |
| | | this.props.updateConfig(config) |
| | | } |
| | | console.log(config) |
| | | this.setState({visible: false}) |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | const { options } = this.props |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (/^mk_/.test(res.copyType)) { // dms-trans |
| | | this.extra(res) |
| | | return |
| | | } |
| | | if (!options.includes(res.copyType)) { |
| | | notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 }) |
| | | return |