king
2024-03-29 deb2536eaaa559d6c8ec94f81afb94b6c7806b4d
src/tabviews/custom/components/editor/braft-editor/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Spin, notification, Modal } from 'antd'
import { Spin } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import Api from '@/api'
@@ -63,7 +63,6 @@
      data: _data,
      BID: BID || '',
      config: _config,
      arr_field: _config.columns.map(col => col.field).join(','),
    })
  }
@@ -73,16 +72,14 @@
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    if (config.setting.useMSearch) {
      MKEmitter.addListener('searchRefresh', this.searchRefresh)
    }
    if (config.setting.sync === 'true') {
      MKEmitter.addListener('transferSyncData', this.transferSyncData)
    }
    if (config.wrap.datatype === 'public') {
      MKEmitter.addListener('mkPublicData', this.mkPublicData)
    } else if (config.setting.useMSearch) {
      MKEmitter.addListener('searchRefresh', this.searchRefresh)
    }
    this.initExec()
@@ -168,7 +165,7 @@
  }
  async loadData () {
    const { config, arr_field, BID } = this.state
    const { config, BID } = this.state
    if (config.wrap.datatype === 'public') {
      MKEmitter.emit('reloadData', config.wrap.publicId)
@@ -203,7 +200,7 @@
    })
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID)
    let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, 1, 1, BID)
    let result = await Api.genericInterface(param)
    if (result.status) {
@@ -214,37 +211,14 @@
        data: _data,
        loading: false
      })
      if (result.message) {
        if (result.ErrCode === 'Y') {
          Modal.success({
            title: result.message
          })
        } else if (result.ErrCode === 'S') {
          notification.success({
            top: 92,
            message: result.message,
            duration: 2
          })
        }
      }
      UtilsDM.querySuccess(result)
    } else {
      this.setState({
        loading: false
      })
      
      if (!result.message) return
      if (result.ErrCode === 'N') {
        Modal.error({
          title: result.message
        })
      } else if (result.ErrCode !== '-2') {
        notification.error({
          top: 92,
          message: result.message,
          duration: 10
        })
      }
      UtilsDM.queryFail(result)
    }
  }