| | |
| | | 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' |
| | |
| | | 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 { |
| | |
| | | searchlist: null, |
| | | actions: null, |
| | | columns: null, |
| | | tabviews: null, |
| | | arr_field: '', |
| | | setting: null, |
| | | data: null, |
| | |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | | columns: _columns, |
| | | tabviews: config.tabs, |
| | | isLinkMain: _tab.length > 0, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化) |
| | |
| | | } |
| | | |
| | | 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}> |
| | |
| | | /> |
| | | </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"> |