king
2019-12-30 84e806945ef8982508a79e0b62a7bcb0881b108c
src/tabviews/commontable/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { BackTop, notification, Spin, Tabs, Icon, Card, Switch} from 'antd'
import { BackTop, notification, Spin, Tabs, Icon, Switch} from 'antd'
import moment from 'moment'
import Api from '@/api'
import MainTable from './mainTable'
@@ -9,11 +9,13 @@
import MainSearch from '@/tabviews/tableshare/topSearch'
import SubTable from '@/tabviews/subtable'
import NotFount from '@/components/404'
// import asyncComponent from '@/utils/asyncLoadComponent'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import './index.scss'
// const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable'))
const { TabPane } = Tabs
export default class NormalTable extends Component {
@@ -32,7 +34,6 @@
    searchlist: null,
    actions: null,
    columns: null,
    tabviews: null,
    arr_field: '',
    setting: null,
    data: null,
@@ -144,7 +145,6 @@
        searchlist: config.search,
        actions: _actions,
        columns: _columns,
        tabviews: config.tabs,
        isLinkMain: _tab.length > 0,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
@@ -552,7 +552,7 @@
  }
  render() {
    const { setting, searchlist, actions, columns, loadingview, viewlost, tabviews, setsingle, pickup, isLinkMain } = this.state
    const { setting, searchlist, actions, columns, loadingview, viewlost, setsingle, pickup, isLinkMain, config } = this.state
    return (
      <div className="commontable" id={'commontable' + this.props.MenuID}>
@@ -598,34 +598,28 @@
            />
          </div> : null
        }
        {setting && setting.onload !== 'false' && setting.tabshow !== 'vertical' && tabviews && tabviews.length > 0 &&
          <Tabs defaultActiveKey="0" tabPosition="top">
            {tabviews.map((_tab, index) => {
              return !_tab.supMenu || (_tab.supMenu && this.state.BIDs[_tab.supMenu]) ?
                <TabPane tab={
                  <span>
                    {_tab.icon ? <Icon type={_tab.icon} /> : null}
                    {_tab.label}
                  </span>
                } key={`${index}`}>
                  {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={_tab.linkTab} Tab={_tab} BID={this.state.BIDs[_tab.supMenu] || ''} /> : null}
                </TabPane> : null
            })}
          </Tabs>
        }
        {setting && setting.onload !== 'false' && setting.tabshow === 'vertical' && tabviews && tabviews.length > 0 &&
          tabviews.map((_tab, index) => {
            return !_tab.supMenu || (_tab.supMenu && this.state.BIDs[_tab.supMenu]) ?
              <Card bordered={false} title={
                <span>
                  {_tab.icon ? <Icon type={_tab.icon} /> : null}
                  {_tab.label}
                </span>
              } key={`${index}`}>
                {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={_tab.linkTab} Tab={_tab} BID={this.state.BIDs[_tab.supMenu] || ''} /> : null}
              </Card> : null
        {setting && setting.onload !== 'false' &&
          config.tabgroups.map(group => {
            if (config[group].length === 0) return null
            return (
              <Tabs defaultActiveKey="0" tabPosition="top" key={group}>
                {config[group].map((_tab, index) => {
                  return !_tab.supMenu || (_tab.supMenu && this.state.BIDs[_tab.supMenu]) ?
                    <TabPane tab={
                      <span>
                        {_tab.icon ? <Icon type={_tab.icon} /> : null}
                        {_tab.label}
                      </span>
                    } key={`${index}`}>
                      {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={_tab.linkTab} Tab={_tab} BID={this.state.BIDs[_tab.supMenu] || ''} /> : null}
                    </TabPane> : null
                })}
              </Tabs>
            )
          })
        }
        {/* {<SubTabTable SupMenuID={this.props.SupMenuID} MenuID={this.props.MenuID} Tab={this.props.Tab} BID={this.props.BID} />} */}
        <BackTop>
          <div className="ant-back-top">
            <div className="ant-back-top-content">