king
2022-03-25 ac3fc53f2c2f69690dbc0b7d5637624bb4457f73
src/tabviews/custom/components/card/data-card/index.jsx
@@ -268,8 +268,29 @@
    if (config.uuid !== menuId) return
    if (position === 'line' && lines && lines.length === 1) {
    if (supComs) {
      btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
      if (position === 'mainline' || position === 'popclose') { // 主表刷新,去除同步刷新组件
        let supNode = supNodes[supNodes.length - 1]
        supComs.forEach((item, i) => {
          if (item === btn.syncComponentId) return
          setTimeout(() => {
            if (supNode && supNode.key === item) {
              MKEmitter.emit('reloadData', item, supNode.value)
            } else {
              MKEmitter.emit('reloadData', item)
            }
          }, i * 10)
        })
      } else if (!btn.syncComponentId || !supComs.includes(btn.syncComponentId)) {
        if (position === 'line') {
          if (lines && lines.length === 1) {
      this.loadLinedata(lines[0].$$uuid)
          } else {
            this.loadData()
          }
    } else if (!btn || btn.resetPageIndex !== 'false') {
      this.setState({
        pageIndex: 1
@@ -279,39 +300,39 @@
    } else {
      this.loadData()
    }
    if (supComs) {
      if (btn.syncComponentId && btn.syncComponentId !== config.uuid && !supComs.includes(btn.syncComponentId)) {
        MKEmitter.emit('reloadData', btn.syncComponentId)                        // 同级标签刷新
      }
      if (position === 'mainline' || position === 'popclose') {                 // 主表行刷新
        let supNode = supNodes[supNodes.length - 1]
        supComs.forEach((item, i) => {
          setTimeout(() => {
            if (supNode && supNode.key === item) {
              MKEmitter.emit('reloadData', item, supNode.value)
            } else {
              MKEmitter.emit('reloadData', item)
      let supModule = config.setting.supModule
      btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
      if (!btn.syncComponentId || btn.syncComponentId !== supModule) {
        if (position === 'line') {
          if (lines && lines.length === 1) {
            this.loadLinedata(lines[0].$$uuid)
          } else {
            this.loadData()
            }
          }, i * 10)
        } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件
          if (supModule && BID) {
            MKEmitter.emit('reloadData', supModule, BID)
          } else {
            this.loadData()
          }
        } else if (!btn || btn.resetPageIndex !== 'false') {
          this.setState({
            pageIndex: 1
          }, () => {
            this.loadData()
        })
        if (position === 'popclose') {                                      // 标签关闭刷新
          btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
        }
      }
    } else {
      if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
        MKEmitter.emit('reloadData', btn.syncComponentId)                        // 同级标签刷新
          this.loadData()
        }
      }
      }
  
      if (position === 'mainline' && config.setting.supModule) {                 // 主表行刷新
        MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
      } else if (position === 'popclose') {                                      // 标签关闭刷新
        config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
    if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项
        btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
      }
    }
  }
@@ -377,7 +398,6 @@
    const { config } = this.state
    if (config.uuid !== menuId) return
    if (id === 'empty') return
    if (!id) {
      this.loadData()