king
2021-07-06 71d4765ba3cdc4a004687cd37a529b565e9ea9fd
src/mob/searchconfig/pastecomponent/index.jsx
@@ -9,7 +9,6 @@
class PasteController extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 组件配置
    updateConfig: PropTypes.func
  }
@@ -18,36 +17,18 @@
  }
  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
      })
    })
  }