king
2022-08-15 704f82b06befe96e5f739b2dce419f76f5683a6f
src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -52,8 +52,13 @@
    if (config.setting.autoSwitch === 'true' && config.subtabs.length > 1 && config.setting.interval) {
      this.autoSwitch(config.setting.interval)
    }
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    if (config.activeKey) {
      let node = document.getElementById('tab' + config.activeKey)
      node && node.click()
    }
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
  }
  /**
@@ -81,13 +86,18 @@
          tabs: {...tabs, subtabs: []}
        })
      } else {
        let val = data[tabs.setting.controlField] === undefined ? '' : data[tabs.setting.controlField] + ''
        let val = ''
        Object.keys(data).forEach(key => {
          if (key.toLowerCase() === tabs.setting.controlField) {
            val = data[key]
          }
        })
        this.setState({
          tabs: {...tabs, subtabs: this.props.config.subtabs.filter(tab => {
            if (tab.controlVal === val) {
              return false
            } else if (/,/ig.test(tab.controlVal)) {
              return tab.controlVal.split(',').includes(val)
              return !tab.controlVal.split(',').includes(val)
            }
            return true
          })}