king
2021-12-22 5223edbcccfed84a33a706e5637ee65a61f377aa
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -6,8 +6,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
@@ -31,7 +29,6 @@
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    BID: '',              // 上级ID
    BData: '',            // 上级组件行数据
    config: {},           // 页面配置信息,包括按钮、搜索、显示列、标签等
@@ -85,7 +82,7 @@
        return item
      })
      if (setting.selected !== 'false') {
      if (setting.selected !== 'false' && _data && _data.length > 0) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', _config.uuid)
        }, 200)
@@ -124,6 +121,7 @@
    }
    this.setState({
      pageSize: setting.pageSize || 10,
      BID: BID || '',
      BData: BData || '',
      title: _config.wrap.title,
@@ -193,7 +191,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (setting.selected !== 'false') {
      if (setting.selected !== 'false' && result.data && result.data.length > 0) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', config.uuid)
        }, 200)
@@ -202,6 +200,9 @@
        }
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
        if (setting.$hasSyncModule) {
          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
        }
      }
      
      reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置
@@ -224,9 +225,6 @@
        total: result.total,
        loading: false
      })
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
    } else {
      this.setState({
        loading: false
@@ -485,7 +483,7 @@
    const { setting } = this.state
    if (!setting.supModule || setting.supModule !== MenuID) return
    if (id !== this.state.BID) {
    if (id !== this.state.BID || id !== '') {
      this.setState({
        pageIndex: 1,
        BID: id,
@@ -503,12 +501,16 @@
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn) => {
  refreshByButtonResult = (menuId, position, btn, id, lines) => {
    const { config, BID } = this.state
    if (config.uuid !== menuId) return
    this.reloadtable(btn)                                                      // 数据刷新
    if (position === 'line' && lines && lines.length === 1) {
      this.loadmainLinedata(lines[0].$$uuid)
    } else {
      this.reloadtable(btn)                                                    // 数据刷新
    }
    if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
      MKEmitter.emit('reloadData', btn.syncComponentId)                        // 同级标签刷新
@@ -538,7 +540,7 @@
          return item
        })
        if (setting.selected !== 'false') {
        if (setting.selected !== 'false' && _data && _data.length > 0) {
          setTimeout(() => {
            MKEmitter.emit('mkCheckTopLine', config.uuid)
          }, 200)
@@ -650,9 +652,7 @@
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    permAction: state.permAction,
    permMenus: state.permMenus
    menuType: state.editLevel
  }
}