king
2020-09-24 bcef9a2845e6800704fecb3eb60c204f80854a07
src/menu/components/tabs/antv-tabs/index.jsx
@@ -5,13 +5,14 @@
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import './index.scss'
const SettingComponent = asyncComponent(() => import('../tabsetting'))
const SettingComponent = asyncIconComponent(() => import('../tabsetting'))
const TabLabelComponent = asyncComponent(() => import('../tablabelform'))
const TabComponents = asyncComponent(() => import('../tabcomponents'))
@@ -21,7 +22,7 @@
class antvBarLineChart extends Component {
  static propTpyes = {
    tabs: PropTypes.object,
    deleteTabs: PropTypes.func,
    deletecomponent: PropTypes.func,
    updateConfig: PropTypes.func,
  }
@@ -43,7 +44,9 @@
        tabId: tabs.tabId || '',
        parentId: tabs.parentId || '',
        subtype: tabs.subtype,
        setting: {span: 24, position: 'top', tabStyle: 'line', name: tabs.name},
        width: 24,
        name: tabs.name,
        setting: {width: 24, position: 'top', tabStyle: 'line', name: tabs.name},
        subtabs: [
          { uuid: Utils.getuuid(), parentId: tabs.uuid, floor: tabs.floor, label: 'Tab 1', icon: '', components: [] },
          { uuid: Utils.getuuid(), parentId: tabs.uuid, floor: tabs.floor, label: 'Tab 2', icon: '', components: [] },
@@ -94,6 +97,9 @@
      // 注册事件-标签变化,通知标签内元素
      MKEmitter.emit('tabsChange', tabs.uuid)
    }
    component.width = component.setting.width
    component.name = component.setting.name
    this.setState({
      tabs: component
@@ -201,7 +207,6 @@
    return (
      <div className="menu-tabs-edit-box">
        {/* <SettingComponent config={tabs} updateConfig={this.updateComponent} /> */}
        <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}>
          {tabs.subtabs.map((tab, index) => (
            <TabPane tab={
@@ -223,15 +228,14 @@
            <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
              <div className="mk-popover-control">
                <Icon className="plus" title="add" type="plus" onClick={this.tabAdd} />
                <Icon className="close" title="delete" type="delete" onClick={() => this.props.deleteTabs(tabs.uuid)} />
                <SettingComponent config={tabs} updateConfig={this.updateComponent} />
                <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} />
              </div>
            } trigger="hover">
              <Icon type="tool" />
            </Popover>
          } key="tool">
          </TabPane>
          {/* <TabPane className="tab-add" disabled tab={<Icon onClick={this.tabAdd} type="plus" />} key="add"></TabPane> */}
        </Tabs>
        <Modal
          wrapClassName="popview-modal"