king
2020-11-27 a06655e10f4242c350a3450c6c21e77f33302e2e
src/menu/components/tabs/antv-tabs/index.jsx
@@ -7,6 +7,7 @@
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
import DraggableTabs from './dragabletabs'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
@@ -218,9 +219,20 @@
    })
  }
  moveSwitch = (index, index1) => {
  moveSwitch = (order) => {
    let tabs = fromJS(this.state.tabs).toJS()
    tabs.subtabs[index] = tabs.subtabs.splice(index1, 1, tabs.subtabs[index])[0]
    let subtab = {}
    tabs.subtabs.forEach(item => {
      subtab[item.uuid] = item
    })
    tabs.subtabs = []
    order.forEach(item => {
      if (subtab[item]) {
        tabs.subtabs.push(subtab[item])
      }
    })
    this.setState({tabs})
    this.props.updateConfig(tabs)
@@ -231,14 +243,12 @@
    return (
      <div className="menu-tabs-edit-box" style={tabs.style}>
        <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}>
          {tabs.subtabs.map((tab, index) => (
        <DraggableTabs tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch}>
          {tabs.subtabs.map(tab => (
            <TabPane tab={
              <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                <div className="mk-popover-control">
                  <Icon className="edit" title="edit" type="edit" onClick={() => this.editTab(tab)} />
                  {index !== 0 ? <Icon className="edit" type="arrow-left" onClick={() => this.moveSwitch(index, index - 1)} /> : null}
                  {(index + 1) !== tabs.subtabs.length ? <Icon className="edit" type="arrow-right" onClick={() => this.moveSwitch(index, index + 1)} /> : null}
                  <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} />
                </div>
              } trigger="hover">
@@ -261,7 +271,7 @@
            </Popover>
          } key="tool">
          </TabPane>
        </Tabs>
        </DraggableTabs>
        <Modal
          wrapClassName="popview-modal"
          title={'标签编辑'}