king
2020-08-31 b3547d1c531e479021219fda5df153a11b9b52a3
src/components/tabview/index.jsx
@@ -2,9 +2,7 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import {Tabs, Icon, Button, ConfigProvider, message, BackTop} from 'antd'
import enUS from 'antd/es/locale/en_US'
import zhCN from 'antd/es/locale/zh_CN'
import {Tabs, Icon, Button, message, BackTop} from 'antd'
import moment from 'moment'
import 'moment/locale/zh-cn'
@@ -48,8 +46,7 @@
  state = {
    tabviews: null, // 标签集
    iFrameHeight: 0,
    dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS,
    locale: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
    dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS
  }
  handleTabview = (e, menu) => {
@@ -216,52 +213,50 @@
    return (
      <section className={'flex-container content-box' + (this.props.collapse ? ' collapsed' : '')}>
        <ConfigProvider locale={this.state.locale}>
          <div className="content-header">
            {tabviews && tabviews.length > 0 &&
              <Tabs activeKey={selectedTabId}>
                {tabviews.map(view => {
                  return (
                    <Tabs.TabPane
                      tab={
                        <span className="tab-control">
                          {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage'].includes(view.type) ?
                            <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null
                          }
                          <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}>
                            {view.MenuName}
                          </span>
                          {view.type !== 'Home' ?
                            <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null
                          }
        <div className="content-header">
          {tabviews && tabviews.length > 0 &&
            <Tabs activeKey={selectedTabId}>
              {tabviews.map(view => {
                return (
                  <Tabs.TabPane
                    tab={
                      <span className="tab-control">
                        {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage'].includes(view.type) ?
                          <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null
                        }
                        <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}>
                          {view.MenuName}
                        </span>
                      }
                      key={view.MenuID}
                    >
                      {this.selectcomponent(view)}
                      {options.sysType !== 'cloud' && !['CommonTable', 'TreePage', 'ManageTable', 'CalendarPage'].includes(view.type) ?
                        <Button
                          icon="copy"
                          shape="circle"
                          className={'main-copy ' + (view.type === 'iframe' ? 'ifr-copy' : '')}
                          data-menuno={view.MenuNo}
                          onClick={this.copyMenuNo}
                        /> : null
                      }
                      <BackTop>
                        <div className="ant-back-top">
                          <div className="ant-back-top-content">
                            <div className="ant-back-top-icon"></div>
                          </div>
                        {view.type !== 'Home' ?
                          <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null
                        }
                      </span>
                    }
                    key={view.MenuID}
                  >
                    {this.selectcomponent(view)}
                    {options.sysType !== 'cloud' && !['CommonTable', 'TreePage', 'ManageTable', 'CalendarPage'].includes(view.type) ?
                      <Button
                        icon="copy"
                        shape="circle"
                        className={'main-copy ' + (view.type === 'iframe' ? 'ifr-copy' : '')}
                        data-menuno={view.MenuNo}
                        onClick={this.copyMenuNo}
                      /> : null
                    }
                    <BackTop>
                      <div className="ant-back-top">
                        <div className="ant-back-top-content">
                          <div className="ant-back-top-icon"></div>
                        </div>
                      </BackTop>
                    </Tabs.TabPane>
                  )
                })}
              </Tabs>
            }
          </div>
        </ConfigProvider>
                      </div>
                    </BackTop>
                  </Tabs.TabPane>
                )
              })}
            </Tabs>
          }
        </div>
      </section>
    )
  }