From 55071f5a06673369ceba07e36cd7f85e584c3eac Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 23 十二月 2019 10:55:49 +0800
Subject: [PATCH] 2019-12-23

---
 src/tabviews/commontable/index.jsx |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index d17c945..2e4b459 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -1,17 +1,20 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { BackTop, notification, Spin} from 'antd'
+import { BackTop, notification, Spin, Tabs} from 'antd'
 import moment from 'moment'
 import Api from '@/api'
 import MainSearch from './mainSearch'
 import MainAction from './mainAction'
 import MainTable from './mainTable'
+import SubTable from '@/tabviews/subtable'
 import NotFount from '@/components/404'
 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 { TabPane } = Tabs
 
 export default class NormalTable extends Component {
   static propTpyes = {
@@ -29,6 +32,7 @@
     searchlist: null,
     actions: null,
     columns: null,
+    tabviews: null,
     arr_field: '',
     setting: null,
     data: null,
@@ -39,7 +43,8 @@
     orderColumn: '',
     orderType: 'asc',
     search: '',
-    configMap: {}
+    configMap: {},
+    BID: ''
   }
 
   /**
@@ -136,6 +141,7 @@
         searchlist: config.search,
         actions: _actions,
         columns: _columns,
+        tabviews: config.tabs,
         arr_field: _arrField.join(','),
         search: Utils.initMainSearch(config.search), // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級
         loading: true
@@ -467,8 +473,8 @@
   }
 
   render() {
-    const { setting, searchlist, actions, columns, loadingview, viewlost } = this.state
-
+    const { setting, searchlist, actions, columns, loadingview, viewlost, tabviews } = this.state
+    console.log(setting)
     return (
       <div className="commontable" id={'commontable' + this.props.MenuID}>
         {loadingview && <Spin size="large" />}
@@ -504,6 +510,15 @@
             buttonTrigger={this.buttonTrigger}
           />
         }
+        {setting && setting.tabshow !== 'vertical' && tabviews && tabviews.length > 0 && 
+          <Tabs defaultActiveKey="0" tabPosition="top">
+            {tabviews.map((_tab, index) => (
+              <TabPane tab={ _tab.label } key={`${index}`}>
+                {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={this.props.MenuID} BID={this.state.BID} /> : null}
+              </TabPane>
+            ))}
+          </Tabs>
+        }
         <BackTop>
           <div className="ant-back-top">
             <div className="ant-back-top-content">

--
Gitblit v1.8.0