king
2023-01-16 97e18fa9b628357fa43013cfefc96eec078de25e
src/tabviews/custom/components/card/table-card/index.jsx
@@ -34,6 +34,8 @@
    BData: ''
  }
  loaded = false
  /**
   * @description 初始化处理
   * 1、 initdata 为打印时使用的数据集
@@ -104,6 +106,8 @@
    _config.wrap.pagestyle = _config.wrap.pagestyle || 'page'
    this.loaded = _data !== null
    this.setState({
      sync: _sync,
      BID: BID || '',
@@ -137,6 +141,21 @@
        }, () => {
          this.loadData('timer')
        })
      })
    }
    if (config.$cache && !this.loaded) {
      Api.getLCacheConfig(config.uuid).then(res => {
        if (!res || this.loaded) return
        let _data = res.map((item, index) => {
          item.key = index
          item.$$uuid = item[config.setting.primaryKey] || ''
          item.$Index = index + 1 + ''
          return item
        })
        this.setState({data: _data})
      })
    }
  }
@@ -177,6 +196,8 @@
        item.$Index = index + 1 + ''
        return item
      })
      this.loaded = true
      this.setState({sync: false, data: _data})
    } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
@@ -263,6 +284,8 @@
        data: [],
        total: 0
      })
      this.loaded = true
      return
    }
@@ -295,6 +318,11 @@
      let start = 1
      if (config.setting.laypage) {
        start = config.setting.pageSize * (pageIndex - 1) + 1
      }
      this.loaded = true
      if (config.$cache && pageIndex === 1) {
        Api.writeCacheConfig(config.uuid, result.data || '')
      }
      let data = []
@@ -355,12 +383,12 @@
  openView = (card, data) => {
    if (card.setting.click === 'menu' && card.setting.menu) {
      let menuId = card.setting.MenuID || card.setting.menu.slice(-1)[0]
      let menuId = card.setting.menu.slice(-1)[0]
      let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
      if (!menu && card.setting.MenuName && card.setting.tabType) {
      if (!menu && card.setting.MenuName && card.setting.MenuID) {
        menu = {
          MenuID: menuId,
          MenuID: card.setting.MenuID,
          MenuName: card.setting.MenuName,
          MenuNo: card.setting.MenuNo || '',
          type: card.setting.tabType
@@ -383,13 +411,14 @@
      if (card.setting.joint === 'true') {
        newtab.param.$BID = data.$$uuid || ''
        Object.keys(data).forEach(key => {
          if (/^\$/.test(key)) return
          newtab.param[key] = data[key]
        })
      }
      if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) {
        MKEmitter.emit('modifyTabs', newtab, 'replace')
      } else {
        MKEmitter.emit('modifyTabs', newtab, 'plus', true)
      }
      MKEmitter.emit('modifyTabs', newtab, true)
    } else if (card.setting.click === 'link') {
      let src = card.setting.linkurl