king
2023-01-16 97e18fa9b628357fa43013cfefc96eec078de25e
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -45,6 +45,8 @@
    statFValue: []        // 合计值
  }
  loaded = false
  /**
   * @description 初始化处理
   * 1、 initdata 为打印时使用的数据集
@@ -84,15 +86,16 @@
      setting.orisel = true
    }
    if (_config.setting.sync === 'true' && data) {
    if (_sync && data) {
      _data = data[_config.dataName] || []
      _sync = false
    } else if (_config.setting.sync === 'true' && initdata) {
    } else if (_sync && initdata) {
      _data = initdata || []
      _sync = false
    }
    if (_data) {
      this.loaded = true
      _data = _data.map((item, index) => {
        item.key = index
        item.$$uuid = item[_config.setting.primaryKey] || ''
@@ -205,6 +208,8 @@
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
      this.loaded = true
      return
    }
@@ -234,6 +239,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.loaded = true
      if (config.$cache && pageIndex === 1) {
        Api.writeCacheConfig(config.uuid, result.data || '')
      }
@@ -648,6 +654,8 @@
        }
      }
      this.loaded = true
      this.setState({sync: false, data: _data})
    } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      this.setState({pageIndex: 1}, () => {
@@ -661,7 +669,7 @@
  }
  componentDidMount () {
    const { config, sync, setting } = this.state
    const { config, setting } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
@@ -680,9 +688,9 @@
      })
    }
    if (config.$cache && (config.setting.sync !== 'true' || sync)) {
    if (config.$cache && !this.loaded) {
      Api.getLCacheConfig(config.uuid).then(res => {
        if (!res) return
        if (!res || this.loaded) return
        this.setState({data: res.map((item, index) => {
          item.key = index