king
2023-12-17 6092c17b4571e1082d1272fa3104c780af66453d
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -36,7 +36,7 @@
    loading: false,            // 数据加载状态
    card: null,                // 卡片设置
    data: [],                // 数据
    total: null,
    total: 0,
    precards: [],
    nextcards: [],
    selected: 'false',
@@ -129,6 +129,12 @@
    _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''}`
    if (_config.wrap.shifting === 'true') {
      _config.wrap.shifting = 'shifting'
    } else {
      _config.wrap.shifting = ''
    }
    let wrapStyle = null
    let subcard = fromJS(_card).toJS()
    let subconfig = fromJS(_config).toJS()
@@ -223,6 +229,8 @@
    if (config.setting.onload === 'true') {
      this.initExec()
    }
    this.autoExec()
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -316,6 +324,25 @@
    }
  }
  autoExec = (times) => {
    const { config } = this.state
    if (!config.wrap.autoExec) return
    let btn = document.getElementById('button' + config.wrap.autoExec)
    this.autoTimer && clearTimeout(this.autoTimer)
    if (btn) {
      MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [])
    } else if (!times || times < 20) {
      times = times ? times + 1 : 1
      this.autoTimer = setTimeout(() => {
        this.autoExec(times)
      }, 1000)
    }
  }
  searchRefresh = (searchId) => {
    const { config } = this.state
@@ -336,9 +363,9 @@
    let supModule = config.setting.supModule
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid)
        this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position)
      } else {
        this.loadData(id)
      }
@@ -771,7 +798,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadLinedata (id) {
  async loadLinedata (id, position) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
@@ -803,6 +830,11 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadData()
        return
      }
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      let selectKeys = fromJS(this.state.selectKeys).toJS()
@@ -1130,7 +1162,7 @@
    }
    return (
      <div className="double-data-card-box" id={'anchor' + config.uuid} style={config.style}>
      <div className={'double-data-card-box ' + config.wrap.shifting} id={'anchor' + config.uuid} style={config.style}>
        {loading ?
          <div className="loading-mask">
            {data.length ? <div className="ant-spin-blur"></div> : null}