king
2023-11-22 8698e2984298f3e16674862507f5f5ebfe504d48
src/menu/components/tabs/antv-tabs/index.jsx
@@ -82,7 +82,7 @@
  changeStyle = () => {
    const { tabs } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], tabs.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], tabs.style, this.getStyle)
  }
  getStyle = (style) => {
@@ -195,8 +195,6 @@
  }
  getTabForms = (tab) => {
    const { tabs } = this.state
    if (!tab) {
      tab = {
        uuid: '',
@@ -210,7 +208,7 @@
      editab: tab
    })
    return getTabForm(tab, tabs.setting)
    return getTabForm(tab)
  }
  updateTab = (res) => {
@@ -221,7 +219,7 @@
    editab.icon = res.icon
    editab.hide = res.hide || 'false'
    editab.backgroundColor = res.backgroundColor
    editab.controlVal = res.controlVal || ''
    // editab.controlVal = res.controlVal || ''
    editab.selectVal = res.selectVal || ''
    editab.blacklist = res.blacklist
@@ -249,11 +247,35 @@
  getTabsForms = () => {
    const { tabs } = this.state
    return getTabsSetForm(tabs.setting, tabs.uuid)
    return getTabsSetForm(tabs.setting, tabs.uuid, tabs.subtabs)
  }
  updateTabs = (res) => {
    this.updateComponent({...this.state.tabs, setting: res})
    let tabs = fromJS(this.state.tabs).toJS()
    if (res.controlVals) {
      let values = {}
      res.controlVals.forEach(item => {
        values[item.uuid] = item.value
      })
      tabs.subtabs.forEach(tab => {
        tab.controlVal = values[tab.uuid]
      })
      delete res.controlVals
    }
    res.tabStyle = res.tabStyle || 'line'
    res.cusClass = ''
    if (!['line', 'card'].includes(res.tabStyle)) {
      res.cusClass = res.tabStyle
      res.tabStyle = 'line'
    }
    tabs.setting = res
    this.updateComponent(tabs)
  }
  onChange = (key) => {
@@ -266,7 +288,7 @@
    let _style = resetStyle(tabs.style)
    return (
      <div className={'menu-tabs-edit-box ' + (tabs.setting.display || '')} style={_style} id={tabs.uuid}>
      <div className="menu-tabs-edit-box" style={_style} id={tabs.uuid}>
        <DraggableTabs defaultActiveKey={defaultActiveKey} tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch} onChange={this.onChange}>
          {tabs.subtabs.map(tab => (
            <TabPane tab={