king
2024-08-12 21167ece56edd628e6f6546d1d642947cc3a048f
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Collapse } from 'antd'
import { Collapse, notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -530,6 +530,10 @@
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
      if (config.$hasTopModule) {
        window.GLOB.CacheData.set(config.uuid + 'tb', { $$empty: true, $$uuid: '' })
        MKEmitter.emit('mkPublicData', config.uuid + 'tb', { $$empty: true, $$uuid: '' })
      }
      this.loaded = true
      this.requestId = ''
@@ -653,6 +657,11 @@
        loading: false
      })
      if (config.$hasTopModule) {
        window.GLOB.CacheData.set(config.uuid + 'tb', data[0] || { $$empty: true, $$uuid: '' })
        MKEmitter.emit('mkPublicData', config.uuid + 'tb', data[0] || { $$empty: true, $$uuid: '' })
      }
      if (config.timer && config.clearField && result.data && result.data[0]) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(result.data[0][config.clearField])) {
@@ -715,6 +724,12 @@
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        _data.$$BData = BData || ''
        if (setting.controlField) {
          if (setting.controlVal.includes(_data[setting.controlField] + '')) {
            _data.$disabled = true
          }
        }
  
        if (config.absFields) {
          config.absFields.forEach(f => {
@@ -803,6 +818,20 @@
   * 含有初始不加载的页面,修改设置
   */
  refreshbysearch = (searches) => {
    const { setting, BID } = this.state
    if (setting.supModule && !BID && setting.supKey !== 'false') {
      notification.warning({
        top: 92,
        message: window.GLOB.dict['sup_key_req'] || '需要上级主键值!',
        duration: 5
      })
      this.setState({
        search: searches
      })
      return
    }
    this.setState({
      pageIndex: 1,
      search: searches
@@ -951,7 +980,7 @@
        })
      } else {
        if (position === 'line' || position === 'line_grid') {
          if (lines && lines.length === 1) {
          if (lines && lines.length === 1 && !config.forbidLine) {
            this.loadLinedata(lines[0].$$uuid, position)
          } else {
            this.reloadtable(btn, id)
@@ -962,7 +991,7 @@
      }
    } else {
      if (position === 'line' || position === 'line_grid') {
        if (lines && lines.length === 1) {
        if (lines && lines.length === 1 && !config.forbidLine) {
          this.loadLinedata(lines[0].$$uuid, position)
        } else {
          this.reloadtable(btn, id)
@@ -1004,9 +1033,7 @@
    if (config.$searchId !== searchId) return
    
    this.setState({pageIndex: 1}, () => {
      this.reloadtable()
    })
    this.reloadtable()
  }
  render() {