king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
src/mob/components/tabs/antv-tabs/index.jsx
@@ -80,7 +80,6 @@
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('submitSearch', this.getSearch)
    MKEmitter.addListener('tabsChange', this.handleTabsChange)
    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
@@ -93,7 +92,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
    MKEmitter.removeListener('submitSearch', this.getSearch)
    MKEmitter.removeListener('tabsChange', this.handleTabsChange)
    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
@@ -135,37 +133,33 @@
  changeStyle = () => {
    const { tabs } = this.state
    MKEmitter.emit('changeStyle', [tabs.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], tabs.style)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], tabs.style, this.getStyle)
  }
  changeTabStyle = () => {
    const { tabs } = this.state
    MKEmitter.emit('changeStyle', [tabs.uuid, 'tab'], ['font', 'padding'], tabs.tabStyle || {})
    MKEmitter.emit('changeStyle', ['font', 'padding'], tabs.tabStyle || {}, this.getTabStyle)
  }
  getStyle = (comIds, style) => {
    const { tabs } = this.state
  getStyle = (style) => {
    let _card = {...this.state.tabs, style}
    if (comIds[0] !== tabs.uuid) return
    this.setState({
      tabs: _card
    })
    this.props.updateConfig(_card)
  }
    if (comIds.length === 1) {
      let _card = {...tabs, style}
  getTabStyle = (style) => {
    let _card = {...this.state.tabs, tabStyle: style}
      this.setState({
        tabs: _card
      })
      this.props.updateConfig(_card)
    } else if (comIds[1] === 'tab') {
      let _card = {...tabs, tabStyle: style}
      this.setState({
        tabs: _card
      })
      this.props.updateConfig(_card)
    }
    this.setState({
      tabs: _card
    })
    this.props.updateConfig(_card)
  }
  handleTabsChange = (parentId) => {